Linux Power Management development
 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>,
	Klara Modin <klarasmodin@gmail.com>
Subject: Re: [PATCH v2 1/2] cpufreq/amd-pstate: Push adjust_perf vfunc init into cpu_init
Date: Tue, 29 Oct 2024 10:22:42 +0530	[thread overview]
Message-ID: <44f8bf0a-4d1a-4a75-99fd-4ca7473423d4@amd.com> (raw)
In-Reply-To: <20241028145542.1739160-1-superm1@kernel.org>

On 10/28/2024 8:25 PM, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> As the driver can be changed in and out of different modes it's possible
> that adjust_perf is assigned when it shouldn't be.
> 
> This could happen if an MSR design is started up in passive mode and then
> switches to active mode.
> 
> To solve this explicitly clear `adjust_perf` in amd_pstate_epp_cpu_init().
>

Great, this solves the overlooked issue as well, looks good to me.

You may also add,
Tested-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>

Thanks,
Dhananjay
 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> Cc: Klara Modin <klarasmodin@gmail.com>
>  drivers/cpufreq/amd-pstate.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 206725219d8c9..e480da818d6f5 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1504,6 +1504,8 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>  		WRITE_ONCE(cpudata->cppc_cap1_cached, value);
>  	}
>  
> +	current_pstate_driver->adjust_perf = NULL;
> +
>  	return 0;
>  
>  free_cpudata1:
> @@ -1866,8 +1868,6 @@ static int __init amd_pstate_init(void)
>  	/* capability check */
>  	if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
>  		pr_debug("AMD CPPC MSR based functionality is supported\n");
> -		if (cppc_state != AMD_PSTATE_ACTIVE)
> -			current_pstate_driver->adjust_perf = amd_pstate_adjust_perf;
>  	} else {
>  		pr_debug("AMD CPPC shared memory based functionality is supported\n");
>  		static_call_update(amd_pstate_cppc_enable, shmem_cppc_enable);

      parent reply	other threads:[~2024-10-29  4:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 14:55 [PATCH v2 1/2] cpufreq/amd-pstate: Push adjust_perf vfunc init into cpu_init Mario Limonciello
2024-10-28 14:55 ` [PATCH v2 2/2] cpufreq/amd-pstate: Move registration after static function call update Mario Limonciello
2024-10-29  4:57   ` Dhananjay Ugwekar
2024-10-28 21:48 ` [PATCH v2 1/2] cpufreq/amd-pstate: Push adjust_perf vfunc init into cpu_init Klara Modin
2024-10-29  4:52 ` Dhananjay Ugwekar [this message]

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=44f8bf0a-4d1a-4a75-99fd-4ca7473423d4@amd.com \
    --to=dhananjay.ugwekar@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=klarasmodin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --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