Skip to content

Commit a1831bb

Browse files
rmurphy-armjoergroedel
authored andcommitted
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>
1 parent 122fac0 commit a1831bb

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

arch/arm64/mm/dma-mapping.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,6 @@ static struct dma_map_ops iommu_dma_ops = {
799799
.sync_sg_for_device = __iommu_sync_sg_for_device,
800800
.map_resource = iommu_dma_map_resource,
801801
.unmap_resource = iommu_dma_unmap_resource,
802-
.dma_supported = iommu_dma_supported,
803802
.mapping_error = iommu_dma_mapping_error,
804803
};
805804

drivers/iommu/dma-iommu.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -734,16 +734,6 @@ void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
734734
__iommu_dma_unmap(iommu_get_domain_for_dev(dev), handle);
735735
}
736736

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-
747737
int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
748738
{
749739
return dma_addr == DMA_ERROR_CODE;

include/linux/dma-iommu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ dma_addr_t iommu_dma_map_resource(struct device *dev, phys_addr_t phys,
6767
size_t size, enum dma_data_direction dir, unsigned long attrs);
6868
void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle,
6969
size_t size, enum dma_data_direction dir, unsigned long attrs);
70-
int iommu_dma_supported(struct device *dev, u64 mask);
7170
int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
7271

7372
/* The DMA API isn't _quite_ the whole story, though... */

0 commit comments

Comments
 (0)