Skip to content

Commit 718be4a

Browse files
committed
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>
1 parent f4b23cc commit 718be4a

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎arch/x86/kernel/acpi/cstate.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
145145
percpu_entry->states[cx->index].eax = cx->address;
146146
percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
147147
}
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+
148157
return retval;
149158
}
150159
EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);

‎drivers/acpi/processor_idle.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
947947
if (acpi_idle_suspend)
948948
return(acpi_idle_enter_c1(dev, state));
949949

950-
if (acpi_idle_bm_check()) {
950+
if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
951951
if (dev->safe_state) {
952952
dev->last_state = dev->safe_state;
953953
return dev->safe_state->enter(dev, dev->safe_state);

‎include/acpi/processor.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct acpi_power_register {
4848
u8 space_id;
4949
u8 bit_width;
5050
u8 bit_offset;
51-
u8 reserved;
51+
u8 access_size;
5252
u64 address;
5353
} __attribute__ ((packed));
5454

@@ -63,6 +63,7 @@ struct acpi_processor_cx {
6363
u32 power;
6464
u32 usage;
6565
u64 time;
66+
u8 bm_sts_skip;
6667
char desc[ACPI_CX_DESC_LEN];
6768
};
6869

0 commit comments

Comments
 (0)