Skip to content

Commit 45eaaf0

Browse files
Ryceancurrynbuchwitz
authored andcommitted
net: bcmgenet: fix racing timeout handler
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>
1 parent 060fe79 commit 45eaaf0

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
@@ -3475,27 +3475,23 @@ static void bcmgenet_dump_tx_queue(struct bcmgenet_tx_ring *ring)
34753475
static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
34763476
{
34773477
struct bcmgenet_priv *priv = netdev_priv(dev);
3478-
u32 int1_enable = 0;
3479-
unsigned int q;
3478+
struct bcmgenet_tx_ring *ring = &priv->tx_rings[txqueue];
3479+
struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
34803480

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

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

3488-
for (q = 0; q <= priv->hw_params->tx_queues; q++)
3489-
int1_enable |= (1 << q);
3485+
bcmgenet_tx_reclaim(dev, ring, true);
34903486

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

3494-
netif_trans_update(dev);
3490+
txq_trans_cond_update(txq);
34953491

3496-
BCMGENET_STATS64_INC((&priv->tx_rings[txqueue].stats64), errors);
3492+
BCMGENET_STATS64_INC((&ring->stats64), errors);
34973493

3498-
netif_tx_wake_all_queues(dev);
3494+
netif_tx_wake_queue(txq);
34993495
}
35003496

35013497
#define MAX_MDF_FILTER 17

0 commit comments

Comments
 (0)