Re: [PATCH v2 1/2] remoteproc: k3: Report a remote crash to the remoteproc core

From: Chrispine Tinega

Date: Wed Nov 18 2026 - 14:44:48 EST


Hi Francesco,

On Wed, Nov 18, 2026 at 05:57:10PM +0100, Francesco Valla wrote:
> Did you have the chance to take a look at the review sashiko did?
> I think the points about the leaks in IPC mode make sense and are worth
> an investigation, both for the M4 and R5F cases.

I had not, thanks. Both of its points on patch 1 hold, and they have
one cause: v2 reports a crash for a core that Linux did not boot.

1. IPC-only mode. Once a DETACHED or ATTACHED core is RPROC_CRASHED,
rproc_detach() refuses it with -EINVAL. The DSP and R5F remove paths
only detach an RPROC_ATTACHED core, so they skip it and leak its
carveouts and subdevices. The R5F also has no start or stop ops in
this mode. On the M4F and DSP, a shutdown would reset a core that
Linux never started.

2. Probe. All three drivers request the mailbox before
devm_rproc_add(), so a crash queued during probe is never cancelled
if probe then fails. In IPC-only mode the crash work can itself
cause the failure, by setting RPROC_CRASHED before rproc_validate()
runs. A crash the core sent before Linux probed is enough, since it
waits in the mailbox until the channel is opened.

For v3 I report the crash only when the core is RPROC_RUNNING, and keep
the log line otherwise:

case RP_MBOX_CRASH:
if (rproc->state == RPROC_RUNNING)
rproc_report_crash(rproc, RPROC_FATAL_ERROR);
else
dev_err(dev, "K3 rproc %s crashed\n", rproc->name);
break;

An IPC-only core is never RPROC_RUNNING, and no core is before
devm_rproc_add(). A core that Linux booted takes the same path as in
v2, so your stress test still covers it. Patch 2 is unchanged.

Recovering an IPC-only core needs the core to handle a crashed attached
core, for instance as RPROC_FEAT_ATTACH_ON_RECOVERY does. I would leave
that for a separate series.

The review also points at an unbalanced put_device() in
k3_rproc_unprepare(). I think that one is older than this series:
stopping an attached M4F or DSP through sysfs reaches it with no crash
at all. I will check it on a board and send it separately.

v3 builds with W=1 and checkpatch is clean. I will post it once your
stress test is done, unless you would rather have it now.

Regards,
Chrispine