aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/pci-calgary_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/pci-calgary_64.c')
-rw-r--r--arch/x86/kernel/pci-calgary_64.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index dcdac6c826e9..8415d92853c4 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -510,8 +510,22 @@ error:
510 return ret; 510 return ret;
511} 511}
512 512
513static void calgary_free_coherent(struct device *dev, size_t size,
514 void *vaddr, dma_addr_t dma_handle)
515{
516 unsigned int npages;
517 struct iommu_table *tbl = find_iommu_table(dev);
518
519 size = PAGE_ALIGN(size);
520 npages = size >> PAGE_SHIFT;
521
522 iommu_free(tbl, dma_handle, npages);
523 free_pages((unsigned long)vaddr, get_order(size));
524}
525
513static struct dma_mapping_ops calgary_dma_ops = { 526static struct dma_mapping_ops calgary_dma_ops = {
514 .alloc_coherent = calgary_alloc_coherent, 527 .alloc_coherent = calgary_alloc_coherent,
528 .free_coherent = calgary_free_coherent,
515 .map_single = calgary_map_single, 529 .map_single = calgary_map_single,
516 .unmap_single = calgary_unmap_single, 530 .unmap_single = calgary_unmap_single,
517 .map_sg = calgary_map_sg, 531 .map_sg = calgary_map_sg,