From: Arun Iyengar Date: Tue, 01 Dec 2026 07:28:09 +0000 Subject: [PATCH 2/2] accel/rocket: Reset the core before detaching its IOMMU MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261201-rocket-fixes-v1-2-986c3e5ceb44@gmail.com> References: <20261201-rocket-fixes-v1-0-986c3e5ceb44@gmail.com> In-Reply-To: <20261201-rocket-fixes-v1-0-986c3e5ceb44@gmail.com> To: Tomeu Vizoso , Oded Gabbay Cc: Heiko Stuebner , Jeff Hugo , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Philipp Stanner , Midgy BALON , Jiaxing Hu , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, stable@vger.kernel.org, Arun Iyengar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796110087; l=1605; i=aiyengar1990@gmail.com; s=20261110; h=from:subject:message-id; bh=vjCh/lz8Uv74AztS1spIjefsawlLtWQrhTkv0ZshJKs=; b=x6bTvOT5LRygLIKbuDGH0hsJIAMs3EMNWBaJqrXUahVT/CbYEBF6ChUoXjQIrWToixFxp5a6K E6HPvqMwtDND3oM1QKjPBs4Bth/vzb4VK/W+oc6hzjX7zZue+VUAHGX X-Developer-Key: i=aiyengar1990@gmail.com; a=ed25519; pk=zXpRgUTrhaFe6jLyPqbBy3ccfkj04w0g2690Wv3mg+0= X-Endpoint-Received: by B4 Relay for aiyengar1990@gmail.com/20261110 with auth_id=1480 List-Id: B4 Relay Submissions 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@vger.kernel.org Cc: Midgy BALON Signed-off-by: Arun Iyengar --- 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