2024-01-31 09:10:12

by Yuan, Perry

[permalink] [raw]
Subject: [PATCH 5/6] cppc_acpi: print error message if CPPC is unsupported

to be more clear what is wrong with CPPC when pstate driver failed to
load which has dependency on the CPPC capabilities.

Add one more debug message to notify user if CPPC is not supported by
the CPU, then it will be easy to find out what need to fix for pstate
driver loading issue.

[ 0.477523] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled

Above message is not clear enough to verify whether CPPC is not supported.

Signed-off-by: Perry Yuan <[email protected]>
---
drivers/acpi/cppc_acpi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 7ff269a78c20..217c11c12b57 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -676,8 +676,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)

if (!osc_sb_cppc2_support_acked) {
pr_debug("CPPC v2 _OSC not acked\n");
- if (!cpc_supported_by_cpu())
- return -ENODEV;
+ if (!cpc_supported_by_cpu()) {
+ pr_debug("CPPC is not supported\n");
+ return -ENODEV;
+ }
}

/* Parse the ACPI _CPC table for this CPU. */
--
2.34.1



2024-01-31 22:03:12

by Mario Limonciello

[permalink] [raw]
Subject: Re: [PATCH 5/6] cppc_acpi: print error message if CPPC is unsupported

On 1/31/2024 02:50, Perry Yuan wrote:
> to be more clear what is wrong with CPPC when pstate driver failed to
> load which has dependency on the CPPC capabilities.
>
> Add one more debug message to notify user if CPPC is not supported by
> the CPU, then it will be easy to find out what need to fix for pstate
> driver loading issue.
>
> [ 0.477523] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled
>
> Above message is not clear enough to verify whether CPPC is not supported.
>
> Signed-off-by: Perry Yuan <[email protected]>
> ---
> drivers/acpi/cppc_acpi.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 7ff269a78c20..217c11c12b57 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -676,8 +676,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
>
> if (!osc_sb_cppc2_support_acked) {
> pr_debug("CPPC v2 _OSC not acked\n");
> - if (!cpc_supported_by_cpu())
> - return -ENODEV;
> + if (!cpc_supported_by_cpu()) {
> + pr_debug("CPPC is not supported\n");

I would argue this doesn't add any value to a user. To help a user it
should be "CPPC is not supported by the CPU".

> + return -ENODEV;
> + }

This whitespace is wrong

> }
>
> /* Parse the ACPI _CPC table for this CPU. */