Re: [PATCH 1/2] cpufreq: Register governors at core_initcall

From: Quentin Perret
Date: Tue Jun 16 2020 - 04:31:36 EST


On Tuesday 16 Jun 2020 at 09:58:31 (+0530), Viresh Kumar wrote:
> On 15-06-20, 17:55, Quentin Perret wrote:
> > Currently, most CPUFreq governors are registered at core_initcall time
> > when used as default, and module_init otherwise. In preparation for
> > letting users specify the default governor on the kernel command line,
> > change all of them to use core_initcall unconditionally, as is already
> > the case for schedutil and performance. This will enable us to assume
> > builtin governors have been registered before the builtin CPUFreq
> > drivers probe.
> >
> > And since all governors now have similar init/exit patterns, introduce
> > two new macros cpufreq_governor_{init,exit}() to factorize the code.
> >
> > Signed-off-by: Quentin Perret <qperret@xxxxxxxxxx>
> > ---
> > Note: I couldn't boot-test the change to spudemand, by lack of hardware.
> > But I can confirm cell_defconfig compiles just fine.
> > ---
> > .../platforms/cell/cpufreq_spudemand.c | 26 ++-----------------
> > drivers/cpufreq/cpufreq_conservative.c | 22 ++++------------
> > drivers/cpufreq/cpufreq_ondemand.c | 24 +++++------------
> > drivers/cpufreq/cpufreq_performance.c | 14 ++--------
> > drivers/cpufreq/cpufreq_powersave.c | 18 +++----------
> > drivers/cpufreq/cpufreq_userspace.c | 18 +++----------
> > include/linux/cpufreq.h | 14 ++++++++++
> > kernel/sched/cpufreq_schedutil.c | 6 +----
> > 8 files changed, 36 insertions(+), 106 deletions(-)
>
> Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

Thanks!
Quentin