Skip to content

Commit fc67e6f

Browse files
rmurphy-armRussell King
authored and
Russell King
committed
ARM: 8835/1: dma-mapping: Clear DMA ops on teardown
Installing the appropriate non-IOMMU DMA ops in arm_iommu_detch_device() serves the case where IOMMU-aware drivers choose to control their own mapping but still make DMA API calls, however it also affects the case when the arch code itself tears down the mapping upon driver unbinding, where the ops now get left in place and can inhibit arch_setup_dma_ops() on subsequent re-probe attempts. Fix the latter case by making sure that arch_teardown_dma_ops() cleans up whenever the ops were automatically installed by its counterpart. Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Fixes: 1874619 "ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()" Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 0ac569b commit fc67e6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/mm/dma-mapping.c

+2
Original file line numberDiff line numberDiff line change
@@ -2390,4 +2390,6 @@ void arch_teardown_dma_ops(struct device *dev)
23902390
return;
23912391

23922392
arm_teardown_iommu_dma_ops(dev);
2393+
/* Let arch_setup_dma_ops() start again from scratch upon re-probe */
2394+
set_dma_ops(dev, NULL);
23932395
}

0 commit comments

Comments
 (0)