arm64: Remove pointless WARN_ON in DMA teardown
PATCH 1/1 arm64: Remove pointless WARN_ON in DMA teardown
We expect arch_teardown_dma_ops() to be called very late in a device's life, after it has been removed from its bus, and thus after the IOMMU bus notifier has run. As such, even if this funny little check did make sense, it's unlikely to achieve what it thinks it's trying to do anyway. It's a residual trace of an earlier implementation which didn't belong here from the start; belatedly snuff it out.
--- arch/arm64/mm/dma-mapping.c | 5 ----- 1 file changed, 5 deletions(-)
arch/arm64/mm/dma-mapping.c +0 -5
@@ -940,11 +940,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,void arch_teardown_dma_ops (struct device *dev) { -struct iommu_domain *domain =iommu_get_domain_for_dev (dev); - -if (WARN_ON (domain)) -iommu_detach_device (domain, dev); - dev->archdata.dma_ops =NULL ; }
Signature · 1 line
1.9.1
PATCH 1/1 arm64: Remove pointless WARN_ON in DMA teardown
Quoted 17 lines · Robin Murphy
We expect
arch_teardown_dma_ops()to be called very late in a device's life, after it has been removed from its bus, and thus after the IOMMU bus notifier has run. As such, even if this funny little check did make sense, it's unlikely to achieve what it thinks it's trying to do anyway. It's a residual trace of an earlier implementation which didn't belong here from the start; belatedly snuff it out.Signed-off-by Robin Murphy <[email protected]>--- arch/arm64/mm/dma-mapping.c | 5 ----- 1 file changed, 5 deletions(-)arch/arm64/mm/dma-mapping.c +0
-0
arch/arm64/mm/dma-mapping.c static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · line 944
Quoted 10 lines
arch/arm64/mm/dma-mapping.c +0
-5@@ -940,11 +940,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,void arch_teardown_dma_ops (struct device *dev) { -struct iommu_domain *domain =iommu_get_domain_for_dev (dev); - -if (WARN_ON (domain)) -iommu_detach_device (domain, dev); - dev->archdata.dma_ops =NULL ; }
I guess Catalin will pick this up when he starts queueing things for 4.10.
Will
PATCH 1/1 arm64: Remove pointless WARN_ON in DMA teardown
In reply to Robin MurphyHi,
Quoted 18 lines
We expect
arch_teardown_dma_ops()to be called very late in a device's life, after it has been removed from its bus, and thus after the IOMMU bus notifier has run. As such, even if this funny little check did make sense, it's unlikely to achieve what it thinks it's trying to do anyway. It's a residual trace of an earlier implementation which didn't belong here from the start; belatedly snuff it out.Signed-off-by Robin Murphy <[email protected]>---
arch/arm64/mm/dma-mapping.c| 5 -----1 file changed, 5 deletions(-)arch/arm64/mm/dma-mapping.c +0
-0
arch/arm64/mm/dma-mapping.c static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · line 947
Quoted 8 lines
arch/arm64/mm/dma-mapping.c +0
-5@@ -940,11 +940,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,void arch_teardown_dma_ops (struct device *dev) { -struct iommu_domain *domain =iommu_get_domain_for_dev (dev); - -if (WARN_ON (domain)) -iommu_detach_device (domain, dev); -
Thanks!!, clears my doubt that i had for quite sometime.
Regards,
Sricharan
PATCH 1/1 arm64: Remove pointless WARN_ON in DMA teardown
In reply to Robin MurphyQuoted 8 lines · Robin Murphy
We expect
arch_teardown_dma_ops()to be called very late in a device's life, after it has been removed from its bus, and thus after the IOMMU bus notifier has run. As such, even if this funny little check did make sense, it's unlikely to achieve what it thinks it's trying to do anyway. It's a residual trace of an earlier implementation which didn't belong here from the start; belatedly snuff it out.Signed-off-by Robin Murphy <[email protected]>
Queued for 4.10. Thanks.
Signature · 1 line
Catalin