mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
ACPI: processor: Move MWAIT quirk out of acpi_processor.c
Commit 2a2a64714d
("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 <rafael.j.wysocki@intel.com>
Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
[ rjw: Subject and changelog edits, two function names changed ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
06c2afb862
commit
0a0e2ea642
3 changed files with 38 additions and 28 deletions
|
@ -153,6 +153,8 @@ int acpi_wakeup_device_init(void);
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
#ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
|
#ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
|
||||||
void acpi_early_processor_set_pdc(void);
|
void acpi_early_processor_set_pdc(void);
|
||||||
|
|
||||||
|
void acpi_proc_quirk_mwait_check(void);
|
||||||
#else
|
#else
|
||||||
static inline void acpi_early_processor_set_pdc(void) {}
|
static inline void acpi_early_processor_set_pdc(void) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -174,36 +174,9 @@ early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
|
||||||
return AE_OK;
|
return AE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init set_no_mwait(const struct dmi_system_id *id)
|
|
||||||
{
|
|
||||||
pr_notice("%s detected - disabling mwait for CPU C-states\n",
|
|
||||||
id->ident);
|
|
||||||
boot_option_idle_override = IDLE_NOMWAIT;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct dmi_system_id processor_idle_dmi_table[] __initconst = {
|
|
||||||
{
|
|
||||||
set_no_mwait, "Extensa 5220", {
|
|
||||||
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
|
|
||||||
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
||||||
DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
|
|
||||||
DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
|
|
||||||
{},
|
|
||||||
};
|
|
||||||
|
|
||||||
static void __init processor_dmi_check(void)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Check whether the system is DMI table. If yes, OSPM
|
|
||||||
* should not use mwait for CPU-states.
|
|
||||||
*/
|
|
||||||
dmi_check_system(processor_idle_dmi_table);
|
|
||||||
}
|
|
||||||
|
|
||||||
void __init acpi_early_processor_set_pdc(void)
|
void __init acpi_early_processor_set_pdc(void)
|
||||||
{
|
{
|
||||||
processor_dmi_check();
|
acpi_proc_quirk_mwait_check();
|
||||||
|
|
||||||
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
|
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
|
||||||
ACPI_UINT32_MAX,
|
ACPI_UINT32_MAX,
|
||||||
|
|
|
@ -518,3 +518,38 @@ bool acpi_quirk_skip_acpi_ac_and_battery(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(acpi_quirk_skip_acpi_ac_and_battery);
|
EXPORT_SYMBOL_GPL(acpi_quirk_skip_acpi_ac_and_battery);
|
||||||
|
|
||||||
|
/* This section provides a workaround for a specific x86 system
|
||||||
|
* which requires disabling of mwait to work correctly.
|
||||||
|
*/
|
||||||
|
static int __init acpi_proc_quirk_set_no_mwait(const struct dmi_system_id *id)
|
||||||
|
{
|
||||||
|
pr_notice("%s detected - disabling mwait for CPU C-states\n",
|
||||||
|
id->ident);
|
||||||
|
boot_option_idle_override = IDLE_NOMWAIT;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct dmi_system_id acpi_proc_quirk_mwait_dmi_table[] __initconst = {
|
||||||
|
{
|
||||||
|
.callback = acpi_proc_quirk_set_no_mwait,
|
||||||
|
.ident = "Extensa 5220",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
|
||||||
|
DMI_MATCH(DMI_BOARD_NAME, "Columbia"),
|
||||||
|
},
|
||||||
|
.driver_data = NULL,
|
||||||
|
},
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
void __init acpi_proc_quirk_mwait_check(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Check whether the system is DMI table. If yes, OSPM
|
||||||
|
* should not use mwait for CPU-states.
|
||||||
|
*/
|
||||||
|
dmi_check_system(acpi_proc_quirk_mwait_dmi_table);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue