aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/pci_sun4v.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/pci_sun4v.c')
-rw-r--r--arch/sparc/kernel/pci_sun4v.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 5db5ebed35da..2485eaa23101 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -230,8 +230,9 @@ static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu,
230 free_pages((unsigned long)cpu, order); 230 free_pages((unsigned long)cpu, order);
231} 231}
232 232
233static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz, 233static dma_addr_t dma_4v_map_page(struct device *dev, struct page *page,
234 enum dma_data_direction direction) 234 unsigned long offset, size_t sz,
235 enum dma_data_direction direction)
235{ 236{
236 struct iommu *iommu; 237 struct iommu *iommu;
237 unsigned long flags, npages, oaddr; 238 unsigned long flags, npages, oaddr;
@@ -245,7 +246,7 @@ static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
245 if (unlikely(direction == DMA_NONE)) 246 if (unlikely(direction == DMA_NONE))
246 goto bad; 247 goto bad;
247 248
248 oaddr = (unsigned long)ptr; 249 oaddr = (unsigned long)(page_address(page) + offset);
249 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK); 250 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK);
250 npages >>= IO_PAGE_SHIFT; 251 npages >>= IO_PAGE_SHIFT;
251 252
@@ -294,8 +295,8 @@ iommu_map_fail:
294 return DMA_ERROR_CODE; 295 return DMA_ERROR_CODE;
295} 296}
296 297
297static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr, 298static void dma_4v_unmap_page(struct device *dev, dma_addr_t bus_addr,
298 size_t sz, enum dma_data_direction direction) 299 size_t sz, enum dma_data_direction direction)
299{ 300{
300 struct pci_pbm_info *pbm; 301 struct pci_pbm_info *pbm;
301 struct iommu *iommu; 302 struct iommu *iommu;
@@ -537,8 +538,8 @@ static void dma_4v_sync_sg_for_cpu(struct device *dev,
537static const struct dma_ops sun4v_dma_ops = { 538static const struct dma_ops sun4v_dma_ops = {
538 .alloc_coherent = dma_4v_alloc_coherent, 539 .alloc_coherent = dma_4v_alloc_coherent,
539 .free_coherent = dma_4v_free_coherent, 540 .free_coherent = dma_4v_free_coherent,
540 .map_single = dma_4v_map_single, 541 .map_page = dma_4v_map_page,
541 .unmap_single = dma_4v_unmap_single, 542 .unmap_page = dma_4v_unmap_page,
542 .map_sg = dma_4v_map_sg, 543 .map_sg = dma_4v_map_sg,
543 .unmap_sg = dma_4v_unmap_sg, 544 .unmap_sg = dma_4v_unmap_sg,
544 .sync_single_for_cpu = dma_4v_sync_single_for_cpu, 545 .sync_single_for_cpu = dma_4v_sync_single_for_cpu,