linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thara Gopinath <thara.gopinath@linaro.org>
To: Stephen Boyd <swboyd@chromium.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: qcom-hw: Use optional irq API
Date: Wed, 17 Nov 2021 21:55:17 -0500	[thread overview]
Message-ID: <76b103ec-7034-e6c1-1ab4-174cf16f9fc8@linaro.org> (raw)
In-Reply-To: <20211117020346.4088302-1-swboyd@chromium.org>

Hello Stephen,

Thanks for the patch

On 11/16/21 9:03 PM, Stephen Boyd wrote:
> Use platform_get_irq_optional() to avoid a noisy error message when the
> irq isn't specified. The irq is definitely optional given that we only
> care about errors that are -EPROBE_DEFER here.
> 
> Cc: Thara Gopinath <thara.gopinath@linaro.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
>   drivers/cpufreq/qcom-cpufreq-hw.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index a2be0df7e174..b442d4983a22 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -382,9 +382,11 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)
>   	 * Look for LMh interrupt. If no interrupt line is specified /
>   	 * if there is an error, allow cpufreq to be enabled as usual.
>   	 */
> -	data->throttle_irq = platform_get_irq(pdev, index);
> -	if (data->throttle_irq <= 0)
> -		return data->throttle_irq == -EPROBE_DEFER ? -EPROBE_DEFER : 0;
> +	data->throttle_irq = platform_get_irq_optional(pdev, index);
> +	if (data->throttle_irq == -ENXIO)
> +		return 0;
> +	if (data->throttle_irq < 0)
> +		return data->throttle_irq;

Here the idea is to return only -EPROBE_DEFER error. Else return a 0 , 
so that cpufreq is enabled even if lmh interrupt is inaccessible. The 
above check returns errors other than -EPROBE_DEFER as well. So I would 
say make irq optional and keep the below check

if (data->throttle_irq <= 0)
	return data->throttle_irq == -EPROBE_DEFER ? -EPROBE_DEFER : 0;

>   
>   	data->cancel_throttle = false;
>   	data->policy = policy;
> 
> base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
> 

-- 
Warm Regards
Thara (She/Her/Hers)

  reply	other threads:[~2021-11-18  2:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  2:03 [PATCH] cpufreq: qcom-hw: Use optional irq API Stephen Boyd
2021-11-18  2:55 ` Thara Gopinath [this message]
2021-11-18  4:32   ` Stephen Boyd
2021-11-18 14:08     ` Thara Gopinath
2021-11-19  0:57       ` Stephen Boyd
2021-12-03  4:47 ` Viresh Kumar
2021-12-25 16:37   ` Andy Shevchenko

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=76b103ec-7034-e6c1-1ab4-174cf16f9fc8@linaro.org \
    --to=thara.gopinath@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=swboyd@chromium.org \
    --cc=viresh.kumar@linaro.org \
    /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).