linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>,
	 Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Sibi Sankar <quic_sibis@quicinc.com>,
	Abel Vesa <abel.vesa@linaro.org>,
	 linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Konrad Dybcio <konradybcio@kernel.org>
Subject: [PATCH 2/3] remoteproc: qcom_q6v5: Avoid handling handover twice
Date: Tue, 19 Aug 2025 13:08:03 +0200	[thread overview]
Message-ID: <20250819-rproc-qcom-q6v5-fixes-v1-2-de92198f23c7@linaro.org> (raw)
In-Reply-To: <20250819-rproc-qcom-q6v5-fixes-v1-0-de92198f23c7@linaro.org>

A remoteproc could theoretically signal handover twice. This is unexpected
and would break the reference counting for the handover resources (power
domains, clocks, regulators, etc), so add a check to prevent that from
happening.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
 drivers/remoteproc/qcom_q6v5.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
index 769c6d6d6a731672eca9f960b05c68f6d4d77af2..58d5b85e58cdadabdd3e23d39c06a39196c3a194 100644
--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -164,6 +164,11 @@ static irqreturn_t q6v5_handover_interrupt(int irq, void *data)
 {
 	struct qcom_q6v5 *q6v5 = data;
 
+	if (q6v5->handover_issued) {
+		dev_err(q6v5->dev, "Handover signaled, but it already happened\n");
+		return IRQ_HANDLED;
+	}
+
 	if (q6v5->handover)
 		q6v5->handover(q6v5);
 

-- 
2.50.1


  parent reply	other threads:[~2025-08-19 11:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19 11:08 [PATCH 0/3] remoteproc: qcom_q6v5: Misc fixes to prepare for reusing the "lite" ADSP FW Stephan Gerhold
2025-08-19 11:08 ` [PATCH 1/3] remoteproc: qcom_q6v5: Avoid disabling handover IRQ twice Stephan Gerhold
2025-08-19 11:44   ` Dmitry Baryshkov
2025-08-19 14:55     ` Stephan Gerhold
2025-08-19 18:37       ` Dmitry Baryshkov
2025-08-19 11:08 ` Stephan Gerhold [this message]
2025-08-19 11:41   ` [PATCH 2/3] remoteproc: qcom_q6v5: Avoid handling handover twice Dmitry Baryshkov
2025-08-19 15:05     ` Stephan Gerhold
2025-08-19 18:37       ` Dmitry Baryshkov
2025-08-19 11:08 ` [PATCH 3/3] remoteproc: qcom_q6v5_pas: Shutdown lite ADSP DTB on X1E Stephan Gerhold
2025-08-19 11:43   ` Dmitry Baryshkov

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=20250819-rproc-qcom-q6v5-fixes-v1-2-de92198f23c7@linaro.org \
    --to=stephan.gerhold@linaro.org \
    --cc=abel.vesa@linaro.org \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=quic_sibis@quicinc.com \
    /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;
as well as URLs for NNTP newsgroup(s).