The patch titled cpufreq: initialise default governor before use has been removed from the -mm tree. Its filename was cpufreq-initialise-default-governor-before-use.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ Subject: cpufreq: initialise default governor before use From: Johannes Weiner <hannes@xxxxxxxxxxxx> When the cpufreq driver starts up at boot time, it calls into the default governor which might not be initialised yet. This hurts when the governor's worker function relies on memory that is not yet set up by its init function. This migrates all governors from module_init() to fs_initcall() when being the default, as was already done in cpufreq_performance when it was the only possible choice. Fixes at least one actual oops where ondemand is the default governor and cpufreq_governor_dbs() uses the uninitialised kondemand_wq work-queue during boot-time. Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxxx> Cc: Dave Jones <davej@xxxxxxxxxxxxxxxxx> Cc: Michael Tokarev <mjt@xxxxxxxxxx> Cc: "Rafael J. Wysocki" <rjw@xxxxxxx> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/cpufreq/cpufreq_conservative.c | 4 ++++ drivers/cpufreq/cpufreq_ondemand.c | 5 ++++- drivers/cpufreq/cpufreq_performance.c | 4 ++++ drivers/cpufreq/cpufreq_userspace.c | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff -puN drivers/cpufreq/cpufreq_conservative.c~cpufreq-initialise-default-governor-before-use drivers/cpufreq/cpufreq_conservative.c --- a/drivers/cpufreq/cpufreq_conservative.c~cpufreq-initialise-default-governor-before-use +++ a/drivers/cpufreq/cpufreq_conservative.c @@ -603,5 +603,9 @@ MODULE_DESCRIPTION ("'cpufreq_conservati "optimised for use in a battery environment"); MODULE_LICENSE ("GPL"); +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE +fs_initcall(cpufreq_gov_dbs_init); +#else module_init(cpufreq_gov_dbs_init); +#endif module_exit(cpufreq_gov_dbs_exit); diff -puN drivers/cpufreq/cpufreq_ondemand.c~cpufreq-initialise-default-governor-before-use drivers/cpufreq/cpufreq_ondemand.c --- a/drivers/cpufreq/cpufreq_ondemand.c~cpufreq-initialise-default-governor-before-use +++ a/drivers/cpufreq/cpufreq_ondemand.c @@ -610,6 +610,9 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - "Low Latency Frequency Transition capable processors"); MODULE_LICENSE("GPL"); +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND +fs_initcall(cpufreq_gov_dbs_init); +#else module_init(cpufreq_gov_dbs_init); +#endif module_exit(cpufreq_gov_dbs_exit); - diff -puN drivers/cpufreq/cpufreq_performance.c~cpufreq-initialise-default-governor-before-use drivers/cpufreq/cpufreq_performance.c --- a/drivers/cpufreq/cpufreq_performance.c~cpufreq-initialise-default-governor-before-use +++ a/drivers/cpufreq/cpufreq_performance.c @@ -60,5 +60,9 @@ MODULE_AUTHOR("Dominik Brodowski <linux@ MODULE_DESCRIPTION("CPUfreq policy governor 'performance'"); MODULE_LICENSE("GPL"); +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE fs_initcall(cpufreq_gov_performance_init); +#else +module_init(cpufreq_gov_performance_init); +#endif module_exit(cpufreq_gov_performance_exit); diff -puN drivers/cpufreq/cpufreq_userspace.c~cpufreq-initialise-default-governor-before-use drivers/cpufreq/cpufreq_userspace.c --- a/drivers/cpufreq/cpufreq_userspace.c~cpufreq-initialise-default-governor-before-use +++ a/drivers/cpufreq/cpufreq_userspace.c @@ -231,5 +231,9 @@ MODULE_AUTHOR ("Dominik Brodowski <linux MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'"); MODULE_LICENSE ("GPL"); +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE fs_initcall(cpufreq_gov_userspace_init); +#else +module_init(cpufreq_gov_userspace_init); +#endif module_exit(cpufreq_gov_userspace_exit); _ Patches currently in -mm which might be from hannes@xxxxxxxxxxxx are cpufreq-initialise-default-governor-before-use.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html