summaryrefslogtreecommitdiff
path: root/arch/sparc
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-04-16 21:23:40 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-09 03:11:56 +0300
commita7fce1f7ca2f092fe44a17cb158deda97060aab4 (patch)
treee8463d0235f1040f6e25c57e50f73c129335bce9 /arch/sparc
parent031abf0b70cb6804eefb11340463a2277e52f853 (diff)
downloadlinux-a7fce1f7ca2f092fe44a17cb158deda97060aab4.tar.xz
sparc/iommu: use sbus_iommu_unmap_page in sbus_iommu_unmap_sg
Use the page-level helper instead of duplicating the logic, while also fixing the incorrect handling of larger than page sized offsets in the sg variant. Signed-off-by: Christoph Hellwig <hch@lst.de> Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/mm/iommu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
index dcdadac03fdf..f47a6ce0acaa 100644
--- a/arch/sparc/mm/iommu.c
+++ b/arch/sparc/mm/iommu.c
@@ -321,11 +321,11 @@ static void sbus_iommu_unmap_sg(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction dir, unsigned long attrs)
{
struct scatterlist *sg;
- int i, n;
+ int i;
for_each_sg(sgl, sg, nents, i) {
- n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
- iommu_release_one(dev, sg->dma_address & PAGE_MASK, n);
+ sbus_iommu_unmap_page(dev, sg->dma_address, sg->length, dir,
+ attrs);
sg->dma_address = 0x21212121;
}
}