Linux ACPI
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: Sumit Gupta <sumitg@nvidia.com>,
	rafael@kernel.org, viresh.kumar@linaro.org, lenb@kernel.org,
	zhenglifeng1@huawei.com, zhanjie9@hisilicon.com,
	mario.limonciello@amd.com, saket.dumbre@intel.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, acpica-devel@lists.linux.dev
Cc: treding@nvidia.com, jonathanh@nvidia.com, vsethi@nvidia.com,
	ksitaraman@nvidia.com, sanjayc@nvidia.com, bbasu@nvidia.com
Subject: Re: [PATCH v2 2/2] ACPI: CPPC: Add ospm_nominal_perf support
Date: Wed, 13 May 2026 17:43:08 +0200	[thread overview]
Message-ID: <ab6ae808-f953-4147-ae48-419a196c5819@arm.com> (raw)
In-Reply-To: <9c32f75a-294f-4cea-810e-c011c4dd91ab@nvidia.com>

>>>
>>> diff --git a/drivers/cpufreq/cppc_cpufreq.c 
>>> b/drivers/cpufreq/cppc_cpufreq.c
>>> index 7e7f9dfb7a24..d06cba963550 100644
>>> --- a/drivers/cpufreq/cppc_cpufreq.c
>>> +++ b/drivers/cpufreq/cppc_cpufreq.c
>>> @@ -715,6 +715,16 @@ static int cppc_cpufreq_cpu_init(struct 
>>> cpufreq_policy *policy)
>>>               goto out;
>>>       }
>>>
>>> +     /*
>>> +      * Initialize OSPM Nominal Performance to inform firmware of
>>> +      * OSPM's nominal level. Performance above this value = boost;
>>> +      * below = throttle. Uses platform nominal by default.
>>> +      */
>>> +     ret = cppc_set_ospm_nominal_perf(cpu, caps->nominal_perf);
>>> +     if (ret && ret != -EOPNOTSUPP)
>>> +             pr_debug("Failed to set ospm_nominal_perf for CPU%d: 
>>> %d\n",
>>> +                      cpu, ret);
>>> +
>>
>> IIUC, if (ospm_nominal_perf == nominal_perf), the firmware should
>> not behave differently. Is this really useful ?
>>
>
> Right, it's a no-op from the firmware's side. The init was only so that
> sysfs would show a value (platform nominal) before any userspace write.
> Will drop it in v3 and return 0 from sysfs until userspace writes a 
> value.
>
>
>> ------------
>>
>> Also this seems like there will need some synchronization
>> mechanism to keep-up with the boost state.
>>
>> If the ospm_nominal_perf is lowered and boost is disabled,
>> a freq. update should happen. IMO it looks like this could
>> be handled with (another) freq_qos_request.
>>
>> This new freq_qos_request, if we name it ospm_nominal_freq_req,
>> should only be taken into account if boost is disabled.
>> Otherwise, if boost is enabled, ospm_nominal_freq_req
>> should be ignored.
>>
>
> Agreed, will add the new freq_qos_request in a follow-up patch.
>
>> ------------
>>
>> Also, the function seems to set the ospm_nominal_freq for
>> a single CPU when the policy might be common for multiple
>> CPUs right ?
>
> In v3, after dropping the change from cppc_cpufreq_cpu_init,
> the problem won't come in this specific instance.
>
>
>>
>> The issues this field raises seems similar to the auto_sel
>> ones. I.e. :
>>
>> - concurrency accesses + need for a scratch value
>>
>> - what should happen when unloading the driver
>>
>> - the value can be set for single CPUs but we might
>> want to have the same value for the whole policy
>>
>> Maybe a common solution should be found.
>> (I m not suggesting anything right now unfortunately).
>>
>
> One way to address this is to move the sysfs from per-CPU acpi_cppc to
> a per-policy node under cpufreq (ospm_nominal_perf_freq, kHz).

Yes right, would it make sense to also move the "ospm_nominal_perf"
to the cpu_data ?


> In the sysfs callback, we can convert kHz to perf and write the register
> on every CPU in policy->cpus.
> Concurrency is already covered by policy->rwsem at the cpufreq layer.
> This is similar to how we were handling min/max_perf in earlier version.

Yes right. Something I don't really understand is that similarly to 
auto_sel,
the sysfs rwsem protects the state of the cpu_data->auto_sel field,
but we don't really have any guarantee that another driver won't modify
the firmware state right ? (maybe it's just not worth ?)


> Does this approach make sense?

Yes right thanks !


>
> Thank you,
> Sumit Gupta
>
> ....
>
>

  reply	other threads:[~2026-05-13 15:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 14:24 [PATCH v2 0/2] ACPI: CPPC: Add CPPC v4 support (ACPI 6.6) Sumit Gupta
2026-04-30 14:24 ` [PATCH v2 1/2] ACPI: CPPC: Add support for CPPC v4 Sumit Gupta
2026-04-30 16:25   ` Pierre Gondois
2026-04-30 14:24 ` [PATCH v2 2/2] ACPI: CPPC: Add ospm_nominal_perf support Sumit Gupta
2026-04-30 14:57   ` Mario Limonciello
2026-04-30 16:25   ` Pierre Gondois
2026-05-07 21:03     ` Sumit Gupta
2026-05-13 15:43       ` Pierre Gondois [this message]
2026-05-14 19:15         ` Sumit Gupta
2026-05-08 19:01 ` [PATCH v2 0/2] ACPI: CPPC: Add CPPC v4 support (ACPI 6.6) Rafael J. Wysocki
2026-05-11 21:20   ` Sumit Gupta

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=ab6ae808-f953-4147-ae48-419a196c5819@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=acpica-devel@lists.linux.dev \
    --cc=bbasu@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=ksitaraman@nvidia.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=rafael@kernel.org \
    --cc=saket.dumbre@intel.com \
    --cc=sanjayc@nvidia.com \
    --cc=sumitg@nvidia.com \
    --cc=treding@nvidia.com \
    --cc=viresh.kumar@linaro.org \
    --cc=vsethi@nvidia.com \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    /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