Re: [PATCH] remoteproc: qcom: pas: Request stop before tearing down GLINK and SMD
From: Val Packett
Date: Mon Nov 09 2026 - 16:43:02 EST
Hi,
On 11/9/26 2:57 PM, Jure Rebernik wrote:
A crash of the ADSP that the host reports, for example through the
remoteproc debugfs crash file, can reset the whole SoC on QCS8550
instead of restarting the ADSP. The reset was most frequent shortly
after the ADSP had started: on two QCS8550-based boards, crashing it
about 4.5 seconds after it was started reset the SoC in 19 of 42
tries. The serial console showed that the system stopped right after
the recovery started. Nothing more was logged, and the SoC was reset 6
to 7 seconds later.
I've been seeing crashes in sensorspd like
qcom_q6v5_pas 3700000.remoteproc: fatal error received: EX:kernel:0x1:SNS_SEE_I_0:0x10000025:PC=0xf00280b8:LR=0xf001f>
on a Kodiak device (sm7325-motorola-dubai) also cause a whole-SoC reset right after logging that, when trying to restart the ADSP.
Those are somewhat random and not too frequent, like once every couple days.
I'll test this patch and see if I no longer end up with my phone randomly showing the u-boot menu when I pull it out of my pocket :D
Since commit 0ea50486978f ("remoteproc: qcom: q6v5: Request shutdown ifTry not to provide the free advertisement right in the commit msg btw, and to make it sliiightly less verbose.
crash is triggered host-side"), qcom_q6v5_request_stop() also sets the
SMP2P stop bit for a crash that the host reports, so that the firmware
takes part in its shutdown. The stop is requested from qcom_pas_stop(),
which rproc_stop() calls only after all subdevices have stopped. By
then the GLINK and SMD edges to the DSP have been unregistered and
their client devices, such as FastRPC, torn down. On QCS8550 the ADSP
firmware treats the stop bit as a fatal error and runs its error
handler after these links have gone away.
Add a subdevice whose .stop callback requests the stop, and add it
before sysmon. Subdevices stop in the reverse order of addition, so the
callback runs after the SSR BEFORE_SHUTDOWN notification and
sysmon_stop(), and before SMD and GLINK are torn down. The firmware
then handles the stop request while its GLINK and SMD edges are still
registered. qcom_q6v5_request_stop() still skips the request when
sysmon got a shutdown ack, or when the firmware reported the crash
itself and the fatal or watchdog interrupt has cleared the running
flag. It also clears the running flag, so the call in qcom_pas_stop()
now only sends a request when the subdevices were not started.
With this change, none of 104 host-reported crashes on the same boards
reset the SoC: 40 ADSP crashes at 4.5 seconds, 20 at 4 to 15 seconds,
20 while the ADSP was streaming IMU sensor data and 24 CDSP crashes.
The ADSP or CDSP restarted each time.
The problem was found, and this change was written and tested, with
the help of an AI coding assistant (Claude Code, by Anthropic). I
reviewed the change and the test results.
[..]
+ * Subdevices stop in the reverse order of addition. Request the stop
+ * after sysmon has asked for a graceful shutdown and before smd and
+ * glink are torn down.
+ */
+ pas->stop_subdev.stop = qcom_pas_stop_subdev;
+ rproc_add_subdev(rproc, &pas->stop_subdev);
+
[..]
It looks a bit funny that "stop is a device" but well, it's not like I can think of a more elegant solution…
Thanks,
~val