Skip to content

Commit e820653

Browse files
Ryceancurrygregkh
authored andcommitted
net: bcmgenet: fix racing timeout handler
[ Upstream commit 5393b2b ] The bcmgenet_timeout handler tries to take down all tx queues when a single queue times out. This is over zealous and causes many race conditions with queues that are still chugging along. Instead lets only restart the timed out queue. Fixes: 13ea657 ("net: bcmgenet: improve TX timeout") Signed-off-by: Justin Chen <justin.chen@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Tested-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20260406175756.134567-4-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1b0865a commit e820653

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,27 +3474,23 @@ static void bcmgenet_dump_tx_queue(struct bcmgenet_tx_ring *ring)
34743474
static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
34753475
{
34763476
struct bcmgenet_priv *priv = netdev_priv(dev);
3477-
u32 int1_enable = 0;
3478-
unsigned int q;
3477+
struct bcmgenet_tx_ring *ring = &priv->tx_rings[txqueue];
3478+
struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
34793479

34803480
netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
34813481

3482-
for (q = 0; q <= priv->hw_params->tx_queues; q++)
3483-
bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
3484-
3485-
bcmgenet_tx_reclaim_all(dev);
3482+
bcmgenet_dump_tx_queue(ring);
34863483

3487-
for (q = 0; q <= priv->hw_params->tx_queues; q++)
3488-
int1_enable |= (1 << q);
3484+
bcmgenet_tx_reclaim(dev, ring, true);
34893485

3490-
/* Re-enable TX interrupts if disabled */
3491-
bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
3486+
/* Re-enable the TX interrupt for this ring */
3487+
bcmgenet_intrl2_1_writel(priv, 1 << txqueue, INTRL2_CPU_MASK_CLEAR);
34923488

3493-
netif_trans_update(dev);
3489+
txq_trans_cond_update(txq);
34943490

3495-
BCMGENET_STATS64_INC((&priv->tx_rings[txqueue].stats64), errors);
3491+
BCMGENET_STATS64_INC((&ring->stats64), errors);
34963492

3497-
netif_tx_wake_all_queues(dev);
3493+
netif_tx_wake_queue(txq);
34983494
}
34993495

35003496
#define MAX_MDF_FILTER 17

0 commit comments

Comments
 (0)