The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Cc: Stephan Gerhold <stephan.gerhold@linaro.org>,
	 Mathieu Poirier <mathieu.poirier@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 2/3] remoteproc: abort subdev stop sequence on first failure
Date: Thu, 9 Jul 2026 16:27:44 -0500	[thread overview]
Message-ID: <alAN2t2C5twxuIjd@baldur> (raw)
In-Reply-To: <20260611105506.llvya5tda4xsd2lo@hu-mojha-hyd.qualcomm.com>

On Thu, Jun 11, 2026 at 04:25:06PM +0530, Mukesh Ojha wrote:
> On Thu, Jun 11, 2026 at 11:54:46AM +0200, Stephan Gerhold wrote:
> > On Thu, Jun 11, 2026 at 03:18:51PM +0530, Mukesh Ojha wrote:
> > > On Tue, Jun 09, 2026 at 01:43:17PM +0200, Stephan Gerhold wrote:
> > > > On Tue, Jun 09, 2026 at 03:52:52PM +0530, Mukesh Ojha wrote:
> > > > > If a subdevice fails to stop, it indicates broken communication with the
> > > > > DSP. Continuing to stop further subdevices against an unresponsive
> > > > > remote processor could close rpmsg devices that could remove the memory
> > > > > mapping from HLOS and in case if remote processor touches those memory
> > > > > can result in SMMU fault.
> > > > > 
> > > > > Change rproc_stop_subdevices() to return int and abort on the first
> > > > > failing subdev. Propagate the error through rproc_stop() and
> > > > > __rproc_detach() so callers are aware the teardown did not complete
> > > > > cleanly.
> > > > > 
> > > > > Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
> > > > 
> > > > But what would callers do about this? If you abort the teardown sequence
> > > > half-way through you now have an inconsistent half-stopped state that
> > > > neither a new call to stop() nor a new call to start() could recover
> > > > from. That doesn't sound much better than the SMMU fault. Or am I
> > > > missing something here?
> > > 
> > > SMMU fault result in device crash while other is non-functional remote
> > > processor. From Linux side, we do not know the state of remote processor
> > > when the timeout happens..cleaning the subdevices can result in the
> > > debug data being lost for hung remote processor.
> > > 
> > 
> > Ok, but how do we go from here? Do we expect that the system would have
> > some userspace monitoring daemon that would collect the debug data and
> > then reboot the device to make the remoteproc work again?
> 
> I would expect the manually collected crash dump in this state to find
> out the exact reason for remoteproc being stuck instead of ignoring it
> and claiming a graceful shutdown.
> 

We need to consider the scenario where there are other users running
this code than you, and as Stephan suggest, they probably expect the
system to recover (by some means). Few people would be expected to pull
out their JTAG hardware and start hacking away...

> Whatever we do here, the remote may be dysfunctional without a reboot,
> but cleaning the rpmsg device will clean all the required debug data, or
> at least if possible, tell the rpmsg driver with the rproc state that
> shutdown was tried but was not graceful.
> 

That's certainly something we need to take into account, but does the
use of "may be" leave room for the possibility that we have a
recoverable error?

Also remember that the user might be in the middle of an important video
conference when the CDSP hits this error, so we don't necessarily want
to reboot the system just because we enter such state - there's user
policy involved here.

Regards,
Bjorn

> > 
> > With these changes, I don't see how you would start the remoteproc again
> > without fully rebooting the board. Calling start()/stop() on the
> > subdevices again would lead to crashes because some of them are in
> > started state and some of them are in stopped state and we don't even
> > know which one is in which state.
> > 
> > Thanks,
> > Stephan
> 
> -- 
> -Mukesh Ojha

  reply	other threads:[~2026-07-09 21:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 10:22 [PATCH 0/3] remoteproc: fix silent teardown failures and prevent SMMU faults on hung DSP Mukesh Ojha
2026-06-09 10:22 ` [PATCH 1/3] remoteproc: check return value of subdev stop and unprepare callbacks Mukesh Ojha
2026-06-09 10:22 ` [PATCH 2/3] remoteproc: abort subdev stop sequence on first failure Mukesh Ojha
2026-06-09 11:43   ` Stephan Gerhold
2026-06-11  9:48     ` Mukesh Ojha
2026-06-11  9:54       ` Stephan Gerhold
2026-06-11 10:55         ` Mukesh Ojha
2026-07-09 21:27           ` Bjorn Andersson [this message]
2026-06-09 10:22 ` [PATCH 3/3] remoteproc: qcom_sysmon: abort stop on unacknowledged shutdown Mukesh Ojha

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=alAN2t2C5twxuIjd@baldur \
    --to=andersson@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=stephan.gerhold@linaro.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