Skip to content

remoteproc: k3: Recover a crashed remote core

Chrispine Tinega linux-remoteproc lkml 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 3 repliesSuperseded
  3. v12 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1: report the crash only when rproc->state == RPROC_RUNNING, and keep logging it otherwise, so IPC-only cores can still detach cleanly and a crash queued during probe cannot outlive a failed probe. (Sashiko review, pointed out by Francesco)
- Patch 2: unchanged.
- Rebased onto rproc-next.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2remoteproc: k3: Report a remote crash to the remoteproc coredrivers/remoteproc/ti_k3_common.c+9 -30 replies
2/2remoteproc: k3-m4: Enable crash recovery for a core Linux booteddrivers/remoteproc/ti_k3_m4_remoteproc.c+5 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] remoteproc: k3: Recover a crashed remote core

A K3 remote core can tell Linux it has crashed by sending RP_MBOX_CRASH, but the K3 drivers only log it. Nothing reaches the remoteproc core, so the crash is not counted and recovery never runs. The core stays halted until the next boot, with its rpmsg channels dead.

Patch 1 reports the crash with rproc_report_crash() when the core is RPROC_RUNNING, and keeps logging it otherwise. This applies to every K3 remote that uses the common mailbox callback, while leaving IPC-only cores and the probe window untouched.

Patch 2 enables recovery on the M4F when Linux booted it. Its stop is a plain reset, so recovery does not need the crashed core to answer. In IPC-only mode recovery stays disabled, because it would boot the firmware Linux has, which need not be the one started before Linux. The R5F and DSP drivers keep recovery disabled. A crashed core there moves to RPROC_CRASHED, and can be stopped and started again through sysfs. On the R5F, recovery itself would not restart the core yet: the reset it needs is applied in unprepare(), which recovery does not call.

Tested on an AM625 board (BLIIoT BL350) running TI's 6.12 kernel with the equivalent change. The M4F runs Zephyr, whose fatal-error handler sends RP_MBOX_CRASH. After a forced fault, recovery reset and rebooted the M4F in 71 ms, and Linux kept running. Mainline's M4F stop is the same plain reset that this test used for a crashed core. The Zephyr side is https://github.com/zephyrproject-rtos/zephyr/pull/125770.

Changes in v3:
- Patch 1: report the crash only when rproc->state == RPROC_RUNNING, and keep logging it otherwise, so IPC-only cores can still detach cleanly and a crash queued during probe cannot outlive a failed probe. (Sashiko review, pointed out by Francesco)
- Patch 2: unchanged.
- Rebased onto rproc-next.

Changes in v2:
- Patch 1: drop the duplicate crash print, and note the R5F limit in the commit message. (Francesco)
- Patch 2: keep recovery disabled in IPC-only mode. (Francesco)
- Rebased onto rproc-next.

v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Chrispine Tinega (2):
remoteproc: k3: Report a remote crash to the remoteproc core
remoteproc: k3-m4: Enable crash recovery for a core Linux booted

 drivers/remoteproc/ti_k3_common.c        | 12 +++++++++---
 drivers/remoteproc/ti_k3_m4_remoteproc.c |  6 +++++-
 2 files changed, 14 insertions(+), 4 deletions(-)

base-commit: f39ba58941efa63e6c7d10d53d183d6077524bdb

Signature · 1 line
2.53.0