]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8835/1: dma-mapping: Clear DMA ops on teardown
authorRobin Murphy <robin.murphy@arm.com>
Wed, 6 Feb 2019 17:43:24 +0000 (18:43 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 12 Feb 2019 15:20:59 +0000 (15:20 +0000)
commite66821cdeafc5216f55e8391891cf0f37be4f31a
tree2b7563a887ea16afb2fb3972763ec0898a6d9618
parent8c8cfeec90951b9ce2c24b288f5614a045b27f54
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: 884fd86605e3 "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>
arch/arm/mm/dma-mapping.c