cpufreq: tegra194: add online/offline hooks
Subsystems (2)
PATCH 1/1 cpufreq: tegra194: add online/offline hooks
Implement the light-weight tear down and bring up helpers to reduce the amount of work to do on CPU offline/online operation.
This change helps to make the hotplugging paths much faster.
Suggested-by Viresh Kumar <[email protected]>
Signed-off-by Sumit Gupta <[email protected]>
--- drivers/cpufreq/tegra194-cpufreq.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/cpufreq/tegra194-cpufreq.c +17 -0
@@ -510,6 +510,21 @@ static int tegra194_cpufreq_init(struct cpufreq_policy *policy)return 0 ; } +static int tegra194_cpufreq_online (struct cpufreq_policy *policy) +{ +/* We did light-weight tear down earlier, nothing to do here */ +return 0 ; +} + +static int tegra194_cpufreq_offline (struct cpufreq_policy *policy) +{ +/* +* Preserve policy->driver_data and don't free resources on light-weight +* tear down. +*/ +return 0 ; +} +static int tegra194_cpufreq_exit (struct cpufreq_policy *policy) {struct device *cpu_dev =get_cpu_device (policy->cpu);
@@ -548,6 +563,8 @@ static struct cpufreq_driver tegra194_cpufreq_driver = { .get = tegra194_get_speed, .init = tegra194_cpufreq_init, .exit = tegra194_cpufreq_exit, + .online = tegra194_cpufreq_online, + .offline = tegra194_cpufreq_offline, .attr = cpufreq_generic_attr, };
Signature · 1 line
2.17.1
Quoted 38 lines · Sumit Gupta
Implement the light-weight tear down and bring up helpers to reduce the amount of work to do on CPU offline/online operation.
This change helps to make the hotplugging paths much faster.Suggested-by Viresh Kumar <[email protected]>Signed-off-by Sumit Gupta <[email protected]>--- drivers/cpufreq/tegra194-cpufreq.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/cpufreq/tegra194-cpufreq.c +15
-0@@ -510,6 +510,21 @@ static int tegra194_cpufreq_init(struct cpufreq_policy *policy)return 0 ; } +static int tegra194_cpufreq_online (struct cpufreq_policy *policy) +{ +/* We did light-weight tear down earlier, nothing to do here */ +return 0 ; +} + +static int tegra194_cpufreq_offline (struct cpufreq_policy *policy) +{ +/* +* Preserve policy->driver_data and don't free resources on light-weight +* tear down. +*/ +return 0 ; +} +static int tegra194_cpufreq_exit (struct cpufreq_policy *policy) {struct device *cpu_dev =get_cpu_device (policy->cpu);
drivers/cpufreq/tegra194-cpufreq.c static struct cpufreq_driver tegra194_cpufreq_driver = { · line 569
Quoted 7 lines
drivers/cpufreq/tegra194-cpufreq.c +2
-0@@ -548,6 +563,8 @@ static struct cpufreq_driver tegra194_cpufreq_driver = { .get = tegra194_get_speed, .init = tegra194_cpufreq_init, .exit = tegra194_cpufreq_exit, + .online = tegra194_cpufreq_online, + .offline = tegra194_cpufreq_offline, .attr = cpufreq_generic_attr, };
Applied. Thanks.
Signature · 1 line
viresh