Skip to content

Commit 31d8514

Browse files
Zhenzhong Duanrafaeljw
authored andcommitted
cpuidle: haltpoll: Take 'idle=' override into account
Currenly haltpoll isn't aware of the 'idle=' override, the priority is 'idle=poll' > haltpoll > 'idle=halt'. When 'idle=poll' is used, cpuidle driver is bypassed but current_driver in sys still shows 'haltpoll'. When 'idle=halt' is used, haltpoll takes precedence and makes 'idle=halt' have no effect. Add a check to prevent the haltpoll driver from loading if 'idle=' is present. Signed-off-by: Zhenzhong Duan <[email protected]> Co-developed-by: Joao Martins <[email protected]> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7d194c2 commit 31d8514

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/cpuidle/cpuidle-haltpoll.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ static int __init haltpoll_init(void)
9595
int ret;
9696
struct cpuidle_driver *drv = &haltpoll_driver;
9797

98+
/* Do not load haltpoll if idle= is passed */
99+
if (boot_option_idle_override != IDLE_NO_OVERRIDE)
100+
return -ENODEV;
101+
98102
cpuidle_poll_state_init(drv);
99103

100104
if (!kvm_para_available() ||

0 commit comments

Comments
 (0)