[PATCH 8/9] x86/iommu: change Intel IOMMU to use dma_ops register interface

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joerg Roedel
Date: Monday, September 22, 2008 - 11:21 am

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 drivers/pci/intel-iommu.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 6c4c1c3..283e65f 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2255,6 +2255,12 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist,
 	return nelems;
 }
 
+static int intel_device_supported(struct device *dev)
+{
+	/* FIXME: is this correct? */
+	return  dev && dev->bus == &pci_bus_type;
+}
+
 static struct dma_mapping_ops intel_dma_ops = {
 	.alloc_coherent = intel_alloc_coherent,
 	.free_coherent = intel_free_coherent,
@@ -2262,6 +2268,7 @@ static struct dma_mapping_ops intel_dma_ops = {
 	.unmap_single = intel_unmap_single,
 	.map_sg = intel_map_sg,
 	.unmap_sg = intel_unmap_sg,
+	.device_supported = intel_device_supported,
 };
 
 static inline int iommu_domain_cache_init(void)
@@ -2449,6 +2456,7 @@ int __init intel_iommu_init(void)
 
 	init_timer(&unmap_timer);
 	force_iommu = 1;
+	x86_register_dma_ops(&intel_dma_ops, DMA_OPS_TYPE_HW);
 	dma_ops = &intel_dma_ops;
 	return 0;
 }
-- 
1.5.6.4


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/9][RFC] stackable dma_ops for x86, Joerg Roedel, (Mon Sep 22, 11:21 am)
[PATCH 8/9] x86/iommu: change Intel IOMMU to use dma_ops r ..., Joerg Roedel, (Mon Sep 22, 11:21 am)
[PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, Joerg Roedel, (Mon Sep 22, 11:21 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Arjan van de Ven, (Mon Sep 22, 11:36 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Joerg Roedel, (Mon Sep 22, 11:39 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Jeremy Fitzhardinge, (Mon Sep 22, 7:41 pm)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Arjan van de Ven, (Mon Sep 22, 7:50 pm)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, Muli Ben-Yehuda, (Fri Sep 26, 5:13 pm)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, FUJITA Tomonori, (Sun Sep 28, 7:21 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, FUJITA Tomonori, (Sun Sep 28, 7:21 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Joerg Roedel, (Sun Sep 28, 11:49 am)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, Muli Ben-Yehuda, (Mon Sep 29, 2:25 am)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, Muli Ben-Yehuda, (Mon Sep 29, 2:30 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, FUJITA Tomonori, (Mon Sep 29, 6:16 am)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, FUJITA Tomonori, (Mon Sep 29, 6:16 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Joerg Roedel, (Mon Sep 29, 6:26 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, FUJITA Tomonori, (Mon Sep 29, 6:42 am)
Re: [PATCH 0/9][RFC] stackable dma_ops for x86, Joerg Roedel, (Mon Sep 29, 6:51 am)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, Muli Ben-Yehuda, (Tue Sep 30, 12:44 pm)
Re: [PATCH 9/9] x86/iommu: use dma_ops_list in get_dma_ops, Muli Ben-Yehuda, (Fri Oct 3, 1:38 am)