From: Bartlomiej Zolnierkiewicz Date: Fri, 20 Dec 2013 18:47:26 +0000 (+0100) Subject: ACPI / cpuidle: fix max idle state handling with hotplug CPU support X-Git-Tag: v3.14-rc1~107^2~5^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ca380f60626d90cdd17cc60de5e756422e35b2a;p=pandora-kernel.git ACPI / cpuidle: fix max idle state handling with hotplug CPU support acpi_processor_hotplug() calls acpi_processor_setup_cpuidle_cx() without calling acpi_processor_setup_cpuidle_states() first so it is possible that dev->state_count becomes different from drv->state_count (in case of SMP system with unsupported C2/C3 states + enabled CPU hotplug and num_online_cpus() becoming > 1). The driver code assumes that cpuidle core will handle such cases but currently this is untrue (dev->state_count is used only for handling cpuidle state sysfs entries and drv->state_count is used for all other cases) and will not be fixed in the future as dev->state_count is planned to be removed. Fix the issue by checking for the max supported idle state in C2/C3 state's ->enter handler (acpi_idle_enter_simple() for C2/C3 and acpi_idle_enter_bm() for C3 + bm_check flag set) and setting the C1 state (instead of higher states) when needed. Also remove no longer needed max idle state checks from acpi_processor_setup_cpuidle_[states,cx](). Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Kyungmin Park Cc: Len Brown Signed-off-by: Rafael J. Wysocki --- Reading git-diff-tree failed