2021-02-24 01:23:43 +00:00
|
|
|
From 90eda07518ea7e8d1b3e6445eb3633eef9f65218 Mon Sep 17 00:00:00 2001
|
2021-02-19 11:25:38 +00:00
|
|
|
From: Sieng Piaw Liew <liew.s.piaw@gmail.com>
|
2021-02-24 01:23:43 +00:00
|
|
|
Date: Mon, 22 Feb 2021 09:15:12 +0800
|
|
|
|
Subject: [PATCH net] bcm63xx_enet: fix sporadic kernel panic
|
2021-02-19 11:25:38 +00:00
|
|
|
|
|
|
|
In ndo_stop functions, netdev_completed_queue() is called during forced
|
|
|
|
tx reclaim, after netdev_reset_queue(). This may trigger kernel panic if
|
|
|
|
there is any tx skb left.
|
|
|
|
|
|
|
|
This patch moves netdev_reset_queue() to after tx reclaim, so BQL can
|
|
|
|
complete successfully then reset.
|
|
|
|
|
|
|
|
Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
|
2021-02-24 01:23:43 +00:00
|
|
|
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
|
|
|
|
Fixes: 4c59b0f5543d ("bcm63xx_enet: add BQL support")
|
|
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
2021-02-19 11:25:38 +00:00
|
|
|
---
|
|
|
|
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 8 ++++++--
|
|
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
|
2021-02-17 18:07:23 +00:00
|
|
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
|
|
|
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
2021-02-19 11:25:38 +00:00
|
|
|
@@ -1192,7 +1192,6 @@ static int bcm_enet_stop(struct net_devi
|
2021-02-17 18:07:23 +00:00
|
|
|
kdev = &priv->pdev->dev;
|
|
|
|
|
|
|
|
netif_stop_queue(dev);
|
|
|
|
- netdev_reset_queue(dev);
|
|
|
|
napi_disable(&priv->napi);
|
|
|
|
if (priv->has_phy)
|
|
|
|
phy_stop(dev->phydev);
|
2021-02-19 11:25:38 +00:00
|
|
|
@@ -1231,6 +1230,9 @@ static int bcm_enet_stop(struct net_devi
|
|
|
|
if (priv->has_phy)
|
|
|
|
phy_disconnect(dev->phydev);
|
2021-02-17 18:07:23 +00:00
|
|
|
|
2021-02-19 11:25:38 +00:00
|
|
|
+ /* reset BQL after forced tx reclaim to not kernel panic */
|
2021-02-17 18:07:23 +00:00
|
|
|
+ netdev_reset_queue(dev);
|
2021-02-19 11:25:38 +00:00
|
|
|
+
|
|
|
|
return 0;
|
|
|
|
}
|
2021-02-17 18:07:23 +00:00
|
|
|
|
|
|
|
@@ -2343,7 +2345,6 @@ static int bcm_enetsw_stop(struct net_de
|
|
|
|
|
|
|
|
del_timer_sync(&priv->swphy_poll);
|
|
|
|
netif_stop_queue(dev);
|
|
|
|
- netdev_reset_queue(dev);
|
|
|
|
napi_disable(&priv->napi);
|
|
|
|
del_timer_sync(&priv->rx_timeout);
|
|
|
|
|
2021-02-19 11:25:38 +00:00
|
|
|
@@ -2371,6 +2372,9 @@ static int bcm_enetsw_stop(struct net_de
|
|
|
|
free_irq(priv->irq_tx, dev);
|
|
|
|
free_irq(priv->irq_rx, dev);
|
|
|
|
|
|
|
|
+ /* reset BQL after forced tx reclaim to not kernel panic */
|
|
|
|
+ netdev_reset_queue(dev);
|
|
|
|
+
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|