mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fabricio Akio via B4 Relay <devnull+fabricioakio.gmail.com@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>,
	 Konrad Dybcio <konradybcio@kernel.org>,
	Abel Vesa <abelvesa@kernel.org>,
	 Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>,
	 Chris Lew <chris.lew@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Fabricio Akio <fabricioakio@gmail.com>
Subject: [PATCH] soc: qcom: smp2p: Reset the last values only when the remote restarted
Date: Wed, 25 Nov 2026 23:50:23 -0300	[thread overview]
Message-ID: <20261125-smp2p-ssr-reset-v1-1-ed442ed77950@gmail.com> (raw)

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>



                 reply	other threads:[~2026-11-26  2:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261125-smp2p-ssr-reset-v1-1-ed442ed77950@gmail.com \
    --to=devnull+fabricioakio.gmail.com@kernel.org \
    --cc=abelvesa@kernel.org \
    --cc=andersson@kernel.org \
    --cc=chris.lew@oss.qualcomm.com \
    --cc=deepak.singh@oss.qualcomm.com \
    --cc=fabricioakio@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®