From af8539a8fdc6df60ffe84d61b409b9b21e8795ad Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 21 Dec 2005 04:38:01 -0500 Subject: [PATCH] --- yaml --- r: 15274 b: refs/heads/master c: d8bcd8e41576809f276fa44be5012568296cce41 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/processor_idle.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index bdf4f048524d..9df068625c27 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b05948d9b7167e23af88cc65b9ffa4687eaf1f0d +refs/heads/master: d8bcd8e41576809f276fa44be5012568296cce41 diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 5f51057518b0..807b0df308f1 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -274,8 +274,6 @@ static void acpi_processor_idle(void) } } - cx->usage++; - #ifdef CONFIG_HOTPLUG_CPU /* * Check for P_LVL2_UP flag before entering C2 and above on @@ -283,9 +281,12 @@ static void acpi_processor_idle(void) * detection phase, to work cleanly with logical CPU hotplug. */ if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && - !pr->flags.has_cst && acpi_fadt.plvl2_up) - cx->type = ACPI_STATE_C1; + !pr->flags.has_cst && !acpi_fadt.plvl2_up) + cx = &pr->power.states[ACPI_STATE_C1]; #endif + + cx->usage++; + /* * Sleep: * ------ @@ -386,6 +387,15 @@ static void acpi_processor_idle(void) next_state = pr->power.state; +#ifdef CONFIG_HOTPLUG_CPU + /* Don't do promotion/demotion */ + if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) && + !pr->flags.has_cst && !acpi_fadt.plvl2_up) { + next_state = cx; + goto end; + } +#endif + /* * Promotion? * ---------- @@ -557,7 +567,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) * Check for P_LVL2_UP flag before entering C2 and above on * an SMP system. */ - if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up) + if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) return_VALUE(-ENODEV); #endif