Skip to content

Commit 4f37ab5

Browse files
mwilczyrafaeljw
authored andcommitted
ACPI: processor: Clear C_C2C3_FFH and C_C1_FFH in arch_acpi_set_proc_cap_bits()
Currently arch_acpi_set_proc_cap_bits() clears ACPI_PDC_C_C2C3_FFH bit in case MWAIT instruction is not supported. It should also clear ACPI_PDC_C_C1_FFH, as when MWAIT is not supported, C1 is entered by executing the HLT instruction. Quote from the C_C1_FFH description: "If set, OSPM is capable of performing native C State instructions (beyond halt) for the C1 handler in multi-processor configurations". As without MWAIT there is no native C-state instructions beyond HALT, this bit should be toggled off." Clear ACPI_PDC_C_C1_FFH and ACPI_PDC_C_C2C3_FFH in arch_acpi_set_proc_cap_bits() in case MWAIT is not supported or overridden. Remove setting those bits from the processor_pdc.c code. Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c9e6c5e commit 4f37ab5

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

arch/x86/include/asm/acpi.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
113113
*cap |= ACPI_PROC_CAP_T_FFH;
114114

115115
/*
116-
* If mwait/monitor is unsupported, C2/C3_FFH will be disabled
116+
* If mwait/monitor is unsupported, C_C1_FFH and
117+
* C2/C3_FFH will be disabled.
117118
*/
118-
if (!cpu_has(c, X86_FEATURE_MWAIT))
119-
*cap &= ~(ACPI_PROC_CAP_C_C2C3_FFH);
120-
119+
if (!cpu_has(c, X86_FEATURE_MWAIT) ||
120+
boot_option_idle_override == IDLE_NOMWAIT)
121+
*cap &= ~(ACPI_PROC_CAP_C_C1_FFH | ACPI_PROC_CAP_C_C2C3_FFH);
121122
}
122123

123124
static inline bool acpi_has_cpu_in_madt(void)

drivers/acpi/processor_pdc.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,6 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
7474
{
7575
acpi_status status = AE_OK;
7676

77-
if (boot_option_idle_override == IDLE_NOMWAIT) {
78-
/*
79-
* If mwait is disabled for CPU C-states, the C2C3_FFH access
80-
* mode will be disabled in the parameter of _PDC object.
81-
* Of course C1_FFH access mode will also be disabled.
82-
*/
83-
union acpi_object *obj;
84-
u32 *buffer = NULL;
85-
86-
obj = pdc_in->pointer;
87-
buffer = (u32 *)(obj->buffer.pointer);
88-
buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH);
89-
90-
}
9177
status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL);
9278

9379
if (ACPI_FAILURE(status))

0 commit comments

Comments
 (0)