diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2016-02-16 17:14:44 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-02-17 14:48:01 +0300 |
commit | 722ec35f7faefcc34d12616eca7976a848870f9d (patch) | |
tree | d511cf83919ccab129e16b5453c620b608a471e8 | |
parent | 7f4e346263f59ff50b531dda94609fb13ca12401 (diff) | |
download | linux-722ec35f7faefcc34d12616eca7976a848870f9d.tar.xz |
arm64: dma-mapping: fix handling of devices registered before arch_initcall
This patch ensures that devices, which got registered before arch_initcall
will be handled correctly by IOMMU-based DMA-mapping code.
Cc: <stable@vger.kernel.org>
Fixes: 13b8629f6511 ("arm64: Add IOMMU dma_ops")
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 331c4ca6205c..a6e757cbab77 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -933,6 +933,10 @@ static int __init __iommu_dma_init(void) ret = register_iommu_dma_ops_notifier(&platform_bus_type); if (!ret) ret = register_iommu_dma_ops_notifier(&amba_bustype); + + /* handle devices queued before this arch_initcall */ + if (!ret) + __iommu_attach_notifier(NULL, BUS_NOTIFY_ADD_DEVICE, NULL); return ret; } arch_initcall(__iommu_dma_init); |