aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2014-02-14 01:14:13 -0500
committerLen Brown <len.brown@intel.com>2014-02-19 17:33:18 -0500
commit2194324d8bbbad1b179c08b6095649b06abd62d5 (patch)
treeba4ecb67ef1acf13b2426356d0abe1db5f52188a /arch
parentb28a960c42fcd9cfc987441fa6d1c1a471f0f9ed (diff)
ACPI idle: permit sparse C-state sub-state numbers
Linux uses CPUID.MWAIT.EDX to validate the C-states reported by ACPI, silently discarding states which are not supported by the HW. This test is too restrictive, as some HW now uses sparse sub-state numbering, so the sub-state number may be higher than the number of sub-states... Also, rather than silently ignoring an invalid state, we should complain about a firmware bug. In practice... Bay Trail systems originally supported C6-no-shrink as MWAIT sub-state 0x58, and in CPUID.MWAIT.EDX 0x03000000 indicated that there were 3 MWAIT-C6 sub-states. So acpi_idle would discard that C-state because 8 >= 3. Upon discovering this issue, the ucode was updated so that C6-no-shrink was also exported as 0x51, and the BIOS was updated to match. However, systems shipped with 0x58, will never get a BIOS update, and this patch allows Linux to see C6-no-shrink on early Bay Trail. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/acpi/cstate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index e69182fd01cf..4b28159e0421 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -87,7 +87,9 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx)
87 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; 87 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
88 88
89 retval = 0; 89 retval = 0;
90 if (num_cstate_subtype < (cx->address & MWAIT_SUBSTATE_MASK)) { 90 /* If the HW does not support any sub-states in this C-state */
91 if (num_cstate_subtype == 0) {
92 pr_warn(FW_BUG "ACPI MWAIT C-state 0x%x not supported by HW (0x%x)\n", cx->address, edx_part);
91 retval = -1; 93 retval = -1;
92 goto out; 94 goto out;
93 } 95 }