[PATCH 03/11] skge: fix DMA sync_single length error

Stephen Hemminger
2010-01-20T21:22:56Z

[-- Attachment #1: skge-dmar-error.patch --]
[-- Type: text/plain, Size: 878 bytes --]

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>

--- a/drivers/net/skge.c 2010-01-20 10:10:29.538786102 -0800
+++ b/drivers/net/skge.c 2010-01-20 10:11:18.443974883 -0800
@@ -3078,11 +3078,13 @@ static struct sk_buff *skge_rx_get(struc

pci_dma_sync_single_for_cpu(skge->hw->pdev,
pci_unmap_addr(e, mapaddr),
- len, PCI_DMA_FROMDEVICE);
+ pci_unmap_len(e, maplen),
+ PCI_DMA_FROMDEVICE);
skb_copy_from_linear_data(e->skb, skb->data, len);
pci_dma_sync_single_for_device(skge->hw->pdev,
pci_unmap_addr(e, mapaddr),
- len, PCI_DMA_FROMDEVICE);
+ pci_unmap_len(e, maplen),
+ PCI_DMA_FROMDEVICE);
skge_rx_reuse(e, skge->rx_buf_size);
} else {
struct sk_buff *nskb;

--