From: Greg Kroah-Hartman Date: Sat, 31 Oct 2020 10:23:21 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v5.4.74~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=951b9ce1dcac3a4a1a8187e73076780e6410de97;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: ata-sata_rcar-fix-dma-boundary-mask.patch mtd-lpddr-fix-bad-logic-in-print_drs_error.patch --- diff --git a/queue-4.4/ata-sata_rcar-fix-dma-boundary-mask.patch b/queue-4.4/ata-sata_rcar-fix-dma-boundary-mask.patch new file mode 100644 index 00000000000..7282da15249 --- /dev/null +++ b/queue-4.4/ata-sata_rcar-fix-dma-boundary-mask.patch @@ -0,0 +1,70 @@ +From df9c590986fdb6db9d5636d6cd93bc919c01b451 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Thu, 17 Sep 2020 15:09:20 +0200 +Subject: ata: sata_rcar: Fix DMA boundary mask + +From: Geert Uytterhoeven + +commit df9c590986fdb6db9d5636d6cd93bc919c01b451 upstream. + +Before commit 9495b7e92f716ab2 ("driver core: platform: Initialize +dma_parms for platform devices"), the R-Car SATA device didn't have DMA +parameters. Hence the DMA boundary mask supplied by its driver was +silently ignored, as __scsi_init_queue() doesn't check the return value +of dma_set_seg_boundary(), and the default value of 0xffffffff was used. + +Now the device has gained DMA parameters, the driver-supplied value is +used, and the following warning is printed on Salvator-XS: + + DMA-API: sata_rcar ee300000.sata: mapping sg segment across boundary [start=0x00000000ffffe000] [end=0x00000000ffffefff] [boundary=0x000000001ffffffe] + WARNING: CPU: 5 PID: 38 at kernel/dma/debug.c:1233 debug_dma_map_sg+0x298/0x300 + +(the range of start/end values depend on whether IOMMU support is + enabled or not) + +The issue here is that SATA_RCAR_DMA_BOUNDARY doesn't have bit 0 set, so +any typical end value, which is odd, will trigger the check. + +Fix this by increasing the DMA boundary value by 1. + +This also fixes the following WRITE DMA EXT timeout issue: + + # dd if=/dev/urandom of=/mnt/de1/file1-1024M bs=1M count=1024 + ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen + ata1.00: failed command: WRITE DMA EXT + ata1.00: cmd 35/00:00:00:e6:0c/00:0a:00:00:00/e0 tag 0 dma 1310720 out + res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) + ata1.00: status: { DRDY } + +as seen by Shimoda-san since commit 429120f3df2dba2b ("block: fix +splitting segments on boundary masks"). + +Fixes: 8bfbeed58665dbbf ("sata_rcar: correct 'sata_rcar_sht'") +Fixes: 9495b7e92f716ab2 ("driver core: platform: Initialize dma_parms for platform devices") +Fixes: 429120f3df2dba2b ("block: fix splitting segments on boundary masks") +Signed-off-by: Geert Uytterhoeven +Tested-by: Lad Prabhakar +Tested-by: Yoshihiro Shimoda +Reviewed-by: Christoph Hellwig +Reviewed-by: Greg Kroah-Hartman +Reviewed-by: Sergei Shtylyov +Reviewed-by: Ulf Hansson +Cc: stable +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/sata_rcar.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/ata/sata_rcar.c ++++ b/drivers/ata/sata_rcar.c +@@ -122,7 +122,7 @@ + /* Descriptor table word 0 bit (when DTA32M = 1) */ + #define SATA_RCAR_DTEND BIT(0) + +-#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFEUL ++#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFFUL + + /* Gen2 Physical Layer Control Registers */ + #define RCAR_GEN2_PHY_CTL1_REG 0x1704 diff --git a/queue-4.4/mtd-lpddr-fix-bad-logic-in-print_drs_error.patch b/queue-4.4/mtd-lpddr-fix-bad-logic-in-print_drs_error.patch new file mode 100644 index 00000000000..9245c390205 --- /dev/null +++ b/queue-4.4/mtd-lpddr-fix-bad-logic-in-print_drs_error.patch @@ -0,0 +1,51 @@ +From 1c9c02bb22684f6949d2e7ddc0a3ff364fd5a6fc Mon Sep 17 00:00:00 2001 +From: "Gustavo A. R. Silva" +Date: Mon, 27 Apr 2020 14:50:37 -0500 +Subject: mtd: lpddr: Fix bad logic in print_drs_error + +From: Gustavo A. R. Silva + +commit 1c9c02bb22684f6949d2e7ddc0a3ff364fd5a6fc upstream. + +Update logic for broken test. Use a more common logging style. + +It appears the logic in this function is broken for the +consecutive tests of + + if (prog_status & 0x3) + ... + else if (prog_status & 0x2) + ... + else (prog_status & 0x1) + ... + +Likely the first test should be + + if ((prog_status & 0x3) == 0x3) + +Found by inspection of include files using printk. + +Fixes: eb3db27507f7 ("[MTD] LPDDR PFOW definition") +Cc: stable@vger.kernel.org +Reported-by: Joe Perches +Signed-off-by: Gustavo A. R. Silva +Acked-by: Miquel Raynal +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/3fb0e29f5b601db8be2938a01d974b00c8788501.1588016644.git.gustavo@embeddedor.com +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/mtd/pfow.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/mtd/pfow.h ++++ b/include/linux/mtd/pfow.h +@@ -127,7 +127,7 @@ static inline void print_drs_error(unsig + + if (!(dsr & DSR_AVAILABLE)) + printk(KERN_NOTICE"DSR.15: (0) Device not Available\n"); +- if (prog_status & 0x03) ++ if ((prog_status & 0x03) == 0x03) + printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid " + "half with 41h command\n"); + else if (prog_status & 0x02) diff --git a/queue-4.4/series b/queue-4.4/series index 068533b2184..b1078226cbf 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -4,3 +4,5 @@ powerpc-powernv-opal-dump-use-irq_handled-instead-of-numbers-in-interrupt-handle efivarfs-replace-invalid-slashes-with-exclamation-marks-in-dentries.patch ravb-fix-bit-fields-checking-in-ravb_hwtstamp_get.patch tipc-fix-memory-leak-caused-by-tipc_buf_append.patch +mtd-lpddr-fix-bad-logic-in-print_drs_error.patch +ata-sata_rcar-fix-dma-boundary-mask.patch