diff options
author | Len Brown <len.brown@intel.com> | 2011-04-02 00:13:10 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-08-04 01:06:36 +0200 |
commit | 62027aea23fcd14478abdddd3b74a4e0f5fb2984 (patch) | |
tree | 1aaa5c1872e296f3448ae6c126175ac9d998e3b4 /drivers/cpuidle/cpuidle.c | |
parent | mrst_pmu: driver for Intel Moorestown Power Management Unit (diff) | |
download | linux-62027aea23fcd14478abdddd3b74a4e0f5fb2984.tar.xz linux-62027aea23fcd14478abdddd3b74a4e0f5fb2984.zip |
cpuidle: create bootparam "cpuidle.off=1"
useful for disabling cpuidle to fall back
to architecture-default idle loop
cpuidle drivers and governors will fail to register.
on x86 they'll say so:
intel_idle: intel_idle yielding to (null)
ACPI: acpi_idle yielding to (null)
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index bf5092455a8f..faae2c357bab 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -28,6 +28,12 @@ LIST_HEAD(cpuidle_detected_devices); static void (*pm_idle_old)(void); static int enabled_devices; +static int off __read_mostly; + +int cpuidle_disabled(void) +{ + return off; +} #if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT) static void cpuidle_kick_cpus(void) @@ -427,6 +433,9 @@ static int __init cpuidle_init(void) { int ret; + if (cpuidle_disabled()) + return -ENODEV; + pm_idle_old = pm_idle; ret = cpuidle_add_class_sysfs(&cpu_sysdev_class); @@ -438,4 +447,5 @@ static int __init cpuidle_init(void) return 0; } +module_param(off, int, 0444); core_initcall(cpuidle_init); |