Commit 62027aea23fcd14478abdddd3b74a4e0f5fb2984
1 parent
6dccf9c508
Exists in
master
and in
20 other branches
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>
Showing 5 changed files with 20 additions and 0 deletions Side-by-side Diff
Documentation/kernel-parameters.txt
... | ... | @@ -546,6 +546,9 @@ |
546 | 546 | /proc/<pid>/coredump_filter. |
547 | 547 | See also Documentation/filesystems/proc.txt. |
548 | 548 | |
549 | + cpuidle.off=1 [CPU_IDLE] | |
550 | + disable the cpuidle sub-system | |
551 | + | |
549 | 552 | cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver |
550 | 553 | Format: |
551 | 554 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] |
drivers/cpuidle/cpuidle.c
... | ... | @@ -28,7 +28,13 @@ |
28 | 28 | static void (*pm_idle_old)(void); |
29 | 29 | |
30 | 30 | static int enabled_devices; |
31 | +static int off __read_mostly; | |
31 | 32 | |
33 | +int cpuidle_disabled(void) | |
34 | +{ | |
35 | + return off; | |
36 | +} | |
37 | + | |
32 | 38 | #if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT) |
33 | 39 | static void cpuidle_kick_cpus(void) |
34 | 40 | { |
... | ... | @@ -427,6 +433,9 @@ |
427 | 433 | { |
428 | 434 | int ret; |
429 | 435 | |
436 | + if (cpuidle_disabled()) | |
437 | + return -ENODEV; | |
438 | + | |
430 | 439 | pm_idle_old = pm_idle; |
431 | 440 | |
432 | 441 | ret = cpuidle_add_class_sysfs(&cpu_sysdev_class); |
... | ... | @@ -438,5 +447,6 @@ |
438 | 447 | return 0; |
439 | 448 | } |
440 | 449 | |
450 | +module_param(off, int, 0444); | |
441 | 451 | core_initcall(cpuidle_init); |
drivers/cpuidle/cpuidle.h
drivers/cpuidle/driver.c
drivers/cpuidle/governor.c