Skip to content

Commit 0a0e2ea

Browse files
mwilczyrafaeljw
authored andcommitted
ACPI: processor: Move MWAIT quirk out of acpi_processor.c
Commit 2a2a647 ("ACPI: Disable MWAIT via DMI on broken Compal board") introduced a workaround for MWAIT for a specific x86 system. Move the code outside of acpi_processor.c to acpi/x86/ directory for consistency and rename the functions associated with it, so their names start with "acpi_proc_quirk_" to make the goal obvious. No intentional functional impact. Suggested-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> [ rjw: Subject and changelog edits, two function names changed ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 06c2afb commit 0a0e2ea

File tree

3 files changed

+38
-28
lines changed

3 files changed

+38
-28
lines changed

drivers/acpi/internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ int acpi_wakeup_device_init(void);
153153
-------------------------------------------------------------------------- */
154154
#ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
155155
void acpi_early_processor_set_pdc(void);
156+
157+
void acpi_proc_quirk_mwait_check(void);
156158
#else
157159
static inline void acpi_early_processor_set_pdc(void) {}
158160
#endif

drivers/acpi/processor_pdc.c

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -174,36 +174,9 @@ early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
174174
return AE_OK;
175175
}
176176

177-
static int __init set_no_mwait(const struct dmi_system_id *id)
178-
{
179-
pr_notice("%s detected - disabling mwait for CPU C-states\n",
180-
id->ident);
181-
boot_option_idle_override = IDLE_NOMWAIT;
182-
return 0;
183-
}
184-
185-
static const struct dmi_system_id processor_idle_dmi_table[] __initconst = {
186-
{
187-
set_no_mwait, "Extensa 5220", {
188-
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
189-
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
190-
DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
191-
DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
192-
{},
193-
};
194-
195-
static void __init processor_dmi_check(void)
196-
{
197-
/*
198-
* Check whether the system is DMI table. If yes, OSPM
199-
* should not use mwait for CPU-states.
200-
*/
201-
dmi_check_system(processor_idle_dmi_table);
202-
}
203-
204177
void __init acpi_early_processor_set_pdc(void)
205178
{
206-
processor_dmi_check();
179+
acpi_proc_quirk_mwait_check();
207180

208181
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
209182
ACPI_UINT32_MAX,

drivers/acpi/x86/utils.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,38 @@ bool acpi_quirk_skip_acpi_ac_and_battery(void)
518518
return false;
519519
}
520520
EXPORT_SYMBOL_GPL(acpi_quirk_skip_acpi_ac_and_battery);
521+
522+
/* This section provides a workaround for a specific x86 system
523+
* which requires disabling of mwait to work correctly.
524+
*/
525+
static int __init acpi_proc_quirk_set_no_mwait(const struct dmi_system_id *id)
526+
{
527+
pr_notice("%s detected - disabling mwait for CPU C-states\n",
528+
id->ident);
529+
boot_option_idle_override = IDLE_NOMWAIT;
530+
return 0;
531+
}
532+
533+
static const struct dmi_system_id acpi_proc_quirk_mwait_dmi_table[] __initconst = {
534+
{
535+
.callback = acpi_proc_quirk_set_no_mwait,
536+
.ident = "Extensa 5220",
537+
.matches = {
538+
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
539+
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
540+
DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
541+
DMI_MATCH(DMI_BOARD_NAME, "Columbia"),
542+
},
543+
.driver_data = NULL,
544+
},
545+
{}
546+
};
547+
548+
void __init acpi_proc_quirk_mwait_check(void)
549+
{
550+
/*
551+
* Check whether the system is DMI table. If yes, OSPM
552+
* should not use mwait for CPU-states.
553+
*/
554+
dmi_check_system(acpi_proc_quirk_mwait_dmi_table);
555+
}

0 commit comments

Comments
 (0)