ACPI fixes for 5.19-rc6
- Prevent _CPC from being used if the platform firmware does not confirm CPPC v2 support via _OSC (Mario Limonciello). - Allow systems with X86_FEATURE_CPPC set to use _CPC even if CPPC support cannot be agreed on via _OSC (Mario Limonciello). -----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmLIgTwSHHJqd0Byand5 c29ja2kubmV0AAoJEILEb/54YlRxmDAP/1OEgChbdJNvhg7no4BHEwSyuArAVcRD +D5bCiPq8x5dSNke3BrN4n789fhsHphXucqI5yTq7lX1AonyO1EHkc+oG+EGrZ+8 dyw+6Nx4WdJkOLKrEwQm3QQYuBK/k4pCUwhWBBg5FEsn4QldBE2pzEC8aP7gNgN6 gAxs+6nC7r/9fMoRo8+SG9Xrr1FH1mddru4WTp6croLNrlLVXTaoAHwXMB4qk8in JC8bvfnWSWXn05fvJ+nYf8wb93tjBsuyx/Om7kmP7V1WT30fidv+BdP50x6kFq9/ nE0iTAAgqiO1SpRpUHfYc63GUvBC9d9ZUsbSyT7fMEqZCqLRsKukUA5xFxgQORBi fKWVVSjOaQUFk0eeivdqWTgpaIRkjxVCmLFxGN/vY3T1pqAmJIdoY5x7ZzxuOrBW 6h1zOT0Qm9LURrlnXhcFHXALXFAGVpYCoP4X0PhNi9fZCSrjraG77dar0fj5KgHv pUnLTL1qHxrzX/Ax7LJ/Usc+mKO8s/Wd790CvtFElHIsH5p7Bx/l3BDdQHbGK2l2 ToO9WQQCumccXs6SHCVYQJIH1pr0UIB2X15FNrmLVem8WkEBFJ7DwrZ/nitenOV3 c9BsQr+rJ3s9S9aSYvIAadurPzC6x5lKu0GKMUfM2GUl/vVcFrzkzlAATD467/IC Z7gsfL1UtOwx =yWsx -----END PGP SIGNATURE----- Merge tag 'acpi-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These fix two recent regressions related to CPPC support. Specifics: - Prevent _CPC from being used if the platform firmware does not confirm CPPC v2 support via _OSC (Mario Limonciello) - Allow systems with X86_FEATURE_CPPC set to use _CPC even if CPPC support cannot be agreed on via _OSC (Mario Limonciello)" * tag 'acpi-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked
This commit is contained in:
commit
525496a030
@ -11,6 +11,16 @@
|
||||
|
||||
/* Refer to drivers/acpi/cppc_acpi.c for the description of functions */
|
||||
|
||||
bool cpc_supported_by_cpu(void)
|
||||
{
|
||||
switch (boot_cpu_data.x86_vendor) {
|
||||
case X86_VENDOR_AMD:
|
||||
case X86_VENDOR_HYGON:
|
||||
return boot_cpu_has(X86_FEATURE_CPPC);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cpc_ffh_supported(void)
|
||||
{
|
||||
return true;
|
||||
|
@ -298,7 +298,7 @@ EXPORT_SYMBOL_GPL(osc_cpc_flexible_adr_space_confirmed);
|
||||
bool osc_sb_native_usb4_support_confirmed;
|
||||
EXPORT_SYMBOL_GPL(osc_sb_native_usb4_support_confirmed);
|
||||
|
||||
bool osc_sb_cppc_not_supported;
|
||||
bool osc_sb_cppc2_support_acked;
|
||||
|
||||
static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
|
||||
static void acpi_bus_osc_negotiate_platform_control(void)
|
||||
@ -358,11 +358,6 @@ static void acpi_bus_osc_negotiate_platform_control(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI_CPPC_LIB
|
||||
osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &
|
||||
(OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Now run _OSC again with query flag clear and with the caps
|
||||
* supported by both the OS and the platform.
|
||||
@ -376,6 +371,10 @@ static void acpi_bus_osc_negotiate_platform_control(void)
|
||||
|
||||
capbuf_ret = context.ret.pointer;
|
||||
if (context.ret.length > OSC_SUPPORT_DWORD) {
|
||||
#ifdef CONFIG_ACPI_CPPC_LIB
|
||||
osc_sb_cppc2_support_acked = capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_CPCV2_SUPPORT;
|
||||
#endif
|
||||
|
||||
osc_sb_apei_support_acked =
|
||||
capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
|
||||
osc_pc_lpi_support_confirmed =
|
||||
|
@ -577,6 +577,19 @@ bool __weak cpc_ffh_supported(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* cpc_supported_by_cpu() - check if CPPC is supported by CPU
|
||||
*
|
||||
* Check if the architectural support for CPPC is present even
|
||||
* if the _OSC hasn't prescribed it
|
||||
*
|
||||
* Return: true for supported, false for not supported
|
||||
*/
|
||||
bool __weak cpc_supported_by_cpu(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* pcc_data_alloc() - Allocate the pcc_data memory for pcc subspace
|
||||
*
|
||||
@ -684,8 +697,11 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
|
||||
acpi_status status;
|
||||
int ret = -ENODATA;
|
||||
|
||||
if (osc_sb_cppc_not_supported)
|
||||
return -ENODEV;
|
||||
if (!osc_sb_cppc2_support_acked) {
|
||||
pr_debug("CPPC v2 _OSC not acked\n");
|
||||
if (!cpc_supported_by_cpu())
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Parse the ACPI _CPC table for this CPU. */
|
||||
status = acpi_evaluate_object_typed(handle, "_CPC", NULL, &output,
|
||||
|
@ -145,6 +145,7 @@ extern bool cppc_allow_fast_switch(void);
|
||||
extern int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data);
|
||||
extern unsigned int cppc_get_transition_latency(int cpu);
|
||||
extern bool cpc_ffh_supported(void);
|
||||
extern bool cpc_supported_by_cpu(void);
|
||||
extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val);
|
||||
extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val);
|
||||
#else /* !CONFIG_ACPI_CPPC_LIB */
|
||||
|
@ -584,7 +584,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
||||
extern bool osc_sb_apei_support_acked;
|
||||
extern bool osc_pc_lpi_support_confirmed;
|
||||
extern bool osc_sb_native_usb4_support_confirmed;
|
||||
extern bool osc_sb_cppc_not_supported;
|
||||
extern bool osc_sb_cppc2_support_acked;
|
||||
extern bool osc_cpc_flexible_adr_space_confirmed;
|
||||
|
||||
/* USB4 Capabilities */
|
||||
|
Loading…
Reference in New Issue
Block a user