]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
remoteproc: qcom: q6v5: Avoid disabling handover IRQ twice
authorStephan Gerhold <stephan.gerhold@linaro.org>
Wed, 20 Aug 2025 16:02:33 +0000 (18:02 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 22 Sep 2025 13:33:01 +0000 (08:33 -0500)
enable_irq() and disable_irq() are reference counted, so we must make sure
that each enable_irq() is always paired with a single disable_irq(). If we
call disable_irq() twice followed by just a single enable_irq(), the IRQ
will remain disabled forever.

For the error handling path in qcom_q6v5_wait_for_start(), disable_irq()
will end up being called twice, because disable_irq() also happens in
qcom_q6v5_unprepare() when rolling back the call to qcom_q6v5_prepare().

Fix this by dropping disable_irq() in qcom_q6v5_wait_for_start(). Since
qcom_q6v5_prepare() is the function that calls enable_irq(), it makes more
sense to have the rollback handled always by qcom_q6v5_unprepare().

Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource handling")
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-1-910b1a3aff71@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/remoteproc/qcom_q6v5.c

index 4ee5e67a9f03f5f766f04396b9a3e45f77293764..769c6d6d6a731672eca9f960b05c68f6d4d77af2 100644 (file)
@@ -156,9 +156,6 @@ int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout)
        int ret;
 
        ret = wait_for_completion_timeout(&q6v5->start_done, timeout);
-       if (!ret)
-               disable_irq(q6v5->handover_irq);
-
        return !ret ? -ETIMEDOUT : 0;
 }
 EXPORT_SYMBOL_GPL(qcom_q6v5_wait_for_start);