Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] remoteproc: fix silent teardown failures and prevent SMMU faults on hung DSP
@ 2026-06-09 10:22 Mukesh Ojha
  2026-06-09 10:22 ` [PATCH 1/3] remoteproc: check return value of subdev stop and unprepare callbacks Mukesh Ojha
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mukesh Ojha @ 2026-06-09 10:22 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel, linux-arm-kernel,
	linux-mediatek, Mukesh Ojha

When a DSP hangs without triggering its own crash handler, a graceful
shutdown via sysmon times out.  Before this series, two things went
wrong:

  1. The stop() and unprepare() callbacks in struct rproc_subdev were
     void.  Implementations had no way to surface failures, and callers
     discarded any internal error state silently.

  2. Even if an error had been detectable, rproc_stop_subdevices() kept
     iterating after a failed stop.  This meant glink and ssr subdevices
     were torn down regardless, causing HLOS to unregister and unmap the
     shared memory regions.  If the remote still had DMA in flight
     against those regions — as is often the case with a hung DSP — the
     result was an SMMU fault.

This series fixes both problems in three steps.

Patch 1 changes stop() and unprepare() from void to int, matching
prepare() and start().  Most implementations gain a trivial return 0;
rproc_vdev_do_stop() now surfaces the error it was already computing.
Callers warn on failure but continue iterating (best-effort).

Patch 2 changes rproc_stop_subdevices() to abort and return error on the
first failing subdev, propagating through rproc_stop() and
__rproc_detach().

Patch 3 makes sysmon_stop() return -ETIMEDOUT when the remote does not
acknowledge a graceful shutdown request.  Combined with patch 2, this
prevents glink and ssr from unmapping shared memory against a hung DSP.

Mukesh Ojha (3):
  remoteproc: check return value of subdev stop and unprepare callbacks
  remoteproc: abort subdev stop sequence on first failure
  remoteproc: qcom_sysmon: abort stop on unacknowledged shutdown

 drivers/remoteproc/qcom_common.c       | 26 ++++++++++++++-----
 drivers/remoteproc/qcom_sysmon.c       | 15 ++++++++---
 drivers/remoteproc/remoteproc_core.c   | 36 +++++++++++++++++++++-----
 drivers/remoteproc/remoteproc_virtio.c |  4 ++-
 drivers/rpmsg/mtk_rpmsg.c              |  8 ++++--
 include/linux/remoteproc.h             |  4 +--
 6 files changed, 71 insertions(+), 22 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-09 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-09 10:22 ` [PATCH 3/3] remoteproc: qcom_sysmon: abort stop on unacknowledged shutdown Mukesh Ojha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox