]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
remoteproc: qcom: q6v5: Avoid handling handover twice
authorStephan Gerhold <stephan.gerhold@linaro.org>
Wed, 20 Aug 2025 16:02:34 +0000 (18:02 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 22 Sep 2025 13:33:06 +0000 (08:33 -0500)
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.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Link: https://lore.kernel.org/r/20250820-rproc-qcom-q6v5-fixes-v2-2-910b1a3aff71@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/remoteproc/qcom_q6v5.c

index 769c6d6d6a731672eca9f960b05c68f6d4d77af2..58d5b85e58cdadabdd3e23d39c06a39196c3a194 100644 (file)
@@ -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);