Skip to content

Commit 681fdfe

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 b3eb3a6 commit 681fdfe

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
@@ -3465,27 +3465,23 @@ static void bcmgenet_dump_tx_queue(struct bcmgenet_tx_ring *ring)
34653465
static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
34663466
{
34673467
struct bcmgenet_priv *priv = netdev_priv(dev);
3468-
u32 int1_enable = 0;
3469-
unsigned int q;
3468+
struct bcmgenet_tx_ring *ring = &priv->tx_rings[txqueue];
3469+
struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
34703470

34713471
netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
34723472

3473-
for (q = 0; q <= priv->hw_params->tx_queues; q++)
3474-
bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
3475-
3476-
bcmgenet_tx_reclaim_all(dev);
3473+
bcmgenet_dump_tx_queue(ring);
34773474

3478-
for (q = 0; q <= priv->hw_params->tx_queues; q++)
3479-
int1_enable |= (1 << q);
3475+
bcmgenet_tx_reclaim(dev, ring, true);
34803476

3481-
/* Re-enable TX interrupts if disabled */
3482-
bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
3477+
/* Re-enable the TX interrupt for this ring */
3478+
bcmgenet_intrl2_1_writel(priv, 1 << txqueue, INTRL2_CPU_MASK_CLEAR);
34833479

3484-
netif_trans_update(dev);
3480+
txq_trans_cond_update(txq);
34853481

3486-
BCMGENET_STATS64_INC((&priv->tx_rings[txqueue].stats64), errors);
3482+
BCMGENET_STATS64_INC((&ring->stats64), errors);
34873483

3488-
netif_tx_wake_all_queues(dev);
3484+
netif_tx_wake_queue(txq);
34893485
}
34903486

34913487
#define MAX_MDF_FILTER 17

0 commit comments

Comments
 (0)