[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0ia-kjAboeREyDESxp9f_E_SVdDNj0aU4Xgxjf4-=QGTw@mail.gmail.com>
Date: Thu, 30 Jul 2020 18:25:59 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Amit Kucheria <amitk@...nel.org>,
Rafael Wysocki <rjw@...ysocki.net>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Linux PM list <linux-pm@...r.kernel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Ionela Voinescu <ionela.voinescu@....com>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cpufreq: cached_resolved_idx can not be negative
On Thu, Jul 30, 2020 at 8:41 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 30-07-20, 12:02, Amit Kucheria wrote:
> > Looking at this more closely, I found another call site for
> > cpufreq_frequency_table_target() in cpufreq.c that needs the index to
> > be unsigned int.
> >
> > But then cpufreq_frequency_table_target() returns -EINVAL, so we
>
> It returns -EINVAL only in the case where the relation is not valid,
> which will never happen. Maybe that should be marked with WARN or BUG
> and we should drop return value of -EINVAL.
>
> Rafael ?
Yeah, make it a WARN_ON_ONCE() IMO.
> > should be able to handle int values.
>
> And so no.
>
> > I think you will need to fix the unconditional assignment of
> > policy->cached_resolved_idx = idx
> > in cpufreq_driver_resolve_freq(). It doesn't check for -EINVAL, so the
> > qcom driver is write in checking for a negative value.
>
> Right, I don't want it to have that check for the reason stated above.
>
> The point is I don't want code that verifies cached-idx at all, it is
> useless.
>
> --
> viresh
Powered by blists - more mailing lists