diff options
Diffstat (limited to 'arch/sparc/kernel/iommu.c')
-rw-r--r-- | arch/sparc/kernel/iommu.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index d8900e1d5aad..0aeaefe696b9 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
@@ -351,8 +351,9 @@ static void dma_4u_free_coherent(struct device *dev, size_t size, | |||
351 | free_pages((unsigned long)cpu, order); | 351 | free_pages((unsigned long)cpu, order); |
352 | } | 352 | } |
353 | 353 | ||
354 | static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz, | 354 | static dma_addr_t dma_4u_map_page(struct device *dev, struct page *page, |
355 | enum dma_data_direction direction) | 355 | unsigned long offset, size_t sz, |
356 | enum dma_data_direction direction) | ||
356 | { | 357 | { |
357 | struct iommu *iommu; | 358 | struct iommu *iommu; |
358 | struct strbuf *strbuf; | 359 | struct strbuf *strbuf; |
@@ -368,7 +369,7 @@ static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz, | |||
368 | if (unlikely(direction == DMA_NONE)) | 369 | if (unlikely(direction == DMA_NONE)) |
369 | goto bad_no_ctx; | 370 | goto bad_no_ctx; |
370 | 371 | ||
371 | oaddr = (unsigned long)ptr; | 372 | oaddr = (unsigned long)(page_address(page) + offset); |
372 | npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK); | 373 | npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK); |
373 | npages >>= IO_PAGE_SHIFT; | 374 | npages >>= IO_PAGE_SHIFT; |
374 | 375 | ||
@@ -472,8 +473,8 @@ do_flush_sync: | |||
472 | vaddr, ctx, npages); | 473 | vaddr, ctx, npages); |
473 | } | 474 | } |
474 | 475 | ||
475 | static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr, | 476 | static void dma_4u_unmap_page(struct device *dev, dma_addr_t bus_addr, |
476 | size_t sz, enum dma_data_direction direction) | 477 | size_t sz, enum dma_data_direction direction) |
477 | { | 478 | { |
478 | struct iommu *iommu; | 479 | struct iommu *iommu; |
479 | struct strbuf *strbuf; | 480 | struct strbuf *strbuf; |
@@ -824,8 +825,8 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev, | |||
824 | static const struct dma_ops sun4u_dma_ops = { | 825 | static const struct dma_ops sun4u_dma_ops = { |
825 | .alloc_coherent = dma_4u_alloc_coherent, | 826 | .alloc_coherent = dma_4u_alloc_coherent, |
826 | .free_coherent = dma_4u_free_coherent, | 827 | .free_coherent = dma_4u_free_coherent, |
827 | .map_single = dma_4u_map_single, | 828 | .map_page = dma_4u_map_page, |
828 | .unmap_single = dma_4u_unmap_single, | 829 | .unmap_page = dma_4u_unmap_page, |
829 | .map_sg = dma_4u_map_sg, | 830 | .map_sg = dma_4u_map_sg, |
830 | .unmap_sg = dma_4u_unmap_sg, | 831 | .unmap_sg = dma_4u_unmap_sg, |
831 | .sync_single_for_cpu = dma_4u_sync_single_for_cpu, | 832 | .sync_single_for_cpu = dma_4u_sync_single_for_cpu, |