lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 17 Jan 2024 08:29:55 +0530
From: Sibi Sankar <quic_sibis@...cinc.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
CC: <sudeep.holla@....com>, <cristian.marussi@....com>, <rafael@...nel.org>,
        <linux-arm-kernel@...ts.infradead.org>, <linux-pm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <quic_mdtipton@...cinc.com>,
        <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH 2/3] firmware: arm_scmi: Add perf_opp_xlate interface



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@...cinc.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

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ