Patchwork [05/11] rrunner: fix DMA sync_single length error

login
register
mail settings
Submitter stephen hemminger
Date Jan. 20, 2010, 8:45 p.m.
Message ID <20100120204559.108948015@vyatta.com>
Download mbox | patch
Permalink /patch/43372/
State Rejected
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Jan. 20, 2010, 8:45 p.m.
The DMA api requires that the full mapping be sync'd when
copying frame. First found by Jarek on sky2.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Patch

--- a/drivers/net/rrunner.c	2010-01-20 11:32:54.859390177 -0800
+++ b/drivers/net/rrunner.c	2010-01-20 11:37:40.431004646 -0800
@@ -971,7 +971,7 @@  static void rx_int(struct net_device *de
 				} else {
 					pci_dma_sync_single_for_cpu(rrpriv->pci_dev,
 								    desc->addr.addrlo,
-								    pkt_len,
+								    dev->mtu + HIPPI_HLEN,
 								    PCI_DMA_FROMDEVICE);
 
 					memcpy(skb_put(skb, pkt_len),
@@ -979,7 +979,7 @@  static void rx_int(struct net_device *de
 
 					pci_dma_sync_single_for_device(rrpriv->pci_dev,
 								       desc->addr.addrlo,
-								       pkt_len,
+								       dev->mtu + HIPPI_HLEN,
 								       PCI_DMA_FROMDEVICE);
 				}
 			}else{