Merge tag 'cpufreq-arm-updates-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
Merge more ARM cpufreq updates for 6.9 from Viresh Kumar: "- zero initialize a cpumask (Marek Szyprowski). - Boost support for scmi cpufreq driver (Sibi Sankar)." * tag 'cpufreq-arm-updates-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: scmi: Enable boost support firmware: arm_scmi: Add support for marking certain frequencies as turbo cpufreq: dt: always allocate zeroed cpumask
This commit is contained in:
@ -208,7 +208,7 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!alloc_cpumask_var(&priv->cpus, GFP_KERNEL))
|
||||
if (!zalloc_cpumask_var(&priv->cpus, GFP_KERNEL))
|
||||
return -ENOMEM;
|
||||
|
||||
cpumask_set_cpu(cpu, priv->cpus);
|
||||
|
@ -30,6 +30,7 @@ struct scmi_data {
|
||||
|
||||
static struct scmi_protocol_handle *ph;
|
||||
static const struct scmi_perf_proto_ops *perf_ops;
|
||||
static struct cpufreq_driver scmi_cpufreq_driver;
|
||||
|
||||
static unsigned int scmi_cpufreq_get_rate(unsigned int cpu)
|
||||
{
|
||||
@ -167,6 +168,12 @@ scmi_get_rate_limit(u32 domain, bool has_fast_switch)
|
||||
return rate_limit;
|
||||
}
|
||||
|
||||
static struct freq_attr *scmi_cpufreq_hw_attr[] = {
|
||||
&cpufreq_freq_attr_scaling_available_freqs,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static int scmi_cpufreq_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int ret, nr_opp, domain;
|
||||
@ -276,6 +283,17 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
|
||||
policy->transition_delay_us =
|
||||
scmi_get_rate_limit(domain, policy->fast_switch_possible);
|
||||
|
||||
if (policy_has_boost_freq(policy)) {
|
||||
ret = cpufreq_enable_boost_support();
|
||||
if (ret) {
|
||||
dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
|
||||
goto out_free_opp;
|
||||
} else {
|
||||
scmi_cpufreq_hw_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs;
|
||||
scmi_cpufreq_driver.boost_enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out_free_opp:
|
||||
@ -334,7 +352,7 @@ static struct cpufreq_driver scmi_cpufreq_driver = {
|
||||
CPUFREQ_NEED_INITIAL_FREQ_CHECK |
|
||||
CPUFREQ_IS_COOLING_DEV,
|
||||
.verify = cpufreq_generic_frequency_table_verify,
|
||||
.attr = cpufreq_generic_attr,
|
||||
.attr = scmi_cpufreq_hw_attr,
|
||||
.target_index = scmi_cpufreq_set_target,
|
||||
.fast_switch = scmi_cpufreq_fast_switch,
|
||||
.get = scmi_cpufreq_get_rate,
|
||||
|
@ -871,6 +871,9 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
|
||||
else
|
||||
freq = dom->opp[idx].indicative_freq * dom->mult_factor;
|
||||
|
||||
/* All OPPs above the sustained frequency are treated as turbo */
|
||||
data.turbo = freq > dom->sustained_freq_khz * 1000;
|
||||
|
||||
data.level = dom->opp[idx].perf;
|
||||
data.freq = freq;
|
||||
|
||||
|
Reference in New Issue
Block a user