Title: [7650] trunk/drivers/net/bfin_mac.c: Fix bug[#5600] Invalid data cache for each new rx skb buffer once
Revision
7650
Author
sonicz
Date
2009-10-15 03:09:47 -0400 (Thu, 15 Oct 2009)

Log Message

Fix bug[#5600] Invalid data cache for each new rx skb buffer once
before it is link to rx dma loop.

Modified Paths

Diff

Modified: trunk/drivers/net/bfin_mac.c (7649 => 7650)


--- trunk/drivers/net/bfin_mac.c	2009-10-15 07:08:59 UTC (rev 7649)
+++ trunk/drivers/net/bfin_mac.c	2009-10-15 07:09:47 UTC (rev 7650)
@@ -203,6 +203,11 @@
 			goto init_error;
 		}
 		skb_reserve(new_skb, NET_IP_ALIGN);
+		/* 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);
 		r->skb = new_skb;
 
 		/*
@@ -1010,19 +1015,17 @@
 	}
 	/* reserve 2 bytes for RXDWA padding */
 	skb_reserve(new_skb, NET_IP_ALIGN);
-	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);
 
+	current_rx_ptr->skb = new_skb;
+	current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
+
 	len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
 	skb_put(skb, len);
-	blackfin_dcache_invalidate_range((unsigned long)skb->head,
-					 (unsigned long)skb->tail);
 
 	skb->protocol = eth_type_trans(skb, dev);
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to