Commit 6e01d1a4 authored by Alexey Demin's avatar Alexey Demin Committed by David S. Miller

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: default avatarAlexey Demin <bf53x@ya.ru>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 136492b2
...@@ -651,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev) ...@@ -651,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev)
current_rx_ptr->skb = new_skb; current_rx_ptr->skb = new_skb;
current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2; 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); len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
skb_put(skb, len); skb_put(skb, len);
blackfin_dcache_invalidate_range((unsigned long)skb->head, blackfin_dcache_invalidate_range((unsigned long)skb->head,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment