Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit cb817ec

Browse files
Perry Yuansuperm1
authored andcommitted
cpufreq: amd-pstate: show CPPC debug message if CPPC is not supported
Add CPU ID checking in case the driver attempt to load on systems where CPPC functionality is unavailable. And the warning message will not be shown if CPPC is not supported. It will also print debug message if the CPU has no CPPC support that helps to debug the driver loading failure issue. Reported-by: Paul Menzel <pmenzel@molgen.mpg.de> Closes: https://lore.kernel.org/linux-pm/CYYPR12MB8655D32EA18574C9497E888A9C122@CYYPR12MB8655.namprd12.prod.outlook.com/T/#t Signed-off-by: Perry Yuan <perry.yuan@amd.com> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Acked-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/437dbd581a4119465581330081d9b1e289482ba2.1718811234.git.perry.yuan@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 7bf7f22 commit cb817ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,20 @@ static int __init amd_pstate_set_driver(int mode_idx)
17431743
return -EINVAL;
17441744
}
17451745

1746+
/**
1747+
* CPPC function is not supported for family ID 17H with model_ID ranging from 0x10 to 0x2F.
1748+
* show the debug message that helps to check if the CPU has CPPC support for loading issue.
1749+
*/
1750+
static bool amd_cppc_supported(void)
1751+
{
1752+
if ((boot_cpu_data.x86 == 0x17) && (boot_cpu_data.x86_model < 0x30)) {
1753+
pr_debug_once("CPPC feature is not supported by the processor\n");
1754+
return false;
1755+
}
1756+
1757+
return true;
1758+
}
1759+
17461760
static int __init amd_pstate_init(void)
17471761
{
17481762
struct device *dev_root;
@@ -1751,6 +1765,11 @@ static int __init amd_pstate_init(void)
17511765
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
17521766
return -ENODEV;
17531767

1768+
/* show debug message only if CPPC is not supported */
1769+
if (!amd_cppc_supported())
1770+
return -EOPNOTSUPP;
1771+
1772+
/* show warning message when BIOS broken or ACPI disabled */
17541773
if (!acpi_cpc_valid()) {
17551774
pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n");
17561775
return -ENODEV;

0 commit comments

Comments
 (0)