stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
authorSonic Zhang <sonic.zhang@analog.com>
Thu, 22 Jan 2015 06:55:57 +0000 (14:55 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jan 2015 23:48:01 +0000 (15:48 -0800)
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 <sonic.zhang@analog.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 6e2a8fa07da55ba660ce066994490bd214bc4c7f..5ef493aa5387787a05729d72af559c2b27b43348 100644 (file)
@@ -2755,7 +2755,11 @@ 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;
 
                if (priv->dma_cap.rx_coe_type2)
                        priv->plat->rx_coe = STMMAC_RX_COE_TYPE2;