Revert "cpuidle: Make drivers initialize polling state"
Subsystems (5)
PATCH 1/1 Revert "cpuidle: Make drivers initialize polling state"
From: Ville Syrjälä <[email protected]>
This reverts commit 1b39e3f813b4685c7a30ae964d5529a1b0e3a286.
Makes my P3 machine oops somewhere in cpuidle. I suspect CONFIG_ACPI=n may have something to do with this.
--- drivers/acpi/processor_idle.c | 9 +-------- drivers/cpuidle/driver.c | 2 ++ drivers/cpuidle/poll_state.c | 3 +-- drivers/idle/intel_idle.c | 1 - include/linux/cpuidle.h | 4 ++-- 5 files changed, 6 insertions(+), 13 deletions(-)
drivers/acpi/processor_idle.c +1 -8
@@ -842,7 +842,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,static int acpi_processor_setup_cstates (struct acpi_processor *pr) { -int i, count; +int i, count =ACPI_IDLE_STATE_START ;struct acpi_processor_cx *cx;struct cpuidle_state *state;struct cpuidle_driver *drv = &acpi_idle_driver;
@@ -850,13 +850,6 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)if (max_cstate ==0 ) max_cstate =1 ; -if (IS_ENABLED (CONFIG_ARCH_HAS_CPU_RELAX )) { -cpuidle_poll_state_init (drv); - count =1 ; - }else { - count =0 ; - } -for (i =1 ; i <ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { cx = &pr->power.states[i];
drivers/cpuidle/driver.c +2 -0
@@ -216,6 +216,8 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv)on_each_cpu_mask (drv->cpumask, cpuidle_setup_broadcast_timer, (void *)1 ,1 ); +poll_idle_init (drv); +return 0 ; }
drivers/cpuidle/poll_state.c +1 -2
@@ -21,7 +21,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,return index; } -void cpuidle_poll_state_init (struct cpuidle_driver *drv) +void poll_idle_init (struct cpuidle_driver *drv) {struct cpuidle_state *state = &drv->states[0 ];
@@ -34,4 +34,3 @@ void cpuidle_poll_state_init(struct cpuidle_driver *drv) state->disabled = false; state->flags =CPUIDLE_FLAG_POLLING ; } -EXPORT_SYMBOL_GPL (cpuidle_poll_state_init);
drivers/idle/intel_idle.c +0 -1
@@ -1342,7 +1342,6 @@ static void __init intel_idle_cpuidle_driver_init(void)intel_idle_state_table_update (); -cpuidle_poll_state_init (drv); drv->state_count =1 ;for (cstate =0 ; cstate <CPUIDLE_STATE_MAX ; ++cstate) {
include/linux/cpuidle.h +2 -2
@@ -226,9 +226,9 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev,#endif #ifdef CONFIG_ARCH_HAS_CPU_RELAX -void cpuidle_poll_state_init (struct cpuidle_driver *drv); +void poll_idle_init (struct cpuidle_driver *drv);#else -static inline void cpuidle_poll_state_init (struct cpuidle_driver *drv) {} +static void poll_idle_init (struct cpuidle_driver *drv) {}#endif /******************************
Signature · 1 line
2.13.6
Rafael J. Wysocki
maintainerQuoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This reverts commit
1b39e3f813b4685c7a30ae964d5529a1b0e3a286.Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=nmay have something to do with this.
And if you don't do CONFIG_ACPI=n, does it still oops?
Anyway, there are later changes depending on this one, so reverting it won't work in general.
Let me look deeper at this.
Thanks,
Rafael
Rafael J. Wysocki
maintainerQuoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This reverts commit
1b39e3f813b4685c7a30ae964d5529a1b0e3a286.Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=nmay have something to do with this.
Quoted 6 lines
And if you don't do
CONFIG_ACPI=n, does it still oops?Anyway, there are later changes depending on this one, so reverting it won't work in general.
Let me look deeper at this.
What's there in /sys/devices/system/cpu/cpuidle/current_driver on your system with the problematic commit reverted?
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This reverts commit
1b39e3f813b4685c7a30ae964d5529a1b0e3a286.Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=nmay have something to do with this.And if you don't do
CONFIG_ACPI=n, does it still oops?
Don't think I actually tried that. I can give it a whirl tonight.
I think this machine should actually have ACPI, but it inherited the .config from a P2 machine that did not. Apparently I was too lazy to change .config when I swapped in the "new" machine.
Quoted 8 lines
Quoted 5 lines
Anyway, there are later changes depending on this one, so reverting it won't work in general.
Let me look deeper at this.
What's there in
/sys/devices/system/cpu/cpuidle/current_driveron your system with the problematic commit reverted?
# cat /sys/devices/system/cpu/cpuidle/current_driver apm_idle
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 11 lines · CET Ville Syrjälä
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This reverts commit
1b39e3f813b4685c7a30ae964d5529a1b0e3a286.Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=nmay have something to do with this.
Quoted 7 lines
Quoted 1 line
Quoted 1 line
And if you don't do
CONFIG_ACPI=n, does it still oops?Don't think I actually tried that. I can give it a whirl tonight.
I think this machine should actually have ACPI, but it inherited the .config from a P2 machine that did not. Apparently I was too lazy to change .config when I swapped in the "new" machine.
I guess it would work, but never mind.
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Anyway, there are later changes depending on this one, so reverting it won't work in general.
Let me look deeper at this.
What's there in
/sys/devices/system/cpu/cpuidle/current_driveron your system with the problematic commit reverted?# cat /sys/devices/system/cpu/cpuidle/current_driver apm_idle
That is the key bit: I overlooked this little fellow.
Does the below (untested here) help?
--- arch/x86/kernel/apm_32.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/apm_32.c +1 -0
@@ -2389,6 +2389,7 @@ static int __init apm_init(void)if (HZ !=100 ) idle_period = (idle_period *HZ ) /100 ;if (idle_threshold <100 ) { +cpuidle_poll_state_init (&apm_idle_driver);if (!cpuidle_register_driver (&apm_idle_driver))if (cpuidle_register_device (&apm_cpuidle_device))cpuidle_unregister_driver (&apm_idle_driver);
Ville Syrjälä
Tested-byQuoted 47 lines · Rafael J. Wysocki
Quoted 11 lines · CET Ville Syrjälä
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This reverts commit
1b39e3f813b4685c7a30ae964d5529a1b0e3a286.Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=nmay have something to do with this.Quoted 7 lines
Quoted 1 line
Quoted 1 line
And if you don't do
CONFIG_ACPI=n, does it still oops?Don't think I actually tried that. I can give it a whirl tonight.
I think this machine should actually have ACPI, but it inherited the .config from a P2 machine that did not. Apparently I was too lazy to change .config when I swapped in the "new" machine.
I guess it would work, but never mind.
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Anyway, there are later changes depending on this one, so reverting it won't work in general.
Let me look deeper at this.
What's there in
/sys/devices/system/cpu/cpuidle/current_driveron your system with the problematic commit reverted?# cat /sys/devices/system/cpu/cpuidle/current_driver apm_idleThat is the key bit: I overlooked this little fellow.
Does the below (untested here) help?
--- arch/x86/kernel/apm_32.c | 1 + 1 file changed, 1 insertion(+)Index:
linux-pm/arch/x86/kernel/apm_32.c
===================================================================
arch/x86/kernel/apm_32.c static int __init apm_init(void) · line 2395
Quoted 7 lines
arch/x86/kernel/apm_32.c +1
-0@@ -2389,6 +2389,7 @@ static int __init apm_init(void)if (HZ !=100 ) idle_period = (idle_period *HZ ) /100 ;if (idle_threshold <100 ) { +cpuidle_poll_state_init (&apm_idle_driver);if (!cpuidle_register_driver (&apm_idle_driver))if (cpuidle_register_device (&apm_cpuidle_device))cpuidle_unregister_driver (&apm_idle_driver);
Yep, this works. Thanks.
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 58 lines · CET Ville Syrjälä
Quoted 47 lines · Rafael J. Wysocki
Quoted 11 lines · CET Ville Syrjälä
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This reverts commit
1b39e3f813b4685c7a30ae964d5529a1b0e3a286.Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=nmay have something to do with this.Quoted 7 lines
Quoted 1 line
Quoted 1 line
And if you don't do
CONFIG_ACPI=n, does it still oops?Don't think I actually tried that. I can give it a whirl tonight.
I think this machine should actually have ACPI, but it inherited the .config from a P2 machine that did not. Apparently I was too lazy to change .config when I swapped in the "new" machine.
I guess it would work, but never mind.
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Anyway, there are later changes depending on this one, so reverting it won't work in general.
Let me look deeper at this.
What's there in
/sys/devices/system/cpu/cpuidle/current_driveron your system with the problematic commit reverted?# cat /sys/devices/system/cpu/cpuidle/current_driver apm_idleThat is the key bit: I overlooked this little fellow.
Does the below (untested here) help?
--- arch/x86/kernel/apm_32.c | 1 + 1 file changed, 1 insertion(+)Index:
linux-pm/arch/x86/kernel/apm_32.c
===================================================================arch/x86/kernel/apm_32.c static int __init apm_init(void) · line 2395
Quoted 7 lines
arch/x86/kernel/apm_32.c +1
-0@@ -2389,6 +2389,7 @@ static int __init apm_init(void)if (HZ !=100 ) idle_period = (idle_period *HZ ) /100 ;if (idle_threshold <100 ) { +cpuidle_poll_state_init (&apm_idle_driver);if (!cpuidle_register_driver (&apm_idle_driver))if (cpuidle_register_device (&apm_cpuidle_device))cpuidle_unregister_driver (&apm_idle_driver);Yep, this works. Thanks.
Quoted 1 line
Tested-by Ville Syrjälä <[email protected]>
Thanks!
Let me respin it with a changelog/tags etc
PATCH 1/1 x86: PM: Make APM idle driver initialize polling state
In reply to Ville SyrjäläFrom: Rafael J. Wysocki <[email protected]>
Update the APM driver overlooked by commit 1b39e3f813b4 (cpuidle: Make drivers initialize polling state) to initialize the polling state like the other cpuidle drivers modified by that commit to prevent cpuidle from crashing.
--- arch/x86/kernel/apm_32.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/apm_32.c +1 -0
@@ -2389,6 +2389,7 @@ static int __init apm_init(void)if (HZ !=100 ) idle_period = (idle_period *HZ ) /100 ;if (idle_threshold <100 ) { +cpuidle_poll_state_init (&apm_idle_driver);if (!cpuidle_register_driver (&apm_idle_driver))if (cpuidle_register_device (&apm_cpuidle_device))cpuidle_unregister_driver (&apm_idle_driver);
Re: [PATCH] x86: PM: Make APM idle driver initialize polling state
Quoted 11 lines · Rafael J. Wysocki
From: Rafael J. Wysocki <[email protected]>
Update the APM driver overlooked by commit
1b39e3f813b4(cpuidle: Make drivers initialize polling state) to initialize the polling state like the other cpuidle drivers modified by that commit to prevent cpuidle from crashing.Fixes 1b39e3f813b4 (cpuidle: Make drivers initialize polling state)Reported-by Ville Syrjälä <[email protected]>Tested-by Ville Syrjälä <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>
And maybe?
Quoted 17 lines
--- arch/x86/kernel/apm_32.c | 1 + 1 file changed, 1 insertion(+)Index:
linux-pm/arch/x86/kernel/apm_32.c
===================================================================arch/x86/kernel/apm_32.c +1
-0@@ -2389,6 +2389,7 @@ static int __init apm_init(void)if (HZ !=100 ) idle_period = (idle_period *HZ ) /100 ;if (idle_threshold <100 ) { +cpuidle_poll_state_init (&apm_idle_driver);if (!cpuidle_register_driver (&apm_idle_driver))if (cpuidle_register_device (&apm_cpuidle_device))cpuidle_unregister_driver (&apm_idle_driver);
Signature · 2 lines
Ville Syrjälä Intel OTC
Re: [PATCH] x86: PM: Make APM idle driver initialize polling state
Quoted 8 lines · CET Ville Syrjälä
Quoted 7 lines · Rafael J. Wysocki
From: Rafael J. Wysocki <[email protected]>
Update the APM driver overlooked by commit
1b39e3f813b4(cpuidle: Make drivers initialize polling state) to initialize the polling state like the other cpuidle drivers modified by that commit to prevent cpuidle from crashing.
Quoted 8 lines
Quoted 4 lines
Fixes 1b39e3f813b4 (cpuidle: Make drivers initialize polling state)Reported-by Ville Syrjälä <[email protected]>Tested-by Ville Syrjälä <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>And maybe?
Cc <[email protected]> # v4.14+
I add these when applying patches.
Actually, I've queued up the patch with this tag already.
Re: [PATCH] x86: PM: Make APM idle driver initialize polling state
Quoted 14 lines · Rafael J. Wysocki
Quoted 13 lines · CET Ville Syrjälä
Quoted 11 lines · Rafael J. Wysocki
From: Rafael J. Wysocki <[email protected]>
Update the APM driver overlooked by commit
1b39e3f813b4(cpuidle: Make drivers initialize polling state) to initialize the polling state like the other cpuidle drivers modified by that commit to prevent cpuidle from crashing.Fixes 1b39e3f813b4 (cpuidle: Make drivers initialize polling state)Reported-by Ville Syrjälä <[email protected]>Tested-by Ville Syrjälä <[email protected]>Signed-off-by Rafael J. Wysocki <[email protected]>
Quoted 7 lines
Quoted 3 lines
And maybe?
Cc <[email protected]> # v4.14+I add these when applying patches.
Actually, I've queued up the patch with this tag already.
Cool. Thanks.
Signature · 2 lines
Ville Syrjälä Intel OTC
PATCH 1/1 PM: cpuidle: Fix cpuidle_poll_state_init() prototype
In reply to Rafael J. WysockiFrom: Rafael J. Wysocki <[email protected]>
Commit f85942207516 (x86: PM: Make APM idle driver initialize polling state) made apm_init() call cpuidle_poll_state_init(), but that only is defined for CONFIG_CPU_IDLE set, so make the empty stub of it available for CONFIG_CPU_IDLE unset too to fix the resulting build issue.
--- include/linux/cpuidle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/cpuidle.h +1 -1
@@ -225,7 +225,7 @@ static inline void cpuidle_coupled_paral }#endif -#ifdef CONFIG_ARCH_HAS_CPU_RELAX +#if defined(CONFIG_CPU_IDLE ) && defined(CONFIG_ARCH_HAS_CPU_RELAX )void cpuidle_poll_state_init (struct cpuidle_driver *drv);#else static inline void cpuidle_poll_state_init (struct cpuidle_driver *drv) {}