mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 07:51:31 -04:00
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: 13ea657806 ("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>
This commit is contained in:
committed by
Jakub Kicinski
parent
3f3168300e
commit
5393b2b5be
@@ -3477,27 +3477,23 @@ static void bcmgenet_dump_tx_queue(struct bcmgenet_tx_ring *ring)
|
||||
static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
u32 int1_enable = 0;
|
||||
unsigned int q;
|
||||
struct bcmgenet_tx_ring *ring = &priv->tx_rings[txqueue];
|
||||
struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
|
||||
|
||||
netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
|
||||
|
||||
for (q = 0; q <= priv->hw_params->tx_queues; q++)
|
||||
bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
|
||||
bcmgenet_dump_tx_queue(ring);
|
||||
|
||||
bcmgenet_tx_reclaim_all(dev);
|
||||
bcmgenet_tx_reclaim(dev, ring, true);
|
||||
|
||||
for (q = 0; q <= priv->hw_params->tx_queues; q++)
|
||||
int1_enable |= (1 << q);
|
||||
/* Re-enable the TX interrupt for this ring */
|
||||
bcmgenet_intrl2_1_writel(priv, 1 << txqueue, INTRL2_CPU_MASK_CLEAR);
|
||||
|
||||
/* Re-enable TX interrupts if disabled */
|
||||
bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
|
||||
txq_trans_cond_update(txq);
|
||||
|
||||
netif_trans_update(dev);
|
||||
BCMGENET_STATS64_INC((&ring->stats64), errors);
|
||||
|
||||
BCMGENET_STATS64_INC((&priv->tx_rings[txqueue].stats64), errors);
|
||||
|
||||
netif_tx_wake_all_queues(dev);
|
||||
netif_tx_wake_queue(txq);
|
||||
}
|
||||
|
||||
#define MAX_MDF_FILTER 17
|
||||
|
||||
Reference in New Issue
Block a user