Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marek Szyprowski and committed by
Will Deacon
722ec35f 7f4e3462

+4
+4
arch/arm64/mm/dma-mapping.c
··· 933 933 ret = register_iommu_dma_ops_notifier(&platform_bus_type); 934 934 if (!ret) 935 935 ret = register_iommu_dma_ops_notifier(&amba_bustype); 936 + 937 + /* handle devices queued before this arch_initcall */ 938 + if (!ret) 939 + __iommu_attach_notifier(NULL, BUS_NOTIFY_ADD_DEVICE, NULL); 936 940 return ret; 937 941 } 938 942 arch_initcall(__iommu_dma_init);