Re: [PATCH 2/2] cpufreq: Specify default governor on command line

From: Quentin Perret
Date: Tue Jun 16 2020 - 05:56:54 EST


On Tuesday 16 Jun 2020 at 15:24:38 (+0530), Viresh Kumar wrote:
> On 16-06-20, 10:48, Quentin Perret wrote:
> > ---8<---
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 0f05caedc320..a9219404e07f 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -2340,6 +2340,11 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
> > list_add(&governor->governor_list, &cpufreq_governor_list);
> > }
> >
> > + if (!strncasecmp(cpufreq_param_governor, governor->name, CPUFREQ_NAME_LEN))
> > + default_governor = governor;
> > + else if (!default_governor && cpufreq_default_governor() == governor)
> > + default_governor = cpufreq_default_governor();
>
> Instead of the else part here, maybe just do this from
> cpufreq_core_init() only once, and so we will always have
> default_governor set.

Sounds good.

Thanks!
Quentin