]> git.hungrycats.org Git - linux/commitdiff
[netdrvr pcnet32] add missing pci_dma_sync_single
authorRalf Bächle <ralf@linux-mips.org>
Sat, 8 Nov 2003 07:24:10 +0000 (02:24 -0500)
committerRalf Bächle <ralf@linux-mips.org>
Sat, 8 Nov 2003 07:24:10 +0000 (02:24 -0500)
a patch for the pcnet32.c driver which adds a missing call to
pci_dma_sync_single.  If a received packet is smaller than rx_copybreak
the pcnet driver will recycle the receive buffer which requires calling
pci_dma_sync_single.  Patch is against 2.6 but I it's also needed in 2.4.

Without that call the processor might still have old stale data in
the data cache when the processor accesses the recycled buffer.

drivers/net/pcnet32.c

index 2d519b6965333ba68fc482d1becf951d0480015e..92fafabcd86b9ac4a3ea72bea644a50e7d191c05 100644 (file)
@@ -1376,6 +1376,10 @@ pcnet32_rx(struct net_device *dev)
                if (!rx_in_place) {
                    skb_reserve(skb,2); /* 16 byte align */
                    skb_put(skb,pkt_len);       /* Make room */
+                   pci_dma_sync_single(lp->pci_dev,
+                                       lp->rx_dma_addr[entry],
+                                       PKT_BUF_SZ,
+                                       PCI_DMA_FROMDEVICE);
                    eth_copy_and_sum(skb,
                                     (unsigned char *)(lp->rx_skbuff[entry]->tail),
                                     pkt_len,0);