From: Murali Krishna <muralikrishna2444b@gmail.com>
To: anandu.e@oss.qualcomm.com
Cc: srini@kernel.org, ekansh.gupta@oss.qualcomm.com, arnd@arndb.de,
gregkh@linuxfoundation.org, jorge.ramirez@oss.qualcomm.com,
srinivas.kandagatla@oss.qualcomm.com, rene@renesp.com.br,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
Murali Krishna <muralikrishna2444b@gmail.com>
Subject: Re: [PATCH v4 3/3] misc: fastrpc: fix context leak and hang on signal-interrupted invoke
Date: Tue, 24 Nov 2026 20:17:43 +0530 [thread overview]
Message-ID: <20261124144754.99753-1-muralikrishna2444b@gmail.com> (raw)
In-Reply-To: <20261117-interrupted-invoke-v4-v4-3-2320a8a7eda2@oss.qualcomm.com>
On Tue, 17 Nov 2026 15:09:47 +0530, Anandu Krishnan E wrote:
> The same unreachable-orphan problem exists for a timed-out kernel
> invoke (-ETIMEDOUT, only possible when kernel=true): the bail: path
> used to unconditionally unlink the context from fl->pending before
> dropping its reference, even though the DSP may still answer later.
> Leave it linked on fl->pending in that case instead, so
> fastrpc_notify_users() can still find and release it if the channel
> is torn down before that answer arrives.
I am new to this driver, so please treat this as an observation rather
than a review. I applied 1/3 and 2/3 to char-misc-next (917fcbf03) and
read 3/3 against that tree.
The -ETIMEDOUT claim does check out: fastrpc_wait_for_response() only
returns it from the kernel branch's wait_for_completion_timeout(), the
user branch uses wait_for_completion_interruptible(), and
poll_for_remote_response() converts its own timeout into -EIO.
My question is what then happens to such a context at fd close.
Once 1/3 removes the loop in fastrpc_user_free(), no path drains
fl->pending any more: fastrpc_notify_users() completes the contexts on
it but neither unlinks them nor drops a reference, and the drain 3/3
adds to fastrpc_device_release() covers fl->interrupted only. A
timed-out kernel invoke therefore keeps its worker reference, stays
linked on fl->pending, and through the fastrpc_user_get() taken in
fastrpc_context_alloc() keeps fl alive until an SSR runs
fastrpc_notify_users(). If no SSR ever arrives, nothing releases it.
The reasoning you already apply to fl->interrupted seems to cover this
case as well: if fastrpc_release_current_dsp_process() succeeded then
the DSP is done with the whole process, so a context sitting on
fl->pending should be equally safe to release. Would it make sense to
use release_err for both lists?
What made me look was that fastrpc_release_current_dsp_process() is
itself a kernel invoke, so it can be the call that times out. In that
case release_err is non-zero, the fl->interrupted drain deliberately
keeps the worker references, and that call's own context is also left
behind on fl->pending -- so fl, its maps and its mmaps all stay
allocated while fastrpc_session_free() has already marked the session
reusable.
That looks close to the behaviour Renê de Souza Pinto reports on
QCS8275 after an adsprpcd init failure, in a thread where he has since
offered to test this series on that board:
https://lore.kernel.org/linux-arm-msm/20261124141843.3967523-1-rene@renesp.com.br/
If that offer stands, an adsprpcd init failure followed by closing the
fd might be a useful case to try, since it is exactly the path where
release_err is non-zero.
I built 1/3 and 2/3 on char-misc-next with COMPILE_TEST=y under W=1
with no new warnings. I have not applied 3/3 itself, and I have no
Qualcomm hardware, so none of this is tested -- it is from reading the
code only.
Thanks,
Murali Krishna
next prev parent reply other threads:[~2026-11-24 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 9:39 [PATCH v4 0/3] misc: fastrpc: fix context leak and hang on signal-interrupted invoke Anandu Krishnan E
2026-11-17 9:39 ` [PATCH v4 1/3] misc: fastrpc: remove dead context drain in fastrpc_user_free() Anandu Krishnan E
2026-11-17 9:52 ` sashiko-bot
2026-11-17 15:35 ` Ekansh Gupta
2026-11-17 9:39 ` [PATCH v4 2/3] misc: fastrpc: drop the DSP-response reference on channel removal Anandu Krishnan E
2026-11-17 9:55 ` sashiko-bot
2026-11-17 15:49 ` Ekansh Gupta
2026-11-17 9:39 ` [PATCH v4 3/3] misc: fastrpc: fix context leak and hang on signal-interrupted invoke Anandu Krishnan E
2026-11-17 10:05 ` sashiko-bot
2026-11-24 14:47 ` Murali Krishna [this message]
2026-11-24 15:37 ` Renê
2026-11-24 21:06 ` [PATCH v4 0/3] " Srinivas Kandagatla
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=20261124144754.99753-1-muralikrishna2444b@gmail.com \
--to=muralikrishna2444b@gmail.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=jorge.ramirez@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=rene@renesp.com.br \
--cc=srini@kernel.org \
--cc=srinivas.kandagatla@oss.qualcomm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.