Skip to content

Commit 4f774c4

Browse files
anderssonvireshk
authored andcommitted
cpufreq: Reintroduce ready() callback
This effectively revert '4bf8e582119e ("cpufreq: Remove ready() callback")', in order to reintroduce the ready callback. This is needed in order to be able to leave the thermal pressure interrupts in the Qualcomm CPUfreq driver disabled during initialization, so that it doesn't fire while related_cpus are still 0. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> [ Viresh: Added the Chinese translation as well and updated commit msg ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent e783362 commit 4f774c4

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

Documentation/cpu-freq/cpu-drivers.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ And optionally
7575
.resume - A pointer to a per-policy resume function which is called
7676
with interrupts disabled and _before_ the governor is started again.
7777

78+
.ready - A pointer to a per-policy ready function which is called after
79+
the policy is fully initialized.
80+
7881
.attr - A pointer to a NULL-terminated list of "struct freq_attr" which
7982
allow to export values to sysfs.
8083

Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ CPUfreq核心层注册一个cpufreq_driver结构体。
8484
.resume - 一个指向per-policy恢复函数的指针,该函数在关中断且在调节器再一次启动前被
8585
调用。
8686

87+
.ready - 一个指向per-policy准备函数的指针,该函数在策略完全初始化之后被调用。
88+
8789
.attr - 一个指向NULL结尾的"struct freq_attr"列表的指针,该列表允许导出值到
8890
sysfs。
8991

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,10 @@ static int cpufreq_online(unsigned int cpu)
15181518

15191519
kobject_uevent(&policy->kobj, KOBJ_ADD);
15201520

1521+
/* Callback for handling stuff after policy is ready */
1522+
if (cpufreq_driver->ready)
1523+
cpufreq_driver->ready(policy);
1524+
15211525
if (cpufreq_thermal_control_enabled(cpufreq_driver))
15221526
policy->cdev = of_cpufreq_cooling_register(policy);
15231527

include/linux/cpufreq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ struct cpufreq_driver {
382382
int (*suspend)(struct cpufreq_policy *policy);
383383
int (*resume)(struct cpufreq_policy *policy);
384384

385+
/* Will be called after the driver is fully initialized */
386+
void (*ready)(struct cpufreq_policy *policy);
387+
385388
struct freq_attr **attr;
386389

387390
/* platform specific boost support code */

0 commit comments

Comments
 (0)