diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/dma_64.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/system-bus.c | 5 |
4 files changed, 5 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/dma_64.c b/arch/powerpc/kernel/dma_64.c index 9001104b56b0..14206e3f0819 100644 --- a/arch/powerpc/kernel/dma_64.c +++ b/arch/powerpc/kernel/dma_64.c | |||
@@ -161,8 +161,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, | |||
161 | int i; | 161 | int i; |
162 | 162 | ||
163 | for_each_sg(sgl, sg, nents, i) { | 163 | for_each_sg(sgl, sg, nents, i) { |
164 | sg->dma_address = (page_to_phys(sg->page) + sg->offset) | | 164 | sg->dma_address = sg_phys(sg) | dma_direct_offset; |
165 | dma_direct_offset; | ||
166 | sg->dma_length = sg->length; | 165 | sg->dma_length = sg->length; |
167 | } | 166 | } |
168 | 167 | ||
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 289d7e935918..72fd87156b24 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -102,8 +102,7 @@ static int ibmebus_map_sg(struct device *dev, | |||
102 | int i; | 102 | int i; |
103 | 103 | ||
104 | for_each_sg(sgl, sg, nents, i) { | 104 | for_each_sg(sgl, sg, nents, i) { |
105 | sg->dma_address = (dma_addr_t)page_address(sg->page) | 105 | sg->dma_address = (dma_addr_t) sg_virt(sg); |
106 | + sg->offset; | ||
107 | sg->dma_length = sg->length; | 106 | sg->dma_length = sg->length; |
108 | } | 107 | } |
109 | 108 | ||
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 306a6f75b6c5..2d0c9ef555e9 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -307,7 +307,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
307 | continue; | 307 | continue; |
308 | } | 308 | } |
309 | /* Allocate iommu entries for that segment */ | 309 | /* Allocate iommu entries for that segment */ |
310 | vaddr = (unsigned long)page_address(s->page) + s->offset; | 310 | vaddr = (unsigned long) sg_virt(s); |
311 | npages = iommu_num_pages(vaddr, slen); | 311 | npages = iommu_num_pages(vaddr, slen); |
312 | entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0); | 312 | entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0); |
313 | 313 | ||
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 07e64b48e7fc..6405f4a36763 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -628,9 +628,8 @@ static int ps3_sb_map_sg(struct device *_dev, struct scatterlist *sgl, | |||
628 | int i; | 628 | int i; |
629 | 629 | ||
630 | for_each_sg(sgl, sg, nents, i) { | 630 | for_each_sg(sgl, sg, nents, i) { |
631 | int result = ps3_dma_map(dev->d_region, | 631 | int result = ps3_dma_map(dev->d_region, sg_phys(sg), |
632 | page_to_phys(sg->page) + sg->offset, sg->length, | 632 | sg->length, &sg->dma_address, 0); |
633 | &sg->dma_address, 0); | ||
634 | 633 | ||
635 | if (result) { | 634 | if (result) { |
636 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", | 635 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", |