aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/pci_sun4v.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/pci_sun4v.c')
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index e86c73ec167..34a1fded394 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -384,7 +384,7 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
384 } 384 }
385 /* Allocate iommu entries for that segment */ 385 /* Allocate iommu entries for that segment */
386 paddr = (unsigned long) SG_ENT_PHYS_ADDRESS(s); 386 paddr = (unsigned long) SG_ENT_PHYS_ADDRESS(s);
387 npages = iommu_num_pages(paddr, slen); 387 npages = iommu_num_pages(paddr, slen, IO_PAGE_SIZE);
388 entry = iommu_range_alloc(dev, iommu, npages, &handle); 388 entry = iommu_range_alloc(dev, iommu, npages, &handle);
389 389
390 /* Handle failure */ 390 /* Handle failure */
@@ -461,7 +461,8 @@ iommu_map_failed:
461 unsigned long vaddr, npages; 461 unsigned long vaddr, npages;
462 462
463 vaddr = s->dma_address & IO_PAGE_MASK; 463 vaddr = s->dma_address & IO_PAGE_MASK;
464 npages = iommu_num_pages(s->dma_address, s->dma_length); 464 npages = iommu_num_pages(s->dma_address, s->dma_length,
465 IO_PAGE_SIZE);
465 iommu_range_free(iommu, vaddr, npages); 466 iommu_range_free(iommu, vaddr, npages);
466 /* XXX demap? XXX */ 467 /* XXX demap? XXX */
467 s->dma_address = DMA_ERROR_CODE; 468 s->dma_address = DMA_ERROR_CODE;
@@ -500,7 +501,7 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
500 501
501 if (!len) 502 if (!len)
502 break; 503 break;
503 npages = iommu_num_pages(dma_handle, len); 504 npages = iommu_num_pages(dma_handle, len, IO_PAGE_SIZE);
504 iommu_range_free(iommu, dma_handle, npages); 505 iommu_range_free(iommu, dma_handle, npages);
505 506
506 entry = ((dma_handle - iommu->page_table_map_base) >> IO_PAGE_SHIFT); 507 entry = ((dma_handle - iommu->page_table_map_base) >> IO_PAGE_SHIFT);