mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Guo <shengchao.guo@oss.qualcomm.com>
To: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Anandu Krishnan E <anandu.e@oss.qualcomm.com>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] misc: fastrpc: fix self-deadlock in fastrpc_notify_users()
Date: Tue, 1 Dec 2026 09:43:14 +0800	[thread overview]
Message-ID: <aw4mMpG-BuFtewv0@QCOM-aGQu4IUr3Y> (raw)
In-Reply-To: <bc85a7b5-887b-43e6-b929-ea7ffafb153c@oss.qualcomm.com>

On Mon, Nov 30, 2026 at 01:40:35PM +0530, Ekansh Gupta wrote:
> 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@vger.kernel.org
> > Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
> 
> I believe this[1] addresses the same issue, can you have a look at this?

Thanks for the pointer, Ekansh!

Indeed! The pointed patch works for me. My version can be discarded then.

Shawn

> 
> [1]
> https://lore.kernel.org/all/20261127-fix-put-work-irq-deadlock-v1-1-3aa66fe4f2c9@oss.qualcomm.com/

      reply	other threads:[~2026-12-01  1:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  3:52 Shawn Guo
2026-11-30  8:10 ` Ekansh Gupta
2026-12-01  1:43   ` Shawn Guo [this message]

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=aw4mMpG-BuFtewv0@QCOM-aGQu4IUr3Y \
    --to=shengchao.guo@oss.qualcomm.com \
    --cc=anandu.e@oss.qualcomm.com \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ekansh.gupta@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srini@kernel.org \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®