mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: smp2p: Reset the last values only when the remote restarted
@ 2026-11-26  2:50 Fabricio Akio via B4 Relay
  0 siblings, 0 replies; only message in thread
From: Fabricio Akio via B4 Relay @ 2026-11-26  2:50 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Deepak Kumar Singh, Chris Lew
  Cc: linux-arm-msm, linux-kernel, Fabricio Akio

From: Fabricio Akio <fabricioakio@gmail.com>

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")
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
---
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/20250923-smp2p-v1-2-2c045af73dac@oss.qualcomm.com
https://lore.kernel.org/r/20251103152929.2434911-3-deepak.singh@oss.qualcomm.com
https://lore.kernel.org/r/20260127-smp2pv2-v3-2-4060b859b1e2@oss.qualcomm.com

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(-)

diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
index cf06a49149be..d7f7345104e0 100644
--- a/drivers/soc/qcom/smp2p.c
+++ b/drivers/soc/qcom/smp2p.c
@@ -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,
--  
Fabricio Akio <fabricioakio@gmail.com>



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-26  2:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26  2:50 [PATCH] soc: qcom: smp2p: Reset the last values only when the remote restarted Fabricio Akio via B4 Relay

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

all inboxes | Powered by JetHome®