From: Marek Szyprowski Date: Tue, 16 Feb 2016 14:14:44 +0000 (+0100) Subject: arm64: dma-mapping: fix handling of devices registered before arch_initcall X-Git-Tag: submit/tizen/20160607.132125~890 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=593337c55ac30807f38ca924e716edfdc4e6a916;p=sdk%2Femulator%2Femulator-kernel.git arm64: dma-mapping: fix handling of devices registered before arch_initcall commit 722ec35f7faefcc34d12616eca7976a848870f9d upstream. This patch ensures that devices, which got registered before arch_initcall will be handled correctly by IOMMU-based DMA-mapping code. Fixes: 13b8629f6511 ("arm64: Add IOMMU dma_ops") Acked-by: Robin Murphy Signed-off-by: Marek Szyprowski Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 7963aa4..354144e 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);