Skip to content

Commit 4a973f2

Browse files
committed
Merge branch 'bugzilla-15886' into release
2 parents be48b11 + d3e7e99 commit 4a973f2

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
7676
module_param(max_cstate, uint, 0000);
7777
static unsigned int nocst __read_mostly;
7878
module_param(nocst, uint, 0000);
79+
static int bm_check_disable __read_mostly;
80+
module_param(bm_check_disable, uint, 0000);
7981

8082
static unsigned int latency_factor __read_mostly = 2;
8183
module_param(latency_factor, uint, 0644);
@@ -763,6 +765,9 @@ static int acpi_idle_bm_check(void)
763765
{
764766
u32 bm_status = 0;
765767

768+
if (bm_check_disable)
769+
return 0;
770+
766771
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
767772
if (bm_status)
768773
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
@@ -947,7 +952,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
947952
if (acpi_idle_suspend)
948953
return(acpi_idle_enter_c1(dev, state));
949954

950-
if (acpi_idle_bm_check()) {
955+
if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
951956
if (dev->safe_state) {
952957
dev->last_state = dev->safe_state;
953958
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)