[PATCH 2/2] accel/rocket: Reset the core before detaching its IOMMU

Arun Iyengar via B4 Relay devnull+aiyengar1990.gmail.com at kernel.org
Mon Nov 30 23:28:09 PST 2026


From: Arun Iyengar <aiyengar1990 at gmail.com>

Midgy Balon posted the same change in an RK3568 RFC series [1].

A timed-out job leaves the NPU master hung on the bus. The IOMMU then
cannot enter stall mode, the detach fails and the IOMMU core warns:

  rk_iommu fdab9000.iommu: Enable stall request timed out, status: 0x0001cb
  WARNING: drivers/iommu/iommu.c:157 at __iommu_group_set_core_domain+0x5c/0x98

Reset the core first, as the vendor driver does.

Link: https://lore.kernel.org/r/20260613070116.438906-5-midgy971@gmail.com [1]
Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Cc: stable at vger.kernel.org
Cc: Midgy BALON <midgy971 at gmail.com>
Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
---
 drivers/accel/rocket/rocket_job.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
index 32926afb0144..8bc0b80d9190 100644
--- a/drivers/accel/rocket/rocket_job.c
+++ b/drivers/accel/rocket/rocket_job.c
@@ -427,15 +427,17 @@ rocket_reset(struct rocket_core *core, struct drm_sched_job *bad)
 	 */
 	scoped_guard(mutex, &core->job_lock) {
 		put_job_ref = core->in_flight_job;
-
-		iommu_detach_group(NULL, core->iommu_group);
-
 		core->in_flight_job = NULL;
 	}
 
-	/* Proceed with reset now. */
+	/*
+	 * Reset before detaching: the IOMMU cannot stall while a hung job
+	 * keeps the bus busy, and then the detach fails.
+	 */
 	rocket_core_reset(core);
 
+	iommu_detach_group(NULL, core->iommu_group);
+
 	if (put_job_ref)
 		pm_runtime_put_autosuspend(core->dev);
 

-- 
2.55.0





More information about the Linux-rockchip mailing list