Subject: [PATCH 08/11] sunhme: fix DMA sync_single length error

From: Stephen Hemminger <[email-masked]>
Date: Wed, 20 Jan 2010 12:45:07 -0800

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 <[email-masked]>

--- a/drivers/net/sunhme.c	2010-01-20 11:51:53.579700152 -0800
+++ b/drivers/net/sunhme.c	2010-01-20 11:53:10.408138348 -0800
@@ -2062,9 +2062,11 @@ static void happy_meal_rx(struct happy_m
 
 			skb_reserve(copy_skb, 2);
 			skb_put(copy_skb, len);
-			dma_sync_single_for_cpu(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE);
+			dma_sync_single_for_cpu(hp->dma_dev, dma_addr,
+						RX_BUF_ALLOC_SIZE, DMA_FROM_DEVICE);
 			skb_copy_from_linear_data(skb, copy_skb->data, len);
-			dma_sync_single_for_device(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE);
+			dma_sync_single_for_device(hp->dma_dev, dma_addr,
+						   RX_BUF_ALLOC_SIZE, DMA_FROM_DEVICE);
 			/* Reuse original ring buffer. */
 			hme_write_rxd(hp, this,
 				      (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)),

--