From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Atul Akella <atul.akella@gmail.com>
Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH] rpmsg: virtio: fix error handling in TX buffer wait
Date: Wed, 14 Oct 2026 09:49:20 -0600 [thread overview]
Message-ID: <as-kgAyy2oBVP3jr@p14s> (raw)
In-Reply-To: <20261013160055.1362-1-atul.akella@gmail.com>
On Tue, Oct 13, 2026 at 09:30:55PM +0530, Atul Akella wrote:
> The TX buffer wait loop in rpmsg_send_offchannel_raw() ignores the
> possibility of wait_event_interruptible_timeout() returning a
> negative value, which happens when the wait is interrupted by a
> signal. In that case the loop spins back around and re-arms the
> wait instead of propagating the signal, which can stall a task
> that is trying to be killed.
>
> Separately, on a genuine timeout (return value 0) the function
> returns -ERESTARTSYS, which is reserved for signal-interrupted
> syscalls that the kernel may restart. A timeout is not a signal
> and should not be treated as restartable; return -ETIMEDOUT
> instead.
>
> Handle both cases explicitly: return err directly when negative,
> and return -ETIMEDOUT on timeout.
>
> Fixes: bcabbccabffe ("rpmsg: add virtio-based remote processor messaging bus")
> Signed-off-by: Atul Akella <atul.akella@gmail.com>
> ---
> drivers/rpmsg/virtio_rpmsg_bus.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
> index 1b8bb05924af..a32772d6ccbc 100644
> --- a/drivers/rpmsg/virtio_rpmsg_bus.c
> +++ b/drivers/rpmsg/virtio_rpmsg_bus.c
> @@ -536,10 +536,13 @@ static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev,
> (msg = get_a_tx_buf(vrp)),
> msecs_to_jiffies(15000));
>
> + if (err < 0)
> + return err;
> +
> /* timeout ? */
> if (!err) {
> dev_err(dev, "timeout waiting for a tx buffer\n");
> - return -ERESTARTSYS;
> + return -ETIMEDOUT;
Applied.
Thanks,
Mathieu
> }
> }
>
> --
> 2.51.0.windows.1
>
prev parent reply other threads:[~2026-10-14 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 16:00 [PATCH] rpmsg: virtio: fix error handling in TX buffer wait Atul Akella
2026-10-14 15:49 ` Mathieu Poirier [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=as-kgAyy2oBVP3jr@p14s \
--to=mathieu.poirier@linaro.org \
--cc=andersson@kernel.org \
--cc=atul.akella@gmail.com \
--cc=linux-remoteproc@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