aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-08-19 10:32:40 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-22 02:34:46 -0400
commit43a5a5a09b8cfd56047706cf904718d073ccfd33 (patch)
tree5f537fa359fae2f58a0d590968f4555c97c8a634
parent94581094e774402a11887719bac10505236c2d51 (diff)
x86: add free_coherent dma_ops callback to GART driver
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/pci-gart_64.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index 076e64b2d4f3..ef753e233580 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -519,6 +519,15 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr,
519 return NULL; 519 return NULL;
520} 520}
521 521
522/* free a coherent mapping */
523static void
524gart_free_coherent(struct device *dev, size_t size, void *vaddr,
525 dma_addr_t dma_addr)
526{
527 gart_unmap_single(dev, dma_addr, size, DMA_BIDIRECTIONAL);
528 free_pages((unsigned long)vaddr, get_order(size));
529}
530
522static int no_agp; 531static int no_agp;
523 532
524static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size) 533static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
@@ -722,6 +731,7 @@ static struct dma_mapping_ops gart_dma_ops = {
722 .map_sg = gart_map_sg, 731 .map_sg = gart_map_sg,
723 .unmap_sg = gart_unmap_sg, 732 .unmap_sg = gart_unmap_sg,
724 .alloc_coherent = gart_alloc_coherent, 733 .alloc_coherent = gart_alloc_coherent,
734 .free_coherent = gart_free_coherent,
725}; 735};
726 736
727void gart_iommu_shutdown(void) 737void gart_iommu_shutdown(void)