From: Kevin Tian Date: Wed, 19 Oct 2011 08:47:51 +0000 (+0800) Subject: ACPI: processor: Don't setup cpu idle handler when we do not want them. X-Git-Tag: v2.6.39-400.9.0~830^2~1^2~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=515e17174c93ad80ef9308823e8cd1b6168512eb;p=users%2Fjedix%2Flinux-maple.git ACPI: processor: Don't setup cpu idle handler when we do not want them. This patch inhibits processing of the CPU idle handler if it is not set to the appropiate one. This is needed by the Xen processor driver which, while still needing processor details, wants to use the default_idle call (which makes a yield hypercall). Signed-off-by: Yu Ke Signed-off-by: Tian Kevin Signed-off-by: Tang Liang Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 431ab11c8c1b6..bf4e6719968c1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1077,7 +1077,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) cpuidle_pause_and_lock(); cpuidle_disable_device(&pr->power.dev); acpi_processor_get_power_info(pr); - if (pr->flags.power) { + if (pr->flags.power && (cpuidle_get_driver() == &acpi_idle_driver)) { acpi_processor_setup_cpuidle(pr); ret = cpuidle_enable_device(&pr->power.dev); } @@ -1125,7 +1125,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, * Note that we use previously set idle handler will be used on * platforms that only support C1. */ - if (pr->flags.power) { + if (pr->flags.power && (cpuidle_get_driver() == &acpi_idle_driver)) { acpi_processor_setup_cpuidle(pr); if (cpuidle_register_device(&pr->power.dev)) return -EIO;