[PATCH v3 3/7] iommu: register the DMA channel bus for IOMMU notifications
Peng Fan (OSS)
peng.fan at oss.nxp.com
Sun Nov 1 22:49:57 PST 2026
From: Peng Fan <peng.fan at nxp.com>
DMA channel devices are about to be registered on a dedicated DMA channel
bus so that they get a properly balanced bus association before
device_register().
Add that bus to iommu_buses[] so the IOMMU core installs its bus notifier
for it. This allows of_dma_configure() to probe a per-channel IOMMU and,
more importantly, lets BUS_NOTIFY_REMOVED_DEVICE release the IOMMU group
and domain when the channel device is unregistered.
The dmaengine bus is registered from an arch_initcall, before
iommu_subsys_init() consumes iommu_buses[]. Guard the entry with
CONFIG_DMA_ENGINE because the bus does not exist when the DMA engine core
is not built.
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
drivers/iommu/iommu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index b486b8bbd1fcd..6fa871bbd63ad 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -8,6 +8,7 @@
#include <linux/amba/bus.h>
#include <linux/device.h>
+#include <linux/dmaengine.h>
#include <linux/kernel.h>
#include <linux/bits.h>
#include <linux/bug.h>
@@ -191,6 +192,9 @@ static const struct bus_type * const iommu_buses[] = {
#ifdef CONFIG_ARM_AMBA
&amba_bustype,
#endif
+#ifdef CONFIG_DMA_ENGINE
+ &dma_chan_bus_type,
+#endif
#ifdef CONFIG_FSL_MC_BUS
&fsl_mc_bus_type,
#endif
--
2.34.1
More information about the linux-arm-kernel
mailing list