diff options
author | Len Brown <len.brown@intel.com> | 2010-07-22 16:54:27 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-07-22 16:54:27 -0400 |
commit | 718be4aaf3613cf7c2d097f925abc3d3553c0605 (patch) | |
tree | feaf57a034684a6742198a5cf10e8e05ed1cb10f | |
parent | f4b23cc2d5dc78ef5acbc529eb1219cc41eb5b96 (diff) |
ACPI: skip checking BM_STS if the BIOS doesn't ask for it
It turns out that there is a bit in the _CST for Intel FFH C3
that tells the OS if we should be checking BM_STS or not.
Linux has been unconditionally checking BM_STS.
If the chip-set is configured to enable BM_STS,
it can retard or completely prevent entry into
deep C-states -- as illustrated by turbostat:
http://userweb.kernel.org/~lenb/acpi/utils/pmtools/turbostat/
ref: Intel Processor Vendor-Specific ACPI Interface Specification
table 4 "_CST FFH GAS Field Encoding"
Bit 1: Set to 1 if OSPM should use Bus Master avoidance for this C-state
https://bugzilla.kernel.org/show_bug.cgi?id=15886
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | arch/x86/kernel/acpi/cstate.c | 9 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 2 | ||||
-rw-r--r-- | include/acpi/processor.h | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 2e837f5080fe..fb7a5f052e2b 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, | |||
145 | percpu_entry->states[cx->index].eax = cx->address; | 145 | percpu_entry->states[cx->index].eax = cx->address; |
146 | percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; | 146 | percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; |
147 | } | 147 | } |
148 | |||
149 | /* | ||
150 | * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, | ||
151 | * then we should skip checking BM_STS for this C-state. | ||
152 | * ref: "Intel Processor Vendor-Specific ACPI Interface Specification" | ||
153 | */ | ||
154 | if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2)) | ||
155 | cx->bm_sts_skip = 1; | ||
156 | |||
148 | return retval; | 157 | return retval; |
149 | } | 158 | } |
150 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); | 159 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index b1b385692f46..b351342f1faf 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -947,7 +947,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
947 | if (acpi_idle_suspend) | 947 | if (acpi_idle_suspend) |
948 | return(acpi_idle_enter_c1(dev, state)); | 948 | return(acpi_idle_enter_c1(dev, state)); |
949 | 949 | ||
950 | if (acpi_idle_bm_check()) { | 950 | if (!cx->bm_sts_skip && acpi_idle_bm_check()) { |
951 | if (dev->safe_state) { | 951 | if (dev->safe_state) { |
952 | dev->last_state = dev->safe_state; | 952 | dev->last_state = dev->safe_state; |
953 | return dev->safe_state->enter(dev, dev->safe_state); | 953 | return dev->safe_state->enter(dev, dev->safe_state); |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index da565a48240e..a68ca8a11a53 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -48,7 +48,7 @@ struct acpi_power_register { | |||
48 | u8 space_id; | 48 | u8 space_id; |
49 | u8 bit_width; | 49 | u8 bit_width; |
50 | u8 bit_offset; | 50 | u8 bit_offset; |
51 | u8 reserved; | 51 | u8 access_size; |
52 | u64 address; | 52 | u64 address; |
53 | } __attribute__ ((packed)); | 53 | } __attribute__ ((packed)); |
54 | 54 | ||
@@ -63,6 +63,7 @@ struct acpi_processor_cx { | |||
63 | u32 power; | 63 | u32 power; |
64 | u32 usage; | 64 | u32 usage; |
65 | u64 time; | 65 | u64 time; |
66 | u8 bm_sts_skip; | ||
66 | char desc[ACPI_CX_DESC_LEN]; | 67 | char desc[ACPI_CX_DESC_LEN]; |
67 | }; | 68 | }; |
68 | 69 | ||