]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
iommu/dma: Remove bogus dma_supported() implementation
authorRobin Murphy <robin.murphy@arm.com>
Wed, 1 Feb 2017 17:53:04 +0000 (17:53 +0000)
committerJoerg Roedel <jroedel@suse.de>
Mon, 6 Feb 2017 12:14:10 +0000 (13:14 +0100)
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>
arch/arm64/mm/dma-mapping.c
drivers/iommu/dma-iommu.c
include/linux/dma-iommu.h

index ae9f817eadf20bd665266ef94a22db5021100719..4a14b25163fb067ee2c3e575a45a20a58481a434 100644 (file)
@@ -799,7 +799,6 @@ static struct dma_map_ops iommu_dma_ops = {
        .sync_sg_for_device = __iommu_sync_sg_for_device,
        .map_resource = iommu_dma_map_resource,
        .unmap_resource = iommu_dma_unmap_resource,
-       .dma_supported = iommu_dma_supported,
        .mapping_error = iommu_dma_mapping_error,
 };
 
index 1c9ac26e3b68a4c231429f86e0907f2c326c8ced..48d36ce59efbfd6305f8e85e9ae85875f71215f8 100644 (file)
@@ -734,16 +734,6 @@ void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
        __iommu_dma_unmap(iommu_get_domain_for_dev(dev), handle);
 }
 
-int iommu_dma_supported(struct device *dev, u64 mask)
-{
-       /*
-        * 'Special' IOMMUs which don't have the same addressing capability
-        * as the CPU will have to wait until we have some way to query that
-        * before they'll be able to use this framework.
-        */
-       return 1;
-}
-
 int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
        return dma_addr == DMA_ERROR_CODE;
index 3a846f9ec0fde10f1565fdc09eb86ad7d1b893e0..5725c94b1f121ece268c0fd8558cb94770c2c9cd 100644 (file)
@@ -67,7 +67,6 @@ dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
                size_t size, enum dma_data_direction dir, unsigned long attrs);
 void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
                size_t size, enum dma_data_direction dir, unsigned long attrs);
-int iommu_dma_supported(struct device *dev, u64 mask);
 int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
 
 /* The DMA API isn't _quite_ the whole story, though... */