mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/6] net: designware: Fix broken cache invalidate
Date: Mon,  9 Sep 2013 16:53:16 +0200	[thread overview]
Message-ID: <1378738401-723-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1378738401-723-1-git-send-email-s.hauer@pengutronix.de>

Move the cache invalidation of a received packet before we actually
use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/designware.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index a6b32b9..45de31c 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -337,14 +337,15 @@ static int dwc_ether_rx(struct eth_device *dev)
 	length = (status & DESC_RXSTS_FRMLENMSK) >> \
 		 DESC_RXSTS_FRMLENSHFT;
 
-	net_receive(desc_p->dmamac_addr, length);
-
 	/*
 	 * Make the current descriptor valid again and go to
 	 * the next one
 	 */
 	dma_inv_range((unsigned long)desc_p->dmamac_addr,
 		      (unsigned long)desc_p->dmamac_addr + length);
+
+	net_receive(desc_p->dmamac_addr, length);
+
 	desc_p->txrx_status |= DESC_RXSTS_OWNBYDMA;
 
 	/* Test the wrap-around condition. */
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-09-09 14:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 14:53 [PATCH] net: designware patches Sascha Hauer
2013-09-09 14:53 ` Sascha Hauer [this message]
2013-09-09 14:53 ` [PATCH 2/6] net: designware: drop HAS_DESIGNWARE_ETH Sascha Hauer
2013-09-09 14:53 ` [PATCH 3/6] net: designware: use dma_alloc for descriptors Sascha Hauer
2013-09-09 14:53 ` [PATCH 4/6] net: designware: make alt/enhanced descriptor runtime configurable Sascha Hauer
2013-09-09 14:53 ` [PATCH 5/6] net: designware: Add decvicetree support Sascha Hauer
2013-09-09 14:53 ` [PATCH 6/6] net: designware: remove backspaces from code Sascha Hauer

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=1378738401-723-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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