From 6915719b36a97d28fab576c6fa2a20364b435fe6 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Thu, 17 Jan 2008 15:21:08 -0800 Subject: cpufreq: Initialise default governor before use 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. The performance governor is always initialized early because it might be used as fallback even when not being the default. 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 Cc: Dave Jones Cc: "Rafael J. Wysocki" Cc: Venkatesh Pallipadi Acked-by: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/cpufreq/cpufreq_userspace.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/cpufreq/cpufreq_userspace.c') diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index 51bedab6c808..f8cdde4bf6cd 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c @@ -231,5 +231,9 @@ MODULE_AUTHOR ("Dominik Brodowski , Russell King