]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: reset Tx desc base address before restarting Tx
authorJongsung Kim <neidhard.kim@lge.com>
Fri, 6 Dec 2019 11:40:00 +0000 (20:40 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Sep 2021 12:07:09 +0000 (14:07 +0200)
commit 44702d700f917a2e3d2182869840503ac36abffd upstream.

Refer to the databook of DesignWare Cores Ethernet MAC Universal:

6.2.1.5 Register 4 (Transmit Descriptor List Address Register

If this register is not changed when the ST bit is set to 0, then
the DMA takes the descriptor address where it was stopped earlier.

The stmmac_tx_err() does zero indices to Tx descriptors, but does
not reset HW current Tx descriptor address. To fix inconsistency,
the base address of the Tx descriptors should be rewritten before
restarting Tx.

Signed-off-by: Jongsung Kim <neidhard.kim@lge.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 10d28be73f456d51ae9f2dbcd5bcbae2d7f12220..4e7cfd3bfcd2e7099dbd38ecffc0df9ccfb4a11d 100644 (file)
@@ -1987,6 +1987,8 @@ static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)
        tx_q->cur_tx = 0;
        tx_q->mss = 0;
        netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, chan));
+       stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
+                           tx_q->dma_tx_phy, chan);
        stmmac_start_tx_dma(priv, chan);
 
        priv->dev->stats.tx_errors++;