All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: reset Tx desc base address before restarting Tx
@ 2019-12-06 11:40 ` Jongsung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Jongsung Kim @ 2019-12-06 11:40 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, linux-arm-kernel, linux-stm32, mcoquelin.stm32,
	davem, joabreu, alexandre.torgue, peppe.cavallaro, Jongsung Kim

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>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 644cb5d1fd4f..bbc65bd332a8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2009,6 +2009,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++;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] net: stmmac: reset Tx desc base address before restarting Tx
@ 2019-12-06 11:40 ` Jongsung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Jongsung Kim @ 2019-12-06 11:40 UTC (permalink / raw)
  To: netdev
  Cc: alexandre.torgue, Jongsung Kim, linux-kernel, linux-stm32,
	joabreu, mcoquelin.stm32, peppe.cavallaro, davem,
	linux-arm-kernel

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>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 644cb5d1fd4f..bbc65bd332a8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2009,6 +2009,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++;
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: stmmac: reset Tx desc base address before restarting Tx
  2019-12-06 11:40 ` Jongsung Kim
@ 2019-12-06 19:50   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-12-06 19:50 UTC (permalink / raw)
  To: neidhard.kim
  Cc: netdev, linux-kernel, linux-arm-kernel, linux-stm32,
	mcoquelin.stm32, joabreu, alexandre.torgue, peppe.cavallaro

From: Jongsung Kim <neidhard.kim@lge.com>
Date: Fri,  6 Dec 2019 20:40:00 +0900

> 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>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: stmmac: reset Tx desc base address before restarting Tx
@ 2019-12-06 19:50   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-12-06 19:50 UTC (permalink / raw)
  To: neidhard.kim
  Cc: alexandre.torgue, netdev, linux-kernel, joabreu, mcoquelin.stm32,
	peppe.cavallaro, linux-stm32, linux-arm-kernel

From: Jongsung Kim <neidhard.kim@lge.com>
Date: Fri,  6 Dec 2019 20:40:00 +0900

> 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>

Applied.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-06 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 11:40 [PATCH] net: stmmac: reset Tx desc base address before restarting Tx Jongsung Kim
2019-12-06 11:40 ` Jongsung Kim
2019-12-06 19:50 ` David Miller
2019-12-06 19:50   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.