[PATCH v15 03/15] accel/rocket: wait for a running IRQ handler before resetting a core
Heiko Stübner
heiko at sntech.de
Tue Nov 3 14:50:58 PST 2026
Am Sonntag, 1. November 2026, 09:22:55 Mitteleuropäische Normalzeit schrieb Jiaxing Hu:
> drm_sched_stop() does not wait for a threaded handler that is already
> running. Call synchronize_irq() after it, outside job_lock, which the
> handler takes.
>
> Before the sync, mask the block's interrupt and clear its raw status, so
> that an active core cannot signal a completion after it. Do that under
> job_lock, since rocket_job_hw_submit() arms the same mask under that lock,
> and only when pm_runtime_get_if_active() returns a positive count: the
> reset holds no runtime PM reference, and with the domain down a register
> access takes an async SError.
>
> Igor Paunovic's induced-reset runs on RK3588, including a two-task job that
> puts hw_submit() on the IRQ thread, found no fault; as he put it, "this
> does not show the race is closed".
>
> Link: https://lore.kernel.org/all/20260819073530.6087-1-royalnet026@gmail.com/
> Link: https://lore.kernel.org/all/CAEWPSH5mxTbUkNouxm6yecMZYvDowquhvYvhaXQ8HoMtHD5U1g@mail.gmail.com/
> Link: https://lore.kernel.org/all/20260912113717.6819-1-royalnet026@gmail.com/
> Link: https://lore.kernel.org/all/20260916132824.13527-1-royalnet026@gmail.com/
> Link: https://lore.kernel.org/all/20260919103422.148834-1-royalnet026@gmail.com/
> Suggested-by: Igor Paunovic <royalnet026 at gmail.com>
> Signed-off-by: Jiaxing Hu <gahing at gahingwoo.com>
> Tested-by: Igor Paunovic <royalnet026 at gmail.com> # RK3588, three cores, induced reset, JOB_TIMEOUT_MS=2
> ---
> drivers/accel/rocket/rocket_job.c | 71 +++++++++++++++++++++++++++++--
> 1 file changed, 68 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> index 03e5f094f60b..5b2abf40b618 100644
> --- a/drivers/accel/rocket/rocket_job.c
> +++ b/drivers/accel/rocket/rocket_job.c
> @@ -401,9 +401,74 @@ rocket_reset(struct rocket_core *core, struct drm_sched_job *bad)
> drm_sched_stop(&core->sched, bad);
>
> /*
> - * Remaining interrupts have been handled, but we might still have
> - * stuck jobs. Let's make sure the PM counters stay balanced by
> - * manually calling pm_runtime_put_noidle().
Also, why are you changing the original comment here?
The new wording below, does say essentially the same and you're changing
it again the next patch.
[...]
> + /*
> + * 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().
> */
> scoped_guard(mutex, &core->job_lock) {
> if (core->in_flight_job)
>
More information about the Linux-rockchip
mailing list