phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Luca Weiss <luca@lucaweiss.eu>
Cc: ~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Sibi Sankar <quic_sibis@quicinc.com>,
	linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] remoteproc: qcom_q6v5_pas: Make single-PD handling more robust
Date: Wed, 29 Jan 2025 09:18:51 +0100	[thread overview]
Message-ID: <Z5nka5pi-e3Jcrbg@linaro.org> (raw)
In-Reply-To: <20250128-pas-singlepd-v1-2-85d9ae4b0093@lucaweiss.eu>

On Tue, Jan 28, 2025 at 10:54:00PM +0100, Luca Weiss wrote:
> Only go into the if condition for single-PD handling when there's
> actually just one power domain specified there. Otherwise it'll be an
> issue in the dts and we should fail in the regular code path.
> 
> This also mirrors the latest changes in the qcom_q6v5_mss driver.
> 
> Suggested-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> Fixes: 17ee2fb4e856 ("remoteproc: qcom: pas: Vote for active/proxy power domains")
> Signed-off-by: Luca Weiss <luca@lucaweiss.eu>

Not sure if Reviewed-by makes sense if I already did Suggested-by, but
anyway:

Reviewed-by: Stephan Gerhold <stephan.gerhold@linaro.org>

Thanks for making these fixes!

> ---
>  drivers/remoteproc/qcom_q6v5_pas.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index aca44bb6522f00cb525c4b816040445287444434..c1e9bbae61770ccad3e22d132a411bc6ced7180f 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -509,16 +509,16 @@ static int adsp_pds_attach(struct device *dev, struct device **devs,
>  	if (!pd_names)
>  		return 0;
>  
> +	while (pd_names[num_pds])
> +		num_pds++;
> +
>  	/* Handle single power domain */
> -	if (dev->pm_domain) {
> +	if (num_pds == 1 && dev->pm_domain) {
>  		devs[0] = dev;
>  		pm_runtime_enable(dev);
>  		return 1;
>  	}
>  
> -	while (pd_names[num_pds])
> -		num_pds++;
> -
>  	for (i = 0; i < num_pds; i++) {
>  		devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
>  		if (IS_ERR_OR_NULL(devs[i])) {
> @@ -543,7 +543,7 @@ static void adsp_pds_detach(struct qcom_adsp *adsp, struct device **pds,
>  	int i;
>  
>  	/* Handle single power domain */
> -	if (dev->pm_domain && pd_count) {
> +	if (pd_count == 1 && dev->pm_domain) {
>  		pm_runtime_disable(dev);
>  		return;
>  	}
> 
> -- 
> 2.48.1
> 

      reply	other threads:[~2025-01-29  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 21:53 [PATCH 0/2] qcom_q6v5_pas fixes for msm8226 Luca Weiss
2025-01-28 21:53 ` [PATCH 1/2] remoteproc: qcom_q6v5_pas: Use resource with CX PD for MSM8226 Luca Weiss
2025-01-29  8:17   ` Stephan Gerhold
2025-01-28 21:54 ` [PATCH 2/2] remoteproc: qcom_q6v5_pas: Make single-PD handling more robust Luca Weiss
2025-01-29  8:18   ` Stephan Gerhold [this message]

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=Z5nka5pi-e3Jcrbg@linaro.org \
    --to=stephan.gerhold@linaro.org \
    --cc=andersson@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=luca@lucaweiss.eu \
    --cc=mathieu.poirier@linaro.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=quic_sibis@quicinc.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).