mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: cpsw: prevent stray cache writeback
@ 2015-03-02  8:59 Lucas Stach
  2015-03-03  7:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2015-03-02  8:59 UTC (permalink / raw)
  To: barebox

The cache should be invalidated when transfering ownership of a buffer
to the device. Otherwise the writeback of dirty cache lines can
corrupt the hardware written data.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Jan Weitzel <j.weitzel@phytec.de>
---
Sascha, please apply this to master. It fixes a TFTP buffer corruption
issue reported by Jan.
---
 drivers/net/cpsw.c | 1 +
 1 file changed, 1 insertion(+)

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


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

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

* Re: [PATCH] net: cpsw: prevent stray cache writeback
  2015-03-02  8:59 [PATCH] net: cpsw: prevent stray cache writeback Lucas Stach
@ 2015-03-03  7:37 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-03-03  7:37 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon, Mar 02, 2015 at 09:59:36AM +0100, Lucas Stach wrote:
> The cache should be invalidated when transfering ownership of a buffer
> to the device. Otherwise the writeback of dirty cache lines can
> corrupt the hardware written data.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> Tested-by: Jan Weitzel <j.weitzel@phytec.de>
> ---
> Sascha, please apply this to master. It fixes a TFTP buffer corruption
> issue reported by Jan.

Did that.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02  8:59 [PATCH] net: cpsw: prevent stray cache writeback Lucas Stach
2015-03-03  7:37 ` Sascha Hauer

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