[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200629095527.GA1232873@google.com>
Date: Mon, 29 Jun 2020 10:55:27 +0100
From: Quentin Perret <qperret@...gle.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Rafael Wysocki <rjw@...ysocki.net>,
Jonathan Corbet <corbet@....net>, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
kernel-team@...roid.com, tkjos@...gle.com, adharmap@...eaurora.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V4 3/3] cpufreq: Specify default governor on command line
On Monday 29 Jun 2020 at 15:24:23 (+0530), Viresh Kumar wrote:
> On 29-06-20, 10:50, Quentin Perret wrote:
> > On Monday 29 Jun 2020 at 10:48:25 (+0100), Quentin Perret wrote:
> > > On Monday 29 Jun 2020 at 15:16:27 (+0530), Viresh Kumar wrote:
> > > > On 29-06-20, 10:44, Quentin Perret wrote:
> > > > > On Monday 29 Jun 2020 at 13:55:00 (+0530), Viresh Kumar wrote:
> > > > > > static int __init cpufreq_core_init(void)
> > > > > > {
> > > > > > + struct cpufreq_governor *gov = cpufreq_default_governor();
> > > > > > +
> > > > > > if (cpufreq_disabled())
> > > > > > return -ENODEV;
> > > > > >
> > > > > > cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
> > > > > > BUG_ON(!cpufreq_global_kobject);
> > > > > >
> > > > > > + if (!strlen(default_governor))
> > > > >
> > > > > Should we test '!strlen(default_governor) && gov' here actually?
> > > > > We check the return value of cpufreq_default_governor() in
> > > > > cpufreq_init_policy(), so I'm guessing we should do the same here to be
> > > > > on the safe side.
> > > >
> > > > With the current setup (the Kconfig option being a choice which
> > > > selects one governor at least), it is not possible for gov to be NULL
> > > > here. And so I didn't worry about it :)
> > >
> > > Right, so should we remove the check in cpufreq_init_policy() then?
> > > I don't mind either way as long as we are consitent :)
> >
> > And actually maybe we should remove the weakly defined
> > cpufreq_default_governor() implementation too? That'd make sure we get a
> > link-time error if for some reason things change in the Kconfig options.
>
> That would be fine I believe. I will do all that in a separate patch
> then and let this series go through with no more changes :)
OK, that works for me.
Thanks!
Quentin
Powered by blists - more mailing lists