Skip to content

Commit 42998ef

Browse files
rmurphy-armChristoph Hellwig
authored andcommitted
ARM/dma-mapping: drop .dma_supported for IOMMU ops
When an IOMMU is present, we trust that it should be capable of remapping any physical memory, and since the device masks represent the input (virtual) addresses to the IOMMU it makes no sense to validate them against physical PFNs anyway. Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Marc Zyngier <[email protected]>
1 parent ae626eb commit 42998ef

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

arch/arm/mm/dma-mapping.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,25 +104,6 @@ static struct arm_dma_buffer *arm_dma_buffer_find(void *virt)
104104
*
105105
*/
106106

107-
#ifdef CONFIG_ARM_DMA_USE_IOMMU
108-
/*
109-
* Return whether the given device DMA address mask can be supported
110-
* properly. For example, if your device can only drive the low 24-bits
111-
* during bus mastering, then you would pass 0x00ffffff as the mask
112-
* to this function.
113-
*/
114-
static int arm_dma_supported(struct device *dev, u64 mask)
115-
{
116-
unsigned long max_dma_pfn = min(max_pfn - 1, arm_dma_pfn_limit);
117-
118-
/*
119-
* Translate the device's DMA mask to a PFN limit. This
120-
* PFN number includes the page which we can DMA to.
121-
*/
122-
return PHYS_PFN(dma_to_phys(dev, mask)) >= max_dma_pfn;
123-
}
124-
#endif
125-
126107
static void __dma_clear_buffer(struct page *page, size_t size, int coherent_flag)
127108
{
128109
/*
@@ -1681,8 +1662,6 @@ static const struct dma_map_ops iommu_ops = {
16811662

16821663
.map_resource = arm_iommu_map_resource,
16831664
.unmap_resource = arm_iommu_unmap_resource,
1684-
1685-
.dma_supported = arm_dma_supported,
16861665
};
16871666

16881667
static const struct dma_map_ops iommu_coherent_ops = {
@@ -1699,8 +1678,6 @@ static const struct dma_map_ops iommu_coherent_ops = {
16991678

17001679
.map_resource = arm_iommu_map_resource,
17011680
.unmap_resource = arm_iommu_unmap_resource,
1702-
1703-
.dma_supported = arm_dma_supported,
17041681
};
17051682

17061683
/**

0 commit comments

Comments
 (0)