mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: cpsw: invalidate complete buffer
@ 2015-02-27  9:56 Jan Weitzel
  2015-02-27 11:47 ` Lucas Stach
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Weitzel @ 2015-02-27  9:56 UTC (permalink / raw)
  To: barebox

Without invalidating the complete buffer before giving it to
dma_inv_range, we got strange packets.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Tested-by: Teresa Gámez <t.gamez@phytec.de>
---
 drivers/net/cpsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 799fac8..33afdc3 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -886,7 +886,7 @@ static int cpsw_recv(struct eth_device *edev)
 	int len;
 
 	while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
-		dma_inv_range((ulong)buffer, (ulong)buffer + len);
+		dma_inv_range((ulong)buffer, (ulong)buffer + PKTSIZE);
 		net_receive(edev, buffer, len);
 		cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE);
 	}
-- 
1.9.1


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

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

end of thread, other threads:[~2015-03-02  7:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27  9:56 [PATCH] net: cpsw: invalidate complete buffer Jan Weitzel
2015-02-27 11:47 ` Lucas Stach
2015-02-27 13:14   ` Jan Weitzel
2015-02-27 13:39     ` Lucas Stach
2015-02-27 13:45       ` Lucas Stach
2015-03-02  7:35         ` Jan Weitzel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox