On Wed, Jun 03, 2026 at 10:58:09AM +0530, Ekansh Gupta wrote: > On 20-05-2026 19:49, Dmitry Baryshkov wrote: > > On Tue, May 19, 2026 at 11:45:54AM +0530, Ekansh Gupta via B4 Relay wrote: > >> From: Ekansh Gupta <[email protected]> > >> > >> Introduce a custom virtual bus (qda-compute-cb) for managing IOMMU > >> context bank (CB) devices used by the QDA driver. > >> > >> IOMMU context banks are synthetic constructs — they are not real > >> platform devices and do not appear as children of a platform bus node > >> in the device tree. Using a platform driver to represent them was > >> therefore incorrect and introduced a probe-ordering race: device nodes > >> were created before the RPMsg channel resources were fully initialized, > >> and because probe runs asynchronously, user-space could open a CB > >> device and attempt to start a session before the underlying transport > >> was ready. > >> > >> The qda-compute-cb bus solves this by allowing the main QDA driver to > >> create CB devices explicitly and under its own control, making their > >> lifetime strictly subordinate to the parent qda_dev. The bus provides > >> a dma_configure callback that calls of_dma_configure() so that each CB > >> device gets its own IOMMU domain derived from its device-tree node, > >> enabling per-session memory isolation. > >> > >> The bus type and the CB device constructor (create_qda_cb_device) are > >> exported for use by the QDA memory manager. > >> > >> A hidden Kconfig symbol (DRM_ACCEL_QDA_COMPUTE_BUS) is introduced and > >> automatically selected by DRM_ACCEL_QDA so that the bus initialisation > >> runs via postcore_initcall before any QDA device probes. > >> > >> Assisted-by: Claude:claude-4-6-sonnet > >> Signed-off-by: Ekansh Gupta <[email protected]> > >> --- > >> drivers/accel/Makefile | 1 + > >> drivers/accel/qda/Kconfig | 4 +++ > >> drivers/accel/qda/Makefile | 2 ++ > >> drivers/accel/qda/qda_compute_bus.c | 68 > >> +++++++++++++++++++++++++++++++++++++ > >> include/linux/qda_compute_bus.h | 32 +++++++++++++++++ > >> 5 files changed, 107 insertions(+) > >> > >> diff --git a/drivers/accel/Makefile b/drivers/accel/Makefile > >> index 58c08dd5f389..9ed843cd293f 100644 > >> --- a/drivers/accel/Makefile > >> +++ b/drivers/accel/Makefile > >> @@ -6,4 +6,5 @@ obj-$(CONFIG_DRM_ACCEL_HABANALABS) += habanalabs/ > >> obj-$(CONFIG_DRM_ACCEL_IVPU) += ivpu/ > >> obj-$(CONFIG_DRM_ACCEL_QAIC) += qaic/ > >> obj-$(CONFIG_DRM_ACCEL_QDA) += qda/ > >> +obj-$(CONFIG_DRM_ACCEL_QDA_COMPUTE_BUS) += qda/ > > > > Ugh. The previous line should be enough (but don't trust me). > I was seeing build failures if I don't add this. Took it as a reference > from host1x driver and recent iris patch.>
Reviewed-by: Dmitry Baryshkov <[email protected]> -- With best wishes Dmitry
