aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Demin <bf53x@ya.ru>2008-01-30 03:52:27 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-03 07:28:50 -0500
commit6e01d1a4b2f7110201e7fe16e561a721d76fab3e (patch)
tree183797360ae581a1bae01a45d3f34cb9a8471413
parent136492b275e0dd02d842b94507d66267d18d341c (diff)
EMAC driver: fix bug - invalidate data cache of new_skb->data range when cache is WB
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>
-rw-r--r--drivers/net/bfin_mac.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index f2368b71a720..0a17fb48c55c 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -651,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev)
651 current_rx_ptr->skb = new_skb; 651 current_rx_ptr->skb = new_skb;
652 current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2; 652 current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
653 653
654 /* Invidate the data cache of skb->data range when it is write back
655 * cache. It will prevent overwritting the new data from DMA
656 */
657 blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
658 (unsigned long)new_skb->end);
659
654 len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN); 660 len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
655 skb_put(skb, len); 661 skb_put(skb, len);
656 blackfin_dcache_invalidate_range((unsigned long)skb->head, 662 blackfin_dcache_invalidate_range((unsigned long)skb->head,