From: Sasha Levin Date: Thu, 30 Jan 2020 11:55:19 +0000 (-0500) Subject: fixes for 4.4 X-Git-Tag: v5.5.1~15^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a09564127c1269540d078edb59dd0b522473155c;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/atm-eni-fix-uninitialized-variable-warning.patch b/queue-4.4/atm-eni-fix-uninitialized-variable-warning.patch new file mode 100644 index 00000000000..03b02aee719 --- /dev/null +++ b/queue-4.4/atm-eni-fix-uninitialized-variable-warning.patch @@ -0,0 +1,52 @@ +From 4109f30027ba0fb53654553c3f416eb7489c642d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Jan 2020 21:43:59 +0100 +Subject: atm: eni: fix uninitialized variable warning + +From: Arnd Bergmann + +[ Upstream commit 30780d086a83332adcd9362281201cee7c3d9d19 ] + +With -O3, gcc has found an actual unintialized variable stored +into an mmio register in two instances: + +drivers/atm/eni.c: In function 'discard': +drivers/atm/eni.c:465:13: error: 'dma[1]' is used uninitialized in this function [-Werror=uninitialized] + writel(dma[i*2+1],eni_dev->rx_dma+dma_wr*8+4); + ^ +drivers/atm/eni.c:465:13: error: 'dma[3]' is used uninitialized in this function [-Werror=uninitialized] + +Change the code to always write zeroes instead. + +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/atm/eni.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c +index 6339efd326972..ad591a2f7c822 100644 +--- a/drivers/atm/eni.c ++++ b/drivers/atm/eni.c +@@ -372,7 +372,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb, + here = (eni_vcc->descr+skip) & (eni_vcc->words-1); + dma[j++] = (here << MID_DMA_COUNT_SHIFT) | (vcc->vci + << MID_DMA_VCI_SHIFT) | MID_DT_JK; +- j++; ++ dma[j++] = 0; + } + here = (eni_vcc->descr+size+skip) & (eni_vcc->words-1); + if (!eff) size += skip; +@@ -445,7 +445,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb, + if (size != eff) { + dma[j++] = (here << MID_DMA_COUNT_SHIFT) | + (vcc->vci << MID_DMA_VCI_SHIFT) | MID_DT_JK; +- j++; ++ dma[j++] = 0; + } + if (!j || j > 2*RX_DMA_BUF) { + printk(KERN_CRIT DEV_LABEL "!j or j too big!!!\n"); +-- +2.20.1 + diff --git a/queue-4.4/drivers-net-b44-change-to-non-atomic-bit-operations-.patch b/queue-4.4/drivers-net-b44-change-to-non-atomic-bit-operations-.patch new file mode 100644 index 00000000000..3bd31fc1dec --- /dev/null +++ b/queue-4.4/drivers-net-b44-change-to-non-atomic-bit-operations-.patch @@ -0,0 +1,66 @@ +From c7d08d5acb956bb25fc932a19cddb6cfd4a1d735 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Jan 2020 13:27:06 -0800 +Subject: drivers/net/b44: Change to non-atomic bit operations on pwol_mask + +From: Fenghua Yu + +[ Upstream commit f11421ba4af706cb4f5703de34fa77fba8472776 ] + +Atomic operations that span cache lines are super-expensive on x86 +(not just to the current processor, but also to other processes as all +memory operations are blocked until the operation completes). Upcoming +x86 processors have a switch to cause such operations to generate a #AC +trap. It is expected that some real time systems will enable this mode +in BIOS. + +In preparation for this, it is necessary to fix code that may execute +atomic instructions with operands that cross cachelines because the #AC +trap will crash the kernel. + +Since "pwol_mask" is local and never exposed to concurrency, there is +no need to set bits in pwol_mask using atomic operations. + +Directly operate on the byte which contains the bit instead of using +__set_bit() to avoid any big endian concern due to type cast to +unsigned long in __set_bit(). + +Suggested-by: Peter Zijlstra +Signed-off-by: Fenghua Yu +Signed-off-by: Tony Luck +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/b44.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c +index a3b1c07ae0af0..e7214edfe5b46 100644 +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -1524,8 +1524,10 @@ static int b44_magic_pattern(u8 *macaddr, u8 *ppattern, u8 *pmask, int offset) + int ethaddr_bytes = ETH_ALEN; + + memset(ppattern + offset, 0xff, magicsync); +- for (j = 0; j < magicsync; j++) +- set_bit(len++, (unsigned long *) pmask); ++ for (j = 0; j < magicsync; j++) { ++ pmask[len >> 3] |= BIT(len & 7); ++ len++; ++ } + + for (j = 0; j < B44_MAX_PATTERNS; j++) { + if ((B44_PATTERN_SIZE - len) >= ETH_ALEN) +@@ -1537,7 +1539,8 @@ static int b44_magic_pattern(u8 *macaddr, u8 *ppattern, u8 *pmask, int offset) + for (k = 0; k< ethaddr_bytes; k++) { + ppattern[offset + magicsync + + (j * ETH_ALEN) + k] = macaddr[k]; +- set_bit(len++, (unsigned long *) pmask); ++ pmask[len >> 3] |= BIT(len & 7); ++ len++; + } + } + return len - 1; +-- +2.20.1 + diff --git a/queue-4.4/net-wan-sdla-fix-cast-from-pointer-to-integer-of-dif.patch b/queue-4.4/net-wan-sdla-fix-cast-from-pointer-to-integer-of-dif.patch new file mode 100644 index 00000000000..8621d2ba78b --- /dev/null +++ b/queue-4.4/net-wan-sdla-fix-cast-from-pointer-to-integer-of-dif.patch @@ -0,0 +1,43 @@ +From 992b79e207d473ed383f5411d82c5e28c096a4a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 4 Jan 2020 15:31:43 +0100 +Subject: net: wan: sdla: Fix cast from pointer to integer of different size +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Krzysztof Kozlowski + +[ Upstream commit 00c0688cecadbf7ac2f5b4cdb36d912a2d3f0cca ] + +Since net_device.mem_start is unsigned long, it should not be cast to +int right before casting to pointer. This fixes warning (compile +testing on alpha architecture): + + drivers/net/wan/sdla.c: In function ‘sdla_transmit’: + drivers/net/wan/sdla.c:711:13: warning: + cast to pointer from integer of different size [-Wint-to-pointer-cast] + +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/wan/sdla.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c +index 421ac5f856994..79fd891509479 100644 +--- a/drivers/net/wan/sdla.c ++++ b/drivers/net/wan/sdla.c +@@ -711,7 +711,7 @@ static netdev_tx_t sdla_transmit(struct sk_buff *skb, + + spin_lock_irqsave(&sdla_lock, flags); + SDLA_WINDOW(dev, addr); +- pbuf = (void *)(((int) dev->mem_start) + (addr & SDLA_ADDR_MASK)); ++ pbuf = (void *)(dev->mem_start + (addr & SDLA_ADDR_MASK)); + __sdla_write(dev, pbuf->buf_addr, skb->data, skb->len); + SDLA_WINDOW(dev, addr); + pbuf->opp_flag = 1; +-- +2.20.1 + diff --git a/queue-4.4/series b/queue-4.4/series index edf6141bcf5..020b3724739 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -13,3 +13,8 @@ ath9k-fix-storage-endpoint-lookup.patch brcmfmac-fix-interface-sanity-check.patch rtl8xxxu-fix-interface-sanity-check.patch zd1211rw-fix-storage-endpoint-lookup.patch +watchdog-rn5t618_wdt-fix-module-aliases.patch +drivers-net-b44-change-to-non-atomic-bit-operations-.patch +net-wan-sdla-fix-cast-from-pointer-to-integer-of-dif.patch +atm-eni-fix-uninitialized-variable-warning.patch +usb-storage-disable-uas-on-jmicron-sata-enclosure.patch diff --git a/queue-4.4/usb-storage-disable-uas-on-jmicron-sata-enclosure.patch b/queue-4.4/usb-storage-disable-uas-on-jmicron-sata-enclosure.patch new file mode 100644 index 00000000000..d948ccecc61 --- /dev/null +++ b/queue-4.4/usb-storage-disable-uas-on-jmicron-sata-enclosure.patch @@ -0,0 +1,47 @@ +From c0a13afebf81e1e6e2fac5ec1c6393c163f8b520 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 8 Sep 2015 09:53:38 -0700 +Subject: usb-storage: Disable UAS on JMicron SATA enclosure + +From: Laura Abbott + +[ Upstream commit bc3bdb12bbb3492067c8719011576370e959a2e6 ] + +Steve Ellis reported incorrect block sizes and alignement +offsets with a SATA enclosure. Adding a quirk to disable +UAS fixes the problems. + +Reported-by: Steven Ellis +Cc: Pacho Ramos +Signed-off-by: Laura Abbott +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/storage/unusual_uas.h | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 8ed80f28416fa..9aad6825947c8 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -162,12 +162,15 @@ UNUSUAL_DEV(0x2537, 0x1068, 0x0000, 0x9999, + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_IGNORE_UAS), + +-/* Reported-by: Takeo Nakayama */ ++/* ++ * Initially Reported-by: Takeo Nakayama ++ * UAS Ignore Reported by Steven Ellis ++ */ + UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999, + "JMicron", + "JMS566", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, +- US_FL_NO_REPORT_OPCODES), ++ US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS), + + /* Reported-by: Hans de Goede */ + UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, +-- +2.20.1 + diff --git a/queue-4.4/watchdog-rn5t618_wdt-fix-module-aliases.patch b/queue-4.4/watchdog-rn5t618_wdt-fix-module-aliases.patch new file mode 100644 index 00000000000..f5065cf2855 --- /dev/null +++ b/queue-4.4/watchdog-rn5t618_wdt-fix-module-aliases.patch @@ -0,0 +1,37 @@ +From 8fc582c2ebdd411b0cd0535049bf5c19b3c5ba19 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Dec 2019 22:48:02 +0100 +Subject: watchdog: rn5t618_wdt: fix module aliases + +From: Andreas Kemnade + +[ Upstream commit a76dfb859cd42df6e3d1910659128ffcd2fb6ba2 ] + +Platform device aliases were missing so module autoloading +did not work. + +Signed-off-by: Andreas Kemnade +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20191213214802.22268-1-andreas@kemnade.info +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Sasha Levin +--- + drivers/watchdog/rn5t618_wdt.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/watchdog/rn5t618_wdt.c b/drivers/watchdog/rn5t618_wdt.c +index d1c12278cb6a1..8b6eff26e4808 100644 +--- a/drivers/watchdog/rn5t618_wdt.c ++++ b/drivers/watchdog/rn5t618_wdt.c +@@ -193,6 +193,7 @@ static struct platform_driver rn5t618_wdt_driver = { + + module_platform_driver(rn5t618_wdt_driver); + ++MODULE_ALIAS("platform:rn5t618-wdt"); + MODULE_AUTHOR("Beniamino Galvani "); + MODULE_DESCRIPTION("RN5T618 watchdog driver"); + MODULE_LICENSE("GPL v2"); +-- +2.20.1 +