summaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2007-07-12 06:18:08 +0200
committerBryan Wu <bryan.wu@analog.com>2007-07-12 06:18:08 +0200
commitb07af760c9bd8e87c3aa9275298566379ec4e9c1 (patch)
tree98e80da3a2d9640ffce7b6356a1759887da3bdeb /arch/blackfin
parentBlackfin arch: Disable CACHELINE_ALIGNED_L1 for BF54x by default (diff)
downloadlinux-b07af760c9bd8e87c3aa9275298566379ec4e9c1.tar.xz
linux-b07af760c9bd8e87c3aa9275298566379ec4e9c1.zip
Blackfin arch: fix bug set dma_address properly in dma_map_sg
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/dma-mapping.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c
index bda57ec88151..ea48d5b13f11 100644
--- a/arch/blackfin/kernel/dma-mapping.c
+++ b/arch/blackfin/kernel/dma-mapping.c
@@ -159,10 +159,13 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
BUG_ON(direction == DMA_NONE);
- for (i = 0; i < nents; i++)
- invalidate_dcache_range(sg_dma_address(&sg[i]),
- sg_dma_address(&sg[i]) +
- sg_dma_len(&sg[i]));
+ for (i = 0; i < nents; i++, sg++) {
+ sg->dma_address = page_address(sg->page) + sg->offset;
+
+ invalidate_dcache_range(sg_dma_address(sg),
+ sg_dma_address(sg) +
+ sg_dma_len(sg));
+ }
return nents;
}