]> git.baikalelectronics.ru Git - kernel.git/commit
arm: dma-mapping: Reset the device's dma_ops
authorSricharan R <sricharan@codeaurora.org>
Sat, 27 May 2017 13:47:45 +0000 (19:17 +0530)
committerJoerg Roedel <jroedel@suse.de>
Tue, 30 May 2017 09:31:34 +0000 (11:31 +0200)
commit74c21d271cb0573f85146ecd0290eef61a7c416f
tree31bdac18b9cb52433593cdab08a1e46a9d5c801e
parent15864bfff1a573777148421ecbbfd75d11207c47
arm: dma-mapping: Reset the device's dma_ops

arch_teardown_dma_ops() being the inverse of arch_setup_dma_ops()
,dma_ops should be cleared in the teardown path. Currently, only the
device's iommu mapping structures are cleared in arch_teardown_dma_ops,
but not the dma_ops. So on the next reprobe, dma_ops left in place is
stale from the first IOMMU setup, but iommu mappings has been disposed
of. This is a problem when the probe of the device is deferred and
recalled with the IOMMU probe deferral.

So for fixing this, slightly refactor by moving the code from
__arm_iommu_detach_device to arm_iommu_detach_device and cleanup
the former. This takes care of resetting the dma_ops in the teardown
path.

Fixes: 62aac0d3be65 ("of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
arch/arm/mm/dma-mapping.c