From: Sibi Sankar <quic_sibis@quicinc.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: <sudeep.holla@arm.com>, <cristian.marussi@arm.com>,
<rafael@kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<quic_mdtipton@quicinc.com>, <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 2/3] firmware: arm_scmi: Add perf_opp_xlate interface
Date: Wed, 17 Jan 2024 08:29:55 +0530 [thread overview]
Message-ID: <0800860a-e090-153f-bbbd-1f7666b14fed@quicinc.com> (raw)
In-Reply-To: <20240110072906.7vnqykkcw3rkhoxa@vireshk-i7>
On 1/10/24 12:59, Viresh Kumar wrote:
> On 08-01-24, 19:31, Sibi Sankar wrote:
>> Add a new perf_opp_xlate interface to the existing perf_ops to translate
>> a given perf index to frequency.
>>
Hey Viresh,
Thanks for taking time to review the series!
>> This can be used by the cpufreq driver and framework to determine the
>> throttled frequency from a given perf index and apply HW pressure
>> accordingly.
>>
>> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
>> ---
>> drivers/firmware/arm_scmi/perf.c | 21 +++++++++++++++++++++
>> include/linux/scmi_protocol.h | 3 +++
>> 2 files changed, 24 insertions(+)
>>
>> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
>> index c167bb5e3607..f26390924e1c 100644
>> --- a/drivers/firmware/arm_scmi/perf.c
>> +++ b/drivers/firmware/arm_scmi/perf.c
>> @@ -964,6 +964,26 @@ static int scmi_notify_support(const struct scmi_protocol_handle *ph, u32 domain
>> return 0;
>> }
>>
>> +static int scmi_perf_opp_xlate(const struct scmi_protocol_handle *ph, u32 domain,
>> + int idx, unsigned long *freq)
>> +{
>> + struct perf_dom_info *dom;
>> +
>> + dom = scmi_perf_domain_lookup(ph, domain);
>> + if (IS_ERR(dom))
>> + return PTR_ERR(dom);
>> +
>> + if (idx >= dom->opp_count)
>> + return -ERANGE;
>> +
>> + if (!dom->level_indexing_mode)
>> + *freq = dom->opp[idx].perf * dom->mult_factor;
>> + else
>> + *freq = dom->opp[idx].indicative_freq * dom->mult_factor;
>> +
>> + return 0;
>> +}
>> +
>> static const struct scmi_perf_proto_ops perf_proto_ops = {
>> .num_domains_get = scmi_perf_num_domains_get,
>> .info_get = scmi_perf_info_get,
>> @@ -979,6 +999,7 @@ static const struct scmi_perf_proto_ops perf_proto_ops = {
>> .fast_switch_possible = scmi_fast_switch_possible,
>> .power_scale_get = scmi_power_scale_get,
>> .perf_notify_support = scmi_notify_support,
>> + .perf_opp_xlate = scmi_perf_opp_xlate,
>
> The use of "opp" here is a bit confusing as this doesn't have anything to do
> with the OPP framework and you are only getting the frequency out of it after
> all.
Sure will re-name it.
-Sibi
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-17 3:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-08 14:01 [PATCH 0/3] firmware: arm_scmi: Register and handle limits change notification Sibi Sankar
2024-01-08 14:01 ` [PATCH 1/3] firmware: arm_scmi: Add perf_notify_support interface Sibi Sankar
2024-01-08 14:01 ` [PATCH 2/3] firmware: arm_scmi: Add perf_opp_xlate interface Sibi Sankar
2024-01-10 7:29 ` Viresh Kumar
2024-01-17 2:59 ` Sibi Sankar [this message]
2024-01-08 14:01 ` [PATCH 3/3] cpufreq: scmi: Register for limit change notifications Sibi Sankar
2024-01-10 8:26 ` Lukasz Luba
2024-01-17 2:58 ` Sibi Sankar
2024-01-17 8:03 ` Lukasz Luba
2024-01-17 9:41 ` [PATCH 0/3] firmware: arm_scmi: Register and handle limits change notification Cristian Marussi
2024-01-17 12:06 ` Sibi Sankar
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=0800860a-e090-153f-bbbd-1f7666b14fed@quicinc.com \
--to=quic_sibis@quicinc.com \
--cc=cristian.marussi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=quic_mdtipton@quicinc.com \
--cc=rafael@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=viresh.kumar@linaro.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