mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
To: Mario Limonciello <superm1@kernel.org>,
	"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
	Perry Yuan <perry.yuan@amd.com>
Cc: "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<linux-kernel@vger.kernel.org>,
	"open list:CPU FREQUENCY SCALING FRAMEWORK"
	<linux-pm@vger.kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>
Subject: Re: [PATCH] cpufreq/amd-pstate: Prefix setup messages with FW_BUG
Date: Fri, 28 Mar 2025 12:50:31 +0530	[thread overview]
Message-ID: <e75a4f57-37ac-4c43-8385-8b476d3b94db@amd.com> (raw)
In-Reply-To: <20250320214132.664522-1-superm1@kernel.org>

On 3/21/2025 3:11 AM, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> To make it clearer that amd-pstate failing to setup is a problem
> with the firmware, prefix several messages with FW_BUG.
> 
> Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 024d33d5e3670..0a9d6fe426d1c 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -931,13 +931,13 @@ static int amd_pstate_init_freq(struct amd_cpudata *cpudata)
>  	 * Check _CPC in ACPI table objects if any values are incorrect
>  	 */
>  	if (min_freq <= 0 || max_freq <= 0 || nominal_freq <= 0 || min_freq > max_freq) {
> -		pr_err("min_freq(%d) or max_freq(%d) or nominal_freq(%d) value is incorrect\n",
> +		pr_err(FW_BUG "min_freq(%d) or max_freq(%d) or nominal_freq(%d) value is incorrect\n",
>  			min_freq, max_freq, nominal_freq);
>  		return -EINVAL;
>  	}
>  
>  	if (lowest_nonlinear_freq <= min_freq || lowest_nonlinear_freq > nominal_freq) {
> -		pr_err("lowest_nonlinear_freq(%d) value is out of range [min_freq(%d), nominal_freq(%d)]\n",
> +		pr_err(FW_BUG "lowest_nonlinear_freq(%d) value is out of range [min_freq(%d), nominal_freq(%d)]\n",
>  			lowest_nonlinear_freq, min_freq, nominal_freq);
>  		return -EINVAL;
>  	}
> @@ -1505,7 +1505,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>  	return 0;
>  
>  free_cpudata1:
> -	pr_warn("Failed to initialize CPU %d: %d\n", policy->cpu, ret);
> +	pr_warn(FW_BUG "Failed to initialize CPU %d: %d\n", policy->cpu, ret);

Just thinking are we sure that we land here only through a firmware bug?

If not, we should probably use FW_WARN ?, 
or 
Should we add to the error message the specific firmware issue that might cause 
each of the functions to fail (e.g. amd_pstate_init_perf(), amd_pstate_init_freq(), 
etc). 

Comments for the macros, for reference,

 * FW_BUG
 * Add this to a message where you are sure the firmware is buggy or behaves
 * really stupid or out of spec. Be aware that the responsible BIOS developer
 * should be able to fix this issue or at least get a concrete idea of the
 * problem by reading your message without the need of looking at the kernel
 * code.
 *
 * Use it for definite and high priority BIOS bugs.
 *
 * FW_WARN
 * Use it for not that clear (e.g. could the kernel messed up things already?)
 * and medium priority BIOS bugs.

>  	kfree(cpudata);
>  	return ret;
>  }


  reply	other threads:[~2025-03-28  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 21:41 Mario Limonciello
2025-03-28  7:20 ` Dhananjay Ugwekar [this message]
2025-04-02 19:57   ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e75a4f57-37ac-4c43-8385-8b476d3b94db@amd.com \
    --to=dhananjay.ugwekar@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=superm1@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®