netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sonic Zhang <sonic.adi@gmail.com>
To: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: <netdev@vger.kernel.org>,
	<adi-buildroot-devel@lists.sourceforge.net>,
	Sonic Zhang <sonic.zhang@analog.com>
Subject: [PATCH] driver:net:stmmac: Disable DMA store and forward mode if platform data force_sf_dma_mode is negative.
Date: Thu, 15 Aug 2013 15:37:36 +0800	[thread overview]
Message-ID: <1376552256-7421-1-git-send-email-sonic.adi@gmail.com> (raw)

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

             reply	other threads:[~2013-08-15  7:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15  7:37 Sonic Zhang [this message]
2013-08-15 21:20 ` [PATCH] driver:net:stmmac: Disable DMA store and forward mode if platform data force_sf_dma_mode is negative 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376552256-7421-1-git-send-email-sonic.adi@gmail.com \
    --to=sonic.adi@gmail.com \
    --cc=adi-buildroot-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=sonic.zhang@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).