aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@saeurebad.de>2008-01-17 18:21:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-17 18:38:58 -0500
commit6915719b36a97d28fab576c6fa2a20364b435fe6 (patch)
tree9c8938f57499b61247cc362677761a899c75b7f0 /drivers
parentd8c89eb3a12f0da96d049bd515c7fa3702e511c5 (diff)
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 <hannes@saeurebad.de> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c4
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c5
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c4
3 files changed, 12 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 1bba99747f5b..5d3a04ba6ad2 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -603,5 +603,9 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
603 "optimised for use in a battery environment"); 603 "optimised for use in a battery environment");
604MODULE_LICENSE ("GPL"); 604MODULE_LICENSE ("GPL");
605 605
606#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
607fs_initcall(cpufreq_gov_dbs_init);
608#else
606module_init(cpufreq_gov_dbs_init); 609module_init(cpufreq_gov_dbs_init);
610#endif
607module_exit(cpufreq_gov_dbs_exit); 611module_exit(cpufreq_gov_dbs_exit);
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 369f44595150..d2af20dda382 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -610,6 +610,9 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
610 "Low Latency Frequency Transition capable processors"); 610 "Low Latency Frequency Transition capable processors");
611MODULE_LICENSE("GPL"); 611MODULE_LICENSE("GPL");
612 612
613#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
614fs_initcall(cpufreq_gov_dbs_init);
615#else
613module_init(cpufreq_gov_dbs_init); 616module_init(cpufreq_gov_dbs_init);
617#endif
614module_exit(cpufreq_gov_dbs_exit); 618module_exit(cpufreq_gov_dbs_exit);
615
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 <linux@brodo.de>, Russell King <rmk@arm.linux.
231MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'"); 231MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'");
232MODULE_LICENSE ("GPL"); 232MODULE_LICENSE ("GPL");
233 233
234#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
234fs_initcall(cpufreq_gov_userspace_init); 235fs_initcall(cpufreq_gov_userspace_init);
236#else
237module_init(cpufreq_gov_userspace_init);
238#endif
235module_exit(cpufreq_gov_userspace_exit); 239module_exit(cpufreq_gov_userspace_exit);