stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard...
authorSonic Zhang <sonic.zhang@analog.com>
Thu, 22 Jan 2015 06:55:56 +0000 (14:55 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jan 2015 23:48:01 +0000 (15:48 -0800)
Dont' pass SF_DMA_MODE to rxmode in this case.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index d7fc2b5a1408308e31b76eea70114732196a6cc8..6e2a8fa07da55ba660ce066994490bd214bc4c7f 100644 (file)
@@ -1454,7 +1454,11 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)
                /* Try to bump up the dma threshold on this failure */
                if (unlikely(tc != SF_DMA_MODE) && (tc <= 256)) {
                        tc += 64;
-                       priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE);
+                       if (priv->plat->force_thresh_dma_mode)
+                               priv->hw->dma->dma_mode(priv->ioaddr, tc, tc);
+                       else
+                               priv->hw->dma->dma_mode(priv->ioaddr, tc,
+                                       SF_DMA_MODE);
                        priv->xstats.threshold = tc;
                }
        } else if (unlikely(status == tx_hard_error))