All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	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: Re: [PATCH 1/3] remoteproc: qcom_q6v5: Avoid disabling handover IRQ twice
Date: Tue, 19 Aug 2025 16:55:09 +0200	[thread overview]
Message-ID: <aKSQTc5u5AePWVwj@linaro.org> (raw)
In-Reply-To: <czaabkgp3aerp7fntqnpwgilipnum5vmdwwrkem5mugcs7vvd3@q2mwq6ijfbmt>

On Tue, Aug 19, 2025 at 02:44:26PM +0300, Dmitry Baryshkov wrote:
> On Tue, Aug 19, 2025 at 01:08:02PM +0200, Stephan Gerhold wrote:
> > 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")
> 
> Didn't earlier versions also have the same behaviour?
> 

I don't think so. The "extracted common resource handling" came from
qcom_q6v5_pil.c, but q6v5_start() just had most of this code inline in a
single function [1]. The handling of enable_irq()/disable_irq() through
the goto labels looks correct there.

Thanks,
Stephan

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/remoteproc/qcom_q6v5_pil.c?id=0e622e80191e75c99b6ecc265c140a37d81e7a63#n795

  reply	other threads:[~2025-08-19 14:55 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 [this message]
2025-08-19 18:37       ` Dmitry Baryshkov
2025-08-19 11:08 ` [PATCH 2/3] remoteproc: qcom_q6v5: Avoid handling handover twice Stephan Gerhold
2025-08-19 11:41   ` 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=aKSQTc5u5AePWVwj@linaro.org \
    --to=stephan.gerhold@linaro.org \
    --cc=abel.vesa@linaro.org \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.