Commit fc67e6f1 authored by Robin Murphy's avatar Robin Murphy Committed by Russell King

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: default avatarTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reported-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Fixes: 1874619a "ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()"
Tested-by: default avatarTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Tested-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 0ac569bf
......@@ -2390,4 +2390,6 @@ void arch_teardown_dma_ops(struct device *dev)
return;
arm_teardown_iommu_dma_ops(dev);
/* Let arch_setup_dma_ops() start again from scratch upon re-probe */
set_dma_ops(dev, NULL);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment