]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dma-mapping: fix dma_sync_single_range_*
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tue, 11 May 2010 21:06:43 +0000 (14:06 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:29:14 +0000 (14:29 -0700)
commit f33d7e2d2d113a63772bbc993cdec3b5327f0ef1 upstream.

dma_sync_single_range_for_cpu() and dma_sync_single_range_for_device() use
a wrong address with a partial synchronization.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/asm-generic/dma-mapping-common.h

index e694263445f7b5dd48ff294cdd6ec4b76f3769a2..69206957b72c52efe1f9fe7d2479cfc931d7d7b7 100644 (file)
@@ -131,7 +131,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
                debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
 
        } else
-               dma_sync_single_for_cpu(dev, addr, size, dir);
+               dma_sync_single_for_cpu(dev, addr + offset, size, dir);
 }
 
 static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -148,7 +148,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
                debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
 
        } else
-               dma_sync_single_for_device(dev, addr, size, dir);
+               dma_sync_single_for_device(dev, addr + offset, size, dir);
 }
 
 static inline void