Skip to contentSkip to conversation

net: bcmgenet: Avoid sleeping in bcmgenet_timeout

PATCH Applied Florian Fainelli 2 participants 2 messages Aug 21, 2015 – Aug 24, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bcmgenet: Avoid sleeping in bcmgenet_timeout

bcmgenet_timeout() executes in atomic context, yet we will invoke napi_disable() which does sleep. Looking back at the changes, disabling TX napi and re-enabling it is completely useless, since we reclaim all TX buffers and re-enable interrupts, and wake up the TX queues.

Fixes 13ea657806cf ("net: bcmgenet: improve TX timeout")

---
Hi David,

Sorry this is caming very late, if this does not make it to 4.2, can you queue this for the 4.2.1 stable tree when it shows up?

Thank you!

 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +0 -4
index 64c1e9db6b0b..12a020c105bb 100644
@@ -2820,8 +2820,6 @@ static void bcmgenet_timeout(struct net_device *dev)
 
 	netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
 
-	bcmgenet_disable_tx_napi(priv);
-
 	for (q = 0; q < priv->hw_params->tx_queues; q++)
 		bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
 	bcmgenet_dump_tx_queue(&priv->tx_rings[DESC_INDEX]);
@@ -2837,8 +2835,6 @@ static void bcmgenet_timeout(struct net_device *dev)
 	bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR);
 	bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
 
-	bcmgenet_enable_tx_napi(priv);
-
 	dev->trans_start = jiffies;
 
 	dev->stats.tx_errors++;
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Thu, 20 Aug 2015 18:04:22 -0700

Quoted 7 lines

bcmgenet_timeout() executes in atomic context, yet we will invoke napi_disable() which does sleep. Looking back at the changes, disabling TX napi and re-enabling it is completely useless, since we reclaim all TX buffers and re-enable interrupts, and wake up the TX queues.

Fixes 13ea657806cf ("net: bcmgenet: improve TX timeout")

Applied, thanks Florian.