From: sashiko-bot@kernel.org
To: "Jiaxing Hu" <gahing@gahingwoo.com>
Cc: robh@kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v13 04/14] accel/rocket: let the core suspend after a reset
Date: Tue, 15 Sep 2026 10:58:38 +0000 [thread overview]
Message-ID: <20260915105838.95CFD1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915104328.45901-5-gahing@gahingwoo.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Race condition in reset path prevents required IOMMU hardware recovery
--
commit b227f4b369396fb45d834eeade730dbc33623b84
Author: Jiaxing Hu <gahing@gahingwoo.com>
accel/rocket: let the core suspend after a reset
This commit replaces pm_runtime_put_noidle() with pm_runtime_put_autosuspend()
in the rocket_reset() path to allow the core to suspend. Cycling the power
domain issues a bus interface reset that is needed to recover the IOMMU.
Link: https://lore.kernel.org/all/20260819073530.6087-1-royalnet026@gmail.com/
> diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> index dfe9135d86af5..2a0b8af6f67da 100644
> --- a/drivers/accel/rocket/rocket_job.c
> +++ b/drivers/accel/rocket/rocket_job.c
> @@ -437,12 +437,12 @@ rocket_reset(struct rocket_core *core, struct drm_sched_job *bad)
>
> /*
> * No handler is running now, but we might still have stuck jobs. Let's
> - * make sure the PM counters stay balanced by manually calling
> - * pm_runtime_put_noidle().
> + * make sure the PM counters stay balanced by putting the reference the
> + * job took, and request idle while doing it so the core can suspend.
> */
> scoped_guard(mutex, &core->job_lock) {
> if (core->in_flight_job)
> - pm_runtime_put_noidle(core->dev);
> + pm_runtime_put_autosuspend(core->dev);
[Severity: High]
Does using pm_runtime_put_autosuspend() here guarantee the synchronous hardware
power cycle required to recover the IOMMU?
Since pm_runtime_put_autosuspend() is asynchronous, it merely queues a suspend
with a delay. A few lines below, rocket_reset() calls drm_sched_start():
drivers/accel/rocket/rocket_job.c:rocket_reset() {
...
/* Restart the scheduler */
drm_sched_start(&core->sched, 0);
}
If the scheduler has jobs queued, it will immediately dequeue the next job and
execute rocket_job_run(). This function calls pm_runtime_resume_and_get(),
which increments the usage count and cancels the pending autosuspend before the
timer can expire.
Could this race condition prevent the power domain from cycling under continuous
load, leaving the NPU's IOMMU unresponsive and causing subsequent jobs to fail?
Would it be safer to use a synchronous put like pm_runtime_put_sync() when
hardware ordering constraints require the device to be powered down before the
next operation?
>
> iommu_detach_group(NULL, core->iommu_group);
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915104328.45901-1-gahing@gahingwoo.com?part=4
next prev parent reply other threads:[~2026-09-15 10:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 10:43 [PATCH v13 00/14] accel/rocket: RK3576 NPU (RKNN) enablement Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 01/14] accel/rocket: request the core clocks by name Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 02/14] accel/rocket: take the completion register writes under job_lock Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 03/14] accel/rocket: wait for a running IRQ handler before resetting a core Jiaxing Hu
2026-09-15 10:59 ` sashiko-bot
2026-09-16 13:28 ` Igor Paunovic
2026-09-19 9:17 ` Jiaxing Hu
2026-09-19 10:34 ` Igor Paunovic
2026-09-15 10:43 ` [PATCH v13 04/14] accel/rocket: let the core suspend after a reset Jiaxing Hu
2026-09-15 10:58 ` sashiko-bot [this message]
2026-09-15 10:43 ` [PATCH v13 05/14] accel/rocket: factor the completion tail out of the IRQ handler Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 06/14] dt-bindings: npu: rockchip: add rockchip, rk3576-rknn-core Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 07/14] dt-bindings: power: rockchip: allow resets in a power domain node Jiaxing Hu
2026-09-21 21:52 ` Heiko Stuebner
2026-09-15 10:43 ` [PATCH v13 08/14] dt-bindings: iommu: rockchip: describe the RK3576 NPU MMU Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 09/14] pmdomain: rockchip: add optional per-domain power-on settle delay Jiaxing Hu
2026-09-21 12:41 ` Ulf Hansson
2026-09-21 22:06 ` Heiko Stuebner
2026-09-22 1:28 ` Chaoyi Chen
2026-09-15 10:43 ` [PATCH v13 10/14] pmdomain: rockchip: cycle optional power-domain resets on power-on Jiaxing Hu
2026-09-15 10:56 ` sashiko-bot
2026-09-21 12:43 ` Ulf Hansson
2026-09-23 9:38 ` Philipp Zabel
2026-09-15 10:43 ` [PATCH v13 11/14] accel/rocket: select the per-core clock and reset counts from match data Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 12/14] accel/rocket: add RK3576 NPU (RKNN) support Jiaxing Hu
2026-09-15 10:43 ` [PATCH v13 13/14] arm64: dts: rockchip: add NPU (RKNN) nodes to rk3576 Jiaxing Hu
2026-09-21 21:51 ` Heiko Stuebner
2026-09-15 10:43 ` [PATCH v13 14/14] arm64: dts: rockchip: enable the NPU on rk3576-rock-4d Jiaxing Hu
2026-09-19 7:32 ` [PATCH v13 00/14] accel/rocket: RK3576 NPU (RKNN) enablement Sidong Yang
2026-09-19 9:17 ` Jiaxing Hu
2026-09-21 12:46 ` Ulf Hansson
2026-09-24 9:08 ` Jiaxing Hu
2026-09-24 13:48 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260915105838.95CFD1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gahing@gahingwoo.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox