]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jul 2017 09:52:20 +0000 (11:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jul 2017 09:52:20 +0000 (11:52 +0200)
added patches:
mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch
net-korina-fix-napi-versus-resources-freeing.patch

queue-3.18/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch [new file with mode: 0644]
queue-3.18/net-korina-fix-napi-versus-resources-freeing.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch b/queue-3.18/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch
new file mode 100644 (file)
index 0000000..8b5219e
--- /dev/null
@@ -0,0 +1,41 @@
+From 2a36a5c30eab9cd1c9d2d08bd27cd763325d70c5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Sat, 5 Dec 2015 02:09:43 +0100
+Subject: mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Rafał Miłecki <zajec5@gmail.com>
+
+commit 2a36a5c30eab9cd1c9d2d08bd27cd763325d70c5 upstream.
+
+We allowed using bcm47xxpart on BCM5301X arch with commit:
+9e3afa5f5c7 ("mtd: bcm47xxpart: allow enabling on ARCH_BCM_5301X")
+
+BCM5301X devices may contain some partitions in higher memory, e.g.
+Netgear R8000 has board_data at 0x2600000. To detect them we should
+use size limit on MIPS only.
+
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/bcm47xxpart.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/bcm47xxpart.c
++++ b/drivers/mtd/bcm47xxpart.c
+@@ -87,8 +87,8 @@ static int bcm47xxpart_parse(struct mtd_
+       /* Parse block by block looking for magics */
+       for (offset = 0; offset <= master->size - blocksize;
+            offset += blocksize) {
+-              /* Nothing more in higher memory */
+-              if (offset >= 0x2000000)
++              /* Nothing more in higher memory on BCM47XX (MIPS) */
++              if (config_enabled(CONFIG_BCM47XX) && offset >= 0x2000000)
+                       break;
+               if (curr_part >= BCM47XXPART_MAX_PARTS) {
diff --git a/queue-3.18/net-korina-fix-napi-versus-resources-freeing.patch b/queue-3.18/net-korina-fix-napi-versus-resources-freeing.patch
new file mode 100644 (file)
index 0000000..21e4d7e
--- /dev/null
@@ -0,0 +1,59 @@
+From e6afb1ad88feddf2347ea779cfaf4d03d3cd40b6 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Fri, 23 Dec 2016 19:56:56 -0800
+Subject: net: korina: Fix NAPI versus resources freeing
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+commit e6afb1ad88feddf2347ea779cfaf4d03d3cd40b6 upstream.
+
+Commit beb0babfb77e ("korina: disable napi on close and restart")
+introduced calls to napi_disable() that were missing before,
+unfortunately this leaves a small window during which NAPI has a chance
+to run, yet we just freed resources since korina_free_ring() has been
+called:
+
+Fix this by disabling NAPI first then freeing resource, and make sure
+that we also cancel the restart task before doing the resource freeing.
+
+Fixes: beb0babfb77e ("korina: disable napi on close and restart")
+Reported-by: Alexandros C. Couloumbis <alex@ozo.com>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/korina.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/korina.c
++++ b/drivers/net/ethernet/korina.c
+@@ -900,10 +900,10 @@ static void korina_restart_task(struct w
+                               DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR,
+                               &lp->rx_dma_regs->dmasm);
+-      korina_free_ring(dev);
+-
+       napi_disable(&lp->napi);
++      korina_free_ring(dev);
++
+       if (korina_init(dev) < 0) {
+               printk(KERN_ERR "%s: cannot restart device\n", dev->name);
+               return;
+@@ -1064,12 +1064,12 @@ static int korina_close(struct net_devic
+       tmp = tmp | DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR;
+       writel(tmp, &lp->rx_dma_regs->dmasm);
+-      korina_free_ring(dev);
+-
+       napi_disable(&lp->napi);
+       cancel_work_sync(&lp->restart_task);
++      korina_free_ring(dev);
++
+       free_irq(lp->rx_irq, dev);
+       free_irq(lp->tx_irq, dev);
+       free_irq(lp->ovr_irq, dev);
index 3a8c652a1e3c0f79e384418f424dc5abb287455b..2509f49196a983526320214c02eab3f249957453 100644 (file)
@@ -22,3 +22,5 @@ usb-gadget-f_fs-fix-possibe-deadlock.patch
 sysctl-enable-strict-writes.patch
 mm-numa-avoid-waiting-on-freed-migrated-pages.patch
 arm-dts-bcm5301x-correct-gic_ppi-interrupt-flags.patch
+net-korina-fix-napi-versus-resources-freeing.patch
+mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch