netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] driver:net:stmmac: Disable DMA store and forward mode if platform data force_sf_dma_mode is negative.
@ 2013-08-15  7:37 Sonic Zhang
  2013-08-15 21:20 ` David Miller
  2013-08-19  6:03 ` Giuseppe CAVALLARO
  0 siblings, 2 replies; 10+ messages in thread
From: Sonic Zhang @ 2013-08-15  7:37 UTC (permalink / raw)
  To: Giuseppe Cavallaro; +Cc: netdev, adi-buildroot-devel, Sonic Zhang

From: Sonic Zhang <sonic.zhang@analog.com>

Some synopsys ip implementation doesn't support DMA store and forward mode,
such as BF60x. So, define force_sf_dma_mode negative to use DMA thresholds only.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f2ccb36..b0e003a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1157,7 +1157,9 @@ static void free_dma_desc_resources(struct stmmac_priv *priv)
  */
 static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
 {
-	if (likely(priv->plat->force_sf_dma_mode ||
+	if (priv->plat->force_sf_dma_mode < 0)
+		priv->hw->dma->dma_mode(priv->ioaddr, tc, tc);
+	else if (likely(priv->plat->force_sf_dma_mode > 0 ||
 		   ((priv->plat->tx_coe) && (!priv->no_csum_insertion)))) {
 		/*
 		 * In case of GMAC, SF mode can be enabled
-- 
1.8.2.3

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

end of thread, other threads:[~2013-08-22  8:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15  7:37 [PATCH] driver:net:stmmac: Disable DMA store and forward mode if platform data force_sf_dma_mode is negative Sonic Zhang
2013-08-15 21:20 ` David Miller
2013-08-16  9:37   ` Sonic Zhang
2013-08-17  5:30     ` David Miller
2013-08-19  6:03 ` Giuseppe CAVALLARO
2013-08-19  7:31   ` Sonic Zhang
2013-08-19  7:45     ` Giuseppe CAVALLARO
2013-08-19 10:51       ` Sonic Zhang
2013-08-19 14:29         ` Giuseppe CAVALLARO
2013-08-22  8:40           ` Sonic Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).