diff options
author | Robin Murphy <robin.murphy@arm.com> | 2017-02-01 12:53:04 -0500 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-02-06 07:14:10 -0500 |
commit | a1831bb9403720db6d4c033fe2d6bd0116dd28fe (patch) | |
tree | 2a2267ebdab46668c8e7063bdaef54336e67d6e5 | |
parent | 122fac030e912ed723fe94d8eb0d5d0f6b31535e (diff) |
iommu/dma: Remove bogus dma_supported() implementation
Back when this was first written, dma_supported() was somewhat of a
murky mess, with subtly different interpretations being relied upon in
various places. The "does device X support DMA to address range Y?"
uses assuming Y to be physical addresses, which motivated the current
iommu_dma_supported() implementation and are alluded to in the comment
therein, have since been cleaned up, leaving only the far less ambiguous
"can device X drive address bits Y" usage internal to DMA API mask
setting. As such, there is no reason to keep a slightly misleading
callback which does nothing but duplicate the current default behaviour;
we already constrain IOVA allocations to the iommu_domain aperture where
necessary, so let's leave DMA mask business to architecture-specific
code where it belongs.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 1 | ||||
-rw-r--r-- | drivers/iommu/dma-iommu.c | 10 | ||||
-rw-r--r-- | include/linux/dma-iommu.h | 1 |
3 files changed, 0 insertions, 12 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index ae9f817eadf2..4a14b25163fb 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -799,7 +799,6 @@ static struct dma_map_ops iommu_dma_ops = { | |||
799 | .sync_sg_for_device = __iommu_sync_sg_for_device, | 799 | .sync_sg_for_device = __iommu_sync_sg_for_device, |
800 | .map_resource = iommu_dma_map_resource, | 800 | .map_resource = iommu_dma_map_resource, |
801 | .unmap_resource = iommu_dma_unmap_resource, | 801 | .unmap_resource = iommu_dma_unmap_resource, |
802 | .dma_supported = iommu_dma_supported, | ||
803 | .mapping_error = iommu_dma_mapping_error, | 802 | .mapping_error = iommu_dma_mapping_error, |
804 | }; | 803 | }; |
805 | 804 | ||
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 1c9ac26e3b68..48d36ce59efb 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c | |||
@@ -734,16 +734,6 @@ void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle, | |||
734 | __iommu_dma_unmap(iommu_get_domain_for_dev(dev), handle); | 734 | __iommu_dma_unmap(iommu_get_domain_for_dev(dev), handle); |
735 | } | 735 | } |
736 | 736 | ||
737 | int iommu_dma_supported(struct device *dev, u64 mask) | ||
738 | { | ||
739 | /* | ||
740 | * 'Special' IOMMUs which don't have the same addressing capability | ||
741 | * as the CPU will have to wait until we have some way to query that | ||
742 | * before they'll be able to use this framework. | ||
743 | */ | ||
744 | return 1; | ||
745 | } | ||
746 | |||
747 | int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 737 | int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
748 | { | 738 | { |
749 | return dma_addr == DMA_ERROR_CODE; | 739 | return dma_addr == DMA_ERROR_CODE; |
diff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h index 3a846f9ec0fd..5725c94b1f12 100644 --- a/include/linux/dma-iommu.h +++ b/include/linux/dma-iommu.h | |||
@@ -67,7 +67,6 @@ dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys, | |||
67 | size_t size, enum dma_data_direction dir, unsigned long attrs); | 67 | size_t size, enum dma_data_direction dir, unsigned long attrs); |
68 | void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle, | 68 | void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle, |
69 | size_t size, enum dma_data_direction dir, unsigned long attrs); | 69 | size_t size, enum dma_data_direction dir, unsigned long attrs); |
70 | int iommu_dma_supported(struct device *dev, u64 mask); | ||
71 | int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr); | 70 | int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr); |
72 | 71 | ||
73 | /* The DMA API isn't _quite_ the whole story, though... */ | 72 | /* The DMA API isn't _quite_ the whole story, though... */ |