Title: [7648] branches/2009R1/drivers/net/bfin_mac.c: Fix bug[#5600] Invalid data cache for each new rx skb buffer once
Revision
7648
Author
sonicz
Date
2009-10-15 03:08:33 -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: branches/2009R1/drivers/net/bfin_mac.c (7647 => 7648)


--- branches/2009R1/drivers/net/bfin_mac.c	2009-10-15 07:02:16 UTC (rev 7647)
+++ branches/2009R1/drivers/net/bfin_mac.c	2009-10-15 07:08:33 UTC (rev 7648)
@@ -201,6 +201,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;
 
 		/*
@@ -686,19 +691,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);
 
 	dev->last_rx = jiffies;
 	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