Skip to content

Commit

Permalink
ACPI: skip checking BM_STS if the BIOS doesn't ask for it
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lenb committed Jul 22, 2010
1 parent f4b23cc commit 718be4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions arch/x86/kernel/acpi/cstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
percpu_entry->states[cx->index].eax = cx->address;
percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
}

/*
* For _CST FFH on Intel, if GAS.access_size bit 1 is cleared,
* then we should skip checking BM_STS for this C-state.
* ref: "Intel Processor Vendor-Specific ACPI Interface Specification"
*/
if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2))
cx->bm_sts_skip = 1;

return retval;
}
EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
if (acpi_idle_suspend)
return(acpi_idle_enter_c1(dev, state));

if (acpi_idle_bm_check()) {
if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
if (dev->safe_state) {
dev->last_state = dev->safe_state;
return dev->safe_state->enter(dev, dev->safe_state);
Expand Down
3 changes: 2 additions & 1 deletion include/acpi/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct acpi_power_register {
u8 space_id;
u8 bit_width;
u8 bit_offset;
u8 reserved;
u8 access_size;
u64 address;
} __attribute__ ((packed));

Expand All @@ -63,6 +63,7 @@ struct acpi_processor_cx {
u32 power;
u32 usage;
u64 time;
u8 bm_sts_skip;
char desc[ACPI_CX_DESC_LEN];
};

Expand Down

0 comments on commit 718be4a

Please sign in to comment.