Skip to content

Commit 13e9235

Browse files
committed
cpufreq: loongson: Set .set_boost directly
The boost feature can be controlled at two levels currently, driver level (applies to all policies) and per-policy. Currently the driver enables driver level boost support from the per-policy ->init() callback, which isn't really efficient as that gets called for each policy and then there is online/offline path too where this gets done unnecessarily. Instead set the .set_boost field directly and always enable the boost support. If a policy doesn't support boost feature, the core will not enable it for that policy. Keep the initial state of driver level boost to disabled and let the user enable it if required as ideally the boost frequencies must be used only when really required. Signed-off-by: Viresh Kumar <[email protected]>
1 parent ddef17b commit 13e9235

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/cpufreq/loongson3_cpufreq.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,6 @@ static int loongson3_cpufreq_cpu_init(struct cpufreq_policy *policy)
299299
per_cpu(freq_data, i) = per_cpu(freq_data, cpu);
300300
}
301301

302-
if (policy_has_boost_freq(policy)) {
303-
ret = cpufreq_enable_boost_support();
304-
if (ret < 0) {
305-
pr_warn("cpufreq: Failed to enable boost: %d\n", ret);
306-
return ret;
307-
}
308-
loongson3_cpufreq_driver.boost_enabled = true;
309-
}
310-
311302
return 0;
312303
}
313304

@@ -338,6 +329,7 @@ static struct cpufreq_driver loongson3_cpufreq_driver = {
338329
.get = loongson3_cpufreq_get,
339330
.target_index = loongson3_cpufreq_target,
340331
.verify = cpufreq_generic_frequency_table_verify,
332+
.set_boost = cpufreq_boost_set_sw,
341333
.suspend = cpufreq_generic_suspend,
342334
};
343335

0 commit comments

Comments
 (0)