Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:43 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:49 +0200
commit33631cc1f465483e8059015bdeaf92089d19c183 (patch)
treeb7970ffeb7493e14f12272a6356b70ead0ff2b72
parentd6916982b62d8361c4abd80596821c82612709b2 (diff)
net: macb: Change interrupt and napi enable order in open
-rw-r--r--patches.kernel.org/5.1.3-021-net-macb-Change-interrupt-and-napi-enable-order.patch58
-rw-r--r--series.conf1
2 files changed, 59 insertions, 0 deletions
diff --git a/patches.kernel.org/5.1.3-021-net-macb-Change-interrupt-and-napi-enable-order.patch b/patches.kernel.org/5.1.3-021-net-macb-Change-interrupt-and-napi-enable-order.patch
new file mode 100644
index 0000000000..1be5a091e8
--- /dev/null
+++ b/patches.kernel.org/5.1.3-021-net-macb-Change-interrupt-and-napi-enable-order.patch
@@ -0,0 +1,58 @@
+From: Harini Katakam <harini.katakam@xilinx.com>
+Date: Tue, 7 May 2019 19:59:10 +0530
+Subject: [PATCH] net: macb: Change interrupt and napi enable order in open
+References: bnc#1012628
+Patch-mainline: 5.1.3
+Git-commit: 0504453139ef5a593c9587e1e851febee859c7d8
+
+[ Upstream commit 0504453139ef5a593c9587e1e851febee859c7d8 ]
+
+Current order in open:
+-> Enable interrupts (macb_init_hw)
+-> Enable NAPI
+-> Start PHY
+
+Sequence of RX handling:
+-> RX interrupt occurs
+-> Interrupt is cleared and interrupt bits disabled in handler
+-> NAPI is scheduled
+-> In NAPI, RX budget is processed and RX interrupts are re-enabled
+
+With the above, on QEMU or fixed link setups (where PHY state doesn't
+matter), there's a chance macb RX interrupt occurs before NAPI is
+enabled. This will result in NAPI being scheduled before it is enabled.
+Fix this macb open by changing the order.
+
+Fixes: ae1f2a56d273 ("net: macb: Added support for many RX queues")
+Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
+Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/net/ethernet/cadence/macb_main.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
+index 3da2795e2486..a6535e226d84 100644
+--- a/drivers/net/ethernet/cadence/macb_main.c
++++ b/drivers/net/ethernet/cadence/macb_main.c
+@@ -2461,12 +2461,12 @@ static int macb_open(struct net_device *dev)
+ goto pm_exit;
+ }
+
+- bp->macbgem_ops.mog_init_rings(bp);
+- macb_init_hw(bp);
+-
+ for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
+ napi_enable(&queue->napi);
+
++ bp->macbgem_ops.mog_init_rings(bp);
++ macb_init_hw(bp);
++
+ /* schedule a link state check */
+ phy_start(dev->phydev);
+
+--
+2.21.0
+
diff --git a/series.conf b/series.conf
index 75adc0cdbc..f6048803b0 100644
--- a/series.conf
+++ b/series.conf
@@ -106,6 +106,7 @@
patches.kernel.org/5.1.3-018-ipv4-Fix-raw-socket-lookup-for-local-traffic.patch
patches.kernel.org/5.1.3-019-net-dsa-Fix-error-cleanup-path-in-dsa_init_modu.patch
patches.kernel.org/5.1.3-020-net-ethernet-stmmac-dwmac-sun8i-enable-support-.patch
+ patches.kernel.org/5.1.3-021-net-macb-Change-interrupt-and-napi-enable-order.patch
########################################################
# Build fixes that apply to the vanilla kernel too.