[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0j=s-RS2oVjPtR0=pAiXHNwvtDih6Jt6dffC4eKh1bBcg@mail.gmail.com>
Date: Sat, 3 Sep 2022 20:09:08 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>,
Xuewen Yan <xuewen.yan@...soc.com>
Cc: Lukasz Luba <lukasz.luba@....com>,
Amit Kachhap <amit.kachhap@...il.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Amit Kucheria <amitk@...nel.org>,
"Zhang, Rui" <rui.zhang@...el.com>,
Linux PM <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
xuewen.yan94@...il.com, Di Shen <di.shen@...soc.com>
Subject: Re: [PATCH] thermal: Check the policy first in cpufreq_cooling_register
On Tue, Aug 30, 2022 at 7:34 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 25-08-22, 19:40, Xuewen Yan wrote:
> > Since the policy needs to be accessed first when obtaining cpu devices,
> > first check whether the policy is legal before this.
> >
> > Signed-off-by: Xuewen Yan <xuewen.yan@...soc.com>
>
> Fixes: 5130802ddbb1 ("thermal: cpu_cooling: Switch to QoS requests for freq limits")
>
> > ---
> > drivers/thermal/cpufreq_cooling.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
> > index b76293cc989c..7838b6e2dba5 100644
> > --- a/drivers/thermal/cpufreq_cooling.c
> > +++ b/drivers/thermal/cpufreq_cooling.c
> > @@ -501,17 +501,17 @@ __cpufreq_cooling_register(struct device_node *np,
> > struct thermal_cooling_device_ops *cooling_ops;
> > char *name;
> >
> > + if (IS_ERR_OR_NULL(policy)) {
> > + pr_err("%s: cpufreq policy isn't valid: %p\n", __func__, policy);
> > + return ERR_PTR(-EINVAL);
> > + }
> > +
> > dev = get_cpu_device(policy->cpu);
> > if (unlikely(!dev)) {
> > pr_warn("No cpu device for cpu %d\n", policy->cpu);
> > return ERR_PTR(-ENODEV);
> > }
> >
> > - if (IS_ERR_OR_NULL(policy)) {
> > - pr_err("%s: cpufreq policy isn't valid: %p\n", __func__, policy);
> > - return ERR_PTR(-EINVAL);
> > - }
> > -
> > i = cpufreq_table_count_valid_entries(policy);
> > if (!i) {
> > pr_debug("%s: CPUFreq table not found or has no valid entries\n",
>
> Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
Applied as 6.1 material, thanks!
Powered by blists - more mailing lists