aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intel-iommu.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-01-28 07:53:17 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-29 08:39:29 -0500
commitdfb805e831cc5306b14eacd64e0b36d0d973ee0d (patch)
tree2190228a1541cb99cccd444e0e24280d24b70f7d /drivers/pci/intel-iommu.c
parent97d9800de9df9c6e71b00c0a26239c7d7f6a46c4 (diff)
IA64: fix VT-d dma_mapping_error
dma_mapping_error is used to see if dma_map_single and dma_map_page succeed. IA64 VT-d dma_mapping_error always says that dma_map_single is successful even though it could fail. Note that X86 VT-d works properly in this regard. This patch fixes IA64 VT-d dma_mapping_error by adding VT-d's own dma_mapping_error() that works for both X86_64 and IA64. VT-d uses zero as an error dma address so VT-d's dma_mapping_error returns 1 if a passed dma address is zero (as x86's VT-d dma_mapping_error does now). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r--drivers/pci/intel-iommu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index c933980bf562..59de56304aa6 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2581,6 +2581,11 @@ int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems,
2581 return nelems; 2581 return nelems;
2582} 2582}
2583 2583
2584static int intel_mapping_error(struct device *dev, dma_addr_t dma_addr)
2585{
2586 return !dma_addr;
2587}
2588
2584struct dma_map_ops intel_dma_ops = { 2589struct dma_map_ops intel_dma_ops = {
2585 .alloc_coherent = intel_alloc_coherent, 2590 .alloc_coherent = intel_alloc_coherent,
2586 .free_coherent = intel_free_coherent, 2591 .free_coherent = intel_free_coherent,
@@ -2588,6 +2593,7 @@ struct dma_map_ops intel_dma_ops = {
2588 .unmap_sg = intel_unmap_sg, 2593 .unmap_sg = intel_unmap_sg,
2589 .map_page = intel_map_page, 2594 .map_page = intel_map_page,
2590 .unmap_page = intel_unmap_page, 2595 .unmap_page = intel_unmap_page,
2596 .mapping_error = intel_mapping_error,
2591}; 2597};
2592 2598
2593static inline int iommu_domain_cache_init(void) 2599static inline int iommu_domain_cache_init(void)