Linux Power Management development
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, x86@kernel.org,
	Vishal Badole <Vishal.Badole@amd.com>
Subject: Re: [PATCH 1/3] ACPI: CPPC: Refactor boost ratio handling
Date: Tue, 1 Sep 2026 10:28:53 -0500	[thread overview]
Message-ID: <fc724887-fbad-4433-85b2-27dca6da28dd@amd.com> (raw)
In-Reply-To: <f18fafe4-f873-4080-8ddf-72fb6abec557@amd.com>



On 9/1/26 04:31, K Prateek Nayak wrote:
> On 9/1/2026 1:14 AM, Mario Limonciello wrote:
>> +int amd_get_max_frequency(unsigned int cpu)
>> +{
>> +	enum x86_topology_cpu_type type = cpu_data(cpu).topo.cpu_type;
>> +	const struct x86_cpu_id *id = x86_match_cpu(amd_zen6_client_ids);
>> +	const struct amd_max_freq *max_freq;
>> +
>> +	if (!id)
>> +		return -ENODEV;
>> +
>> +	max_freq = (const struct amd_max_freq *)id->driver_data;
>> +
>> +	switch (type) {
>> +	case TOPO_CPU_TYPE_PERFORMANCE:
>> +		return max_freq->performance;
>> +	case TOPO_CPU_TYPE_EFFICIENCY:
>> +		return max_freq->efficiency;
>> +	case TOPO_CPU_TYPE_LOW_POWER:
>> +		return max_freq->low_power;
>> +	default:
>> +		break;
>> +	}
>> +
>> +	return -EINVAL;
> 
> nit. Since we don't really propagate the error codes returned
> by amd_get_max_frequency(), maybe we can return 0 instead of
> -ENODEV, -EINVAL and the callers can simply do:
> 
>      max_freq = amd_get_max_frequency(cpu);
>      if (!max_freq)
>           max_freq = /* Fallback */;
> 
> similar to get_max_boost_ratio() pattern. No strong feelings
> either way.
> 

OK.  Will adjust for next version.

>> +}
>> +EXPORT_SYMBOL_GPL(amd_get_max_frequency);


  reply	other threads:[~2026-09-01 15:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 19:44 [PATCH 0/3] Zen6 client CPPC Mario Limonciello
2026-08-31 19:44 ` [PATCH 1/3] ACPI: CPPC: Refactor boost ratio handling Mario Limonciello
2026-09-01  4:41   ` K Prateek Nayak
2026-09-01 15:26     ` Mario Limonciello
2026-09-01  9:31   ` K Prateek Nayak
2026-09-01 15:28     ` Mario Limonciello [this message]
2026-09-01 16:34       ` Rafael J. Wysocki (Intel)
2026-09-01 16:44         ` Mario Limonciello
2026-08-31 19:44 ` [PATCH 2/3] cpufreq/acpi-cpufreq: Use amd_get_boost_ratio() Mario Limonciello
2026-08-31 19:44 ` [PATCH 3/3] cpufreq/amd-pstate: Get Highest Freq for a CPU Mario Limonciello
2026-09-01  9:36 ` [PATCH 0/3] Zen6 client CPPC K Prateek Nayak

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=fc724887-fbad-4433-85b2-27dca6da28dd@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Vishal.Badole@amd.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox