]> www.infradead.org Git - users/dwmw2/linux.git/commit
iommu/rockchip: prevent iommus dead loop when two masters share one IOMMU
authorSimon Xue <xxm@rock-chips.com>
Mon, 23 Jun 2025 02:00:18 +0000 (10:00 +0800)
committerJoerg Roedel <joerg.roedel@amd.com>
Fri, 27 Jun 2025 07:10:29 +0000 (09:10 +0200)
commit62e062a29ad5133f67c20b333ba0a952a99161ae
treed900f931cb1a487e55acc83e802902df2e64240c
parent86731a2a651e58953fc949573895f2fa6d456841
iommu/rockchip: prevent iommus dead loop when two masters share one IOMMU

When two masters share an IOMMU, calling ops->of_xlate during
the second master's driver init may overwrite iommu->domain set
by the first. This causes the check if (iommu->domain == domain)
in rk_iommu_attach_device() to fail, resulting in the same
iommu->node being added twice to &rk_domain->iommus, which can
lead to an infinite loop in subsequent &rk_domain->iommus operations.

Cc: <stable@vger.kernel.org>
Fixes: 25c2325575cc ("iommu/rockchip: Add missing set_platform_dma_ops callback")
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20250623020018.584802-1-xxm@rock-chips.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/rockchip-iommu.c