Add a notifier for _CST changing events. It is necessary to unload the processor idle handle for a short period of time to avoid for nasty races -- and we don't want to grab too many locks so that the idle handler continues to be speedy. Signed-off-by: Dominik Brodowski --- drivers/acpi/processor_core.c | 2 +- drivers/acpi/processor_idle.c | 27 +++++++++++++++++++++++++++ include/acpi/processor.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) Index: linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_core.c =================================================================== --- linux-2.6.10-rc3+bk-acpi.orig/drivers/acpi/processor_core.c 2004-12-14 10:02:15.000000000 +0100 +++ linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_core.c 2004-12-14 13:13:36.285377853 +0100 @@ -627,7 +627,7 @@ pr->performance_platform_limit); break; case ACPI_PROCESSOR_NOTIFY_POWER: - /* TBD */ + acpi_processor_cst_has_changed(pr); acpi_bus_generate_event(device, event, 0); break; default: Index: linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_idle.c =================================================================== --- linux-2.6.10-rc3+bk-acpi.orig/drivers/acpi/processor_idle.c 2004-12-14 13:12:57.456854168 +0100 +++ linux-2.6.10-rc3+bk-acpi/drivers/acpi/processor_idle.c 2004-12-14 13:13:36.286377712 +0100 @@ -778,6 +778,32 @@ return_VALUE(0); } +int acpi_processor_cst_has_changed (struct acpi_processor *pr) +{ + int result = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed"); + + if (!pr) + return_VALUE(-EINVAL); + + if (errata.smp) { + return_VALUE(-ENODEV); + } + + /* Fall back to the default idle loop */ + pm_idle = pm_idle_save; + pm_idle_save = NULL; + + pr->flags.power = 0; + result = acpi_processor_get_power_info(pr); + if (pr->flags.power == 1) { + pm_idle_save = pm_idle; + pm_idle = acpi_processor_idle; + } + + return_VALUE(result); +} /* proc interface */ @@ -859,3 +885,4 @@ .llseek = seq_lseek, .release = single_release, }; + Index: linux-2.6.10-rc3+bk-acpi/include/acpi/processor.h =================================================================== --- linux-2.6.10-rc3+bk-acpi.orig/include/acpi/processor.h 2004-12-14 13:12:57.457854027 +0100 +++ linux-2.6.10-rc3+bk-acpi/include/acpi/processor.h 2004-12-14 13:13:36.287377571 +0100 @@ -215,6 +215,7 @@ int acpi_processor_get_power_info (struct acpi_processor *pr); extern struct file_operations acpi_processor_power_fops; int no_c2c3(struct dmi_system_id *id); +int acpi_processor_cst_has_changed (struct acpi_processor *pr); /* in processor_thermal.c */ int acpi_processor_get_limit_info (struct acpi_processor *pr);