Re: [PATCH] misc: fastrpc: fix self-deadlock in fastrpc_notify_users()
From: Ekansh Gupta
Date: Mon Nov 30 2026 - 03:10:47 EST
On 30-11-2026 09:22, Shawn Guo wrote:
> fastrpc_notify_users() holds user->lock while it walks the pending and
> interrupted lists, and calls fastrpc_context_schedule_put_work() for
> each context. That helper takes ctx->fl->lock, which is the same lock,
> so the CPU spins on a lock it already holds. Since the caller,
> fastrpc_rpmsg_remove(), also holds cctx->lock with interrupts disabled,
> the CPU is stuck with IRQs off. Any invoker woken by the preceding
> complete() then spins on fl->lock as well.
>
> This is hit on every remoteproc stop of a DSP with an active fastrpc
> user, e.g. on Nord Ride:
>
> echo stop > /sys/class/remoteproc/remoteproc1/state
> rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> ...
> Call trace:
> queued_spin_lock_slowpath+0x248/0x340 (P)
> fastrpc_internal_invoke+0xa8c/0x13e0 [fastrpc]
> fastrpc_device_ioctl+0x6e8/0x10c0 [fastrpc]
>
> Add __fastrpc_context_schedule_put_work() for callers that already
> hold fl->lock, and use it in fastrpc_notify_users().
>
> Fixes: 3f645f6884b5 ("misc: fastrpc: fix context leak and hang on signal-interrupted invoke")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Shawn Guo <shengchao.guo@xxxxxxxxxxxxxxxx>
I believe this[1] addresses the same issue, can you have a look at this?
[1]
https://lore.kernel.org/all/20261127-fix-put-work-irq-deadlock-v1-1-3aa66fe4f2c9@xxxxxxxxxxxxxxxx/