Skip to contentSkip to conversation

soc: qcom: smp2p: Reset the last values only when the remote restarted

PATCH Applied Fabricio Akio 2 participants 2 messages Nov 26 – Dec 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: qcom: smp2p: Reset the last values only when the remote restarted

Once the SSR ack feature is negotiated, qcom_smp2p_check_ssr() clears last_value of every inbound entry on each interrupt. Every bit that is set is then reported as a new rising edge whenever the remote signals
anything: on the SDM630 ADSP, stopping the DSP raises its ready and handover interrupts again.

Clear the values only when a restart of the remote is detected.

Fixes 42c4cf5d4828 ("soc: qcom: smp2p: Add support for smp2p v2")

---
In v1 and v2 of the series that added the reset it ran only when a restart was detected and the remote's version was above 1; v3 dropped both conditions:
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]

Tested on a Motorola Moto X4 (SDM630), whose board file is not in mainline yet, on sdm660-mainline's 7.2 kernel, the same build with and without this patch. Stopping the ADSP:

without: smp2p_notify_in: smp2p-adsp: slave-kernel: status:0x86 val:0x86
with: smp2p_notify_in: smp2p-adsp: slave-kernel: status:0x80 val:0x86

Without it the ready and handover interrupts are counted again, and that kernel, which predates bb7c5d6f5b41 ("remoteproc: qcom: q6v5: Make handover IRQ one-shot"), logs "Handover signaled, but it already happened". With it, every start of the ADSP after a stop or a crash still traces "SSR detected" and raises ready.

The ADSP's smp2p item reports version 1. No version 2 remote was tested:
that such a remote's restart is still detected, so that the reset still runs for it, is taken from the description of 42c4cf5d4828.

---
 drivers/soc/qcom/smp2p.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/qcom/smp2p.c +4 -1
index cf06a49149be..d7f7345104e0 100644
@@ -194,13 +194,16 @@ static bool qcom_smp2p_check_ssr(struct qcom_smp2p *smp2p)
 
 	restart_done = in->flags & BIT(SMP2P_FLAGS_RESTART_DONE_BIT);
 	restart = restart_done != smp2p->ssr_ack;
+	if (!restart)
+		return false;
+
 	list_for_each_entry(entry, &smp2p->inbound, node) {
 		if (!entry->value)
 			continue;
 		entry->last_value = 0;
 	}
 
-	return restart;
+	return true;
 }
 
 static void qcom_smp2p_do_ssr_ack(struct qcom_smp2p *smp2p)

---
base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
change-id: 20261125-smp2p-ssr-reset-6564ba08eb12

Best regards,

Signature · 1 line
Fabricio Akio <[email protected]>
maintainer Applied
#1 lore raw
Quoted 9 lines · Fabricio Akio

Once the SSR ack feature is negotiated, qcom_smp2p_check_ssr() clears last_value of every inbound entry on each interrupt. Every bit that is set is then reported as a new rising edge whenever the remote signals
anything: on the SDM630 ADSP, stopping the DSP raises its ready and handover interrupts again.

Clear the values only when a restart of the remote is detected.

[...]

Applied, thanks!

[1/1] soc: qcom: smp2p: Reset the last values only when the remote restarted

      commit: 954c2b1bbd77ffe4777f664931f65b00a8362b59

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>