[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240227173434.650334-3-quic_sibis@quicinc.com>
Date: Tue, 27 Feb 2024 23:04:33 +0530
From: Sibi Sankar <quic_sibis@...cinc.com>
To: <sudeep.holla@....com>, <cristian.marussi@....com>, <rafael@...nel.org>,
<viresh.kumar@...aro.org>, <morten.rasmussen@....com>,
<dietmar.eggemann@....com>, <lukasz.luba@....com>, <sboyd@...nel.org>
CC: <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>, <nm@...com>,
Sibi Sankar
<quic_sibis@...cinc.com>
Subject: [PATCH V2 2/3] firmware: arm_scmi: Add support for marking certain frequencies as boost
All opps above the sustained level/frequency are treated as boost, so mark
them accordingly.
Suggested-by: Sudeep Holla <sudeep.holla@....com>
Signed-off-by: Sibi Sankar <quic_sibis@...cinc.com>
---
v2:
* Remove sustained_freq check. [Pierre]
* simplify sustained_freq_khz calculation. [Sudeep]
drivers/firmware/arm_scmi/perf.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 981e327e63e3..caf6191df300 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -850,7 +850,7 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
struct device *dev, u32 domain)
{
int idx, ret;
- unsigned long freq;
+ unsigned long freq, sustained_freq;
struct dev_pm_opp_data data = {};
struct perf_dom_info *dom;
@@ -858,12 +858,18 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
if (IS_ERR(dom))
return PTR_ERR(dom);
+ sustained_freq = dom->sustained_freq_khz * 1000UL;
+
for (idx = 0; idx < dom->opp_count; idx++) {
if (!dom->level_indexing_mode)
freq = dom->opp[idx].perf * dom->mult_factor;
else
freq = dom->opp[idx].indicative_freq * dom->mult_factor;
+ /* All opps above the sustained level/frequency are treated as boost */
+ if (freq > sustained_freq)
+ data.turbo = true;
+
data.level = dom->opp[idx].perf;
data.freq = freq;
--
2.34.1
Powered by blists - more mailing lists