EMAC driver: fix bug - invalidate data cache of new_skb->data range when cache is WB
authorAlexey Demin <bf53x@ya.ru>
Wed, 30 Jan 2008 08:52:27 +0000 (16:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Feb 2008 12:28:50 +0000 (04:28 -0800)
It prevents overwritting new data from DMA.

Signed-off-by: Alexey Demin <bf53x@ya.ru>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bfin_mac.c

index f2368b71a7203b8ba2a4380b5f7639c28ba5f78c..0a17fb48c55ce51891d842780de244a43c8692ea 100644 (file)
@@ -651,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev)
        current_rx_ptr->skb = new_skb;
        current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
 
+       /* Invidate the data cache of skb->data range when it is write back
+        * cache. It will prevent overwritting the new data from DMA
+        */
+       blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
+                                        (unsigned long)new_skb->end);
+
        len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
        skb_put(skb, len);
        blackfin_dcache_invalidate_range((unsigned long)skb->head,