From: Neil Armstrong <neil.armstrong@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Konrad Dybcio <konrad.dybcio@somainline.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Cc: linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
"v5 . 18+" <stable@vger.kernel.org>,
kernel test robot <lkp@intel.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning
Date: Wed, 21 Sep 2022 09:14:00 +0200 [thread overview]
Message-ID: <18097f21-0c19-926a-2242-0aed1fb229b5@linaro.org> (raw)
In-Reply-To: <8342b10a2716ec267ab89ea827f851b78b68470a.1663744088.git.viresh.kumar@linaro.org>
On 21/09/2022 09:10, Viresh Kumar wrote:
> Commit 6240aaad75e1 was supposed to drop the reference count to the OPP,
> instead it avoided more stuff if the OPP isn't found. This isn't
> entirely correct. We already have a frequency value available, we just
> couldn't align it with an OPP in case of IS_ERR(opp).
>
> Lets continue with updating thermal pressure, etc, even if we aren't
> able to find an OPP here.
>
> This fixes warning generated by the 'smatch' tool.
>
> Fixes: 6240aaad75e1 ("cpufreq: qcom-hw: fix the opp entries refcounting")
> Cc: v5.18+ <stable@vger.kernel.org> # v5.18+
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index d5ef3c66c762..bb32659820ce 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -316,14 +316,14 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
> if (IS_ERR(opp)) {
> dev_warn(dev, "Can't find the OPP for throttling: %pe!\n", opp);
> } else {
> - throttled_freq = freq_hz / HZ_PER_KHZ;
> -
> - /* Update thermal pressure (the boost frequencies are accepted) */
> - arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
> -
> dev_pm_opp_put(opp);
> }
>
> + throttled_freq = freq_hz / HZ_PER_KHZ;
> +
> + /* Update thermal pressure (the boost frequencies are accepted) */
> + arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
> +
> /*
> * In the unlikely case policy is unregistered do not enable
> * polling or h/w interrupt
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
prev parent reply other threads:[~2022-09-21 7:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 7:10 [PATCH] cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning Viresh Kumar
2022-09-21 7:14 ` Neil Armstrong [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=18097f21-0c19-926a-2242-0aed1fb229b5@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=dan.carpenter@oracle.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vladimir.zapolskiy@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