[PATCH] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

Subsystems: networking drivers, stmmac ethernet driver, the rest

STALE3760d

3 messages, 3 authors, 2016-05-17 · open the first message on its own page

[PATCH] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Date: 2016-05-16 15:41:30

Commit f748be531d70 ("stmmac: support new GMAC4") reverted a previous fix
by mistake. This commit re-applies said fix:

  commit dec2165ff38a99f937fe61875d102c6c8596c815
  Author: Sonic Zhang [off-list ref]
  Date:   Thu Jan 22 14:55:57 2015 +0800
  stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

  Clear the TX COE bit when force_thresh_dma_mode is set even hardware
  dma capability says support.

  Tested on BF609.

  Signed-off-by: Sonic Zhang [off-list ref]
  Acked-by: Giuseppe Cavallaro [off-list ref]
  Signed-off-by: David S. Miller [off-list ref]

Tested on LPC4350 Hitex board.

Fixes: f748be531d70 ("stmmac: support new GMAC4")
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fd5ab7bfdb76..eac45d0c75e2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3131,7 +3131,12 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
 		priv->plat->enh_desc = priv->dma_cap.enh_desc;
 		priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
 
-		priv->plat->tx_coe = priv->dma_cap.tx_coe;
+		/* TXCOE doesn't work in thresh DMA mode */
+		if (priv->plat->force_thresh_dma_mode)
+			priv->plat->tx_coe = 0;
+		else
+			priv->plat->tx_coe = priv->dma_cap.tx_coe;
+
 		/* In case of GMAC4 rx_coe is from HW cap register. */
 		priv->plat->rx_coe = priv->dma_cap.rx_coe;
 
-- 
2.7.0

Re: [PATCH] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

From: Joachim Eastwood <hidden>
Date: 2016-05-16 17:47:45

Hi Ezequiel,

On 16 May 2016 at 17:41, Ezequiel Garcia [off-list ref] wrote:
quoted hunk
Commit f748be531d70 ("stmmac: support new GMAC4") reverted a previous fix
by mistake. This commit re-applies said fix:

  commit dec2165ff38a99f937fe61875d102c6c8596c815
  Author: Sonic Zhang [off-list ref]
  Date:   Thu Jan 22 14:55:57 2015 +0800
  stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

  Clear the TX COE bit when force_thresh_dma_mode is set even hardware
  dma capability says support.

  Tested on BF609.

  Signed-off-by: Sonic Zhang [off-list ref]
  Acked-by: Giuseppe Cavallaro [off-list ref]
  Signed-off-by: David S. Miller [off-list ref]

Tested on LPC4350 Hitex board.

Fixes: f748be531d70 ("stmmac: support new GMAC4")
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fd5ab7bfdb76..eac45d0c75e2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3131,7 +3131,12 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
                priv->plat->enh_desc = priv->dma_cap.enh_desc;
                priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;

-               priv->plat->tx_coe = priv->dma_cap.tx_coe;
+               /* TXCOE doesn't work in thresh DMA mode */
+               if (priv->plat->force_thresh_dma_mode)
+                       priv->plat->tx_coe = 0;
+               else
+                       priv->plat->tx_coe = priv->dma_cap.tx_coe;
+
                /* In case of GMAC4 rx_coe is from HW cap register. */
                priv->plat->rx_coe = priv->dma_cap.rx_coe;
Works for me on EA4357 board together with another patch to fix the DT
properties for DWMAC on lpc18xx.

Tested-by: Joachim Eastwood <redacted>


regards,
Joachim Eastwood

Re: [PATCH] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

From: David Miller <davem@davemloft.net>
Date: 2016-05-17 02:18:11

From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Date: Mon, 16 May 2016 12:41:07 -0300
Commit f748be531d70 ("stmmac: support new GMAC4") reverted a previous fix
by mistake. This commit re-applies said fix:

  commit dec2165ff38a99f937fe61875d102c6c8596c815
  Author: Sonic Zhang [off-list ref]
  Date:   Thu Jan 22 14:55:57 2015 +0800
  stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

  Clear the TX COE bit when force_thresh_dma_mode is set even hardware
  dma capability says support.

  Tested on BF609.

  Signed-off-by: Sonic Zhang [off-list ref]
  Acked-by: Giuseppe Cavallaro [off-list ref]
  Signed-off-by: David S. Miller [off-list ref]

Tested on LPC4350 Hitex board.

Fixes: f748be531d70 ("stmmac: support new GMAC4")
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help