All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <whuang2@amd.com>
To: Punit Agrawal <punitagrawal@gmail.com>, rjw@rjwysocki.net
Cc: wei.huang2@amd.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, bp@alien8.de, x86@kernel.org
Subject: Re: [RFC PATCH 1/4] cpufreq: acpi-cpufreq: Re-factor overriding ACPI PSD
Date: Mon, 7 Dec 2020 13:29:03 -0600	[thread overview]
Message-ID: <52d9b72c-5935-c28c-21cf-b24c6928de81@amd.com> (raw)
In-Reply-To: <20201125144847.3920-2-punitagrawal@gmail.com>



On 11/25/20 8:48 AM, Punit Agrawal wrote:
> Re-factor the code to override the firmware provided frequency domain
> information (via PSD) to localise the checks in one function.
> 
> No functional change intended.
> 
> Signed-off-by: Punit Agrawal <punitagrawal@gmail.com>
> Cc: Wei Huang <wei.huang2@amd.com>
> ---
>  drivers/cpufreq/acpi-cpufreq.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 1e4fbb002a31..b1e7df96d428 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -191,6 +191,20 @@ static int check_amd_hwpstate_cpu(unsigned int cpuid)
>  	return cpu_has(cpu, X86_FEATURE_HW_PSTATE);
>  }
>  
> +static int override_acpi_psd(unsigned int cpu_id)
         ^^^^^
int is fine, but it might be better to use bool. Otherwise I don't see
any issues with this patch.

> +{
> +	struct cpuinfo_x86 *c = &boot_cpu_data;
> +
> +	if (c->x86_vendor == X86_VENDOR_AMD) {
> +		if (!check_amd_hwpstate_cpu(cpu_id))
> +			return false;
> +
> +		return c->x86 < 0x19;
> +	}
> +
> +	return false;
> +}
> +
>  static unsigned extract_io(struct cpufreq_policy *policy, u32 value)
>  {
>  	struct acpi_cpufreq_data *data = policy->driver_data;
> @@ -691,8 +705,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  		cpumask_copy(policy->cpus, topology_core_cpumask(cpu));
>  	}
>  
> -	if (check_amd_hwpstate_cpu(cpu) && boot_cpu_data.x86 < 0x19 &&
> -	    !acpi_pstate_strict) {
> +	if (override_acpi_psd(cpu) && !acpi_pstate_strict) {
>  		cpumask_clear(policy->cpus);
>  		cpumask_set_cpu(cpu, policy->cpus);
>  		cpumask_copy(data->freqdomain_cpus,
> 

  reply	other threads:[~2020-12-07 19:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 14:48 [RFC PATCH 0/4] Add processor to the ignore PSD override list Punit Agrawal
2020-11-25 14:48 ` [RFC PATCH 1/4] cpufreq: acpi-cpufreq: Re-factor overriding ACPI PSD Punit Agrawal
2020-12-07 19:29   ` Wei Huang [this message]
2020-12-08 23:31     ` Punit Agrawal
2020-11-25 14:48 ` [RFC PATCH 2/4] cpufreq: acpi-cpufreq: Add processor to the ignore PSD override list Punit Agrawal
2020-12-07 20:20   ` Wei Huang
2020-12-07 20:26     ` Borislav Petkov
2020-12-07 22:07       ` Wei Huang
2020-12-07 22:30         ` Borislav Petkov
2020-12-08  3:44           ` Wei Huang
2020-12-08 23:21           ` Punit Agrawal
2020-12-08 23:32             ` Borislav Petkov
2020-12-11 23:36               ` Punit Agrawal
2020-12-14 12:40                 ` Borislav Petkov
2020-12-14 13:27                   ` Punit Agrawal
2020-12-14 14:25                     ` Borislav Petkov
2020-12-17 13:27                       ` Punit Agrawal
2020-11-25 14:48 ` [RFC PATCH 3/4] x86/cpu: amd: Define processor families Punit Agrawal
2020-11-30 14:00   ` Borislav Petkov
2020-12-02 14:13     ` Punit Agrawal
2020-12-02 16:57       ` Borislav Petkov
2020-11-25 14:48 ` [RFC PATCH 4/4] cpufreq: acpi-cpufreq: Use identifiers for AMD processor family Punit Agrawal
2020-11-30 14:02   ` Borislav Petkov
2020-12-02 14:30     ` Punit Agrawal
2020-12-04 22:44 ` [RFC PATCH 0/4] Add processor to the ignore PSD override list Punit Agrawal
2020-12-07 13:55   ` Rafael J. Wysocki
2020-12-08 23:25     ` Punit Agrawal

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=52d9b72c-5935-c28c-21cf-b24c6928de81@amd.com \
    --to=whuang2@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=punitagrawal@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=wei.huang2@amd.com \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.