Skip to content

Commit a3aa97b

Browse files
Sumit Guptavireshk
authored andcommitted
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 <viresh.kumar@linaro.org> Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Link: https://lore.kernel.org/lkml/20230816033402.3abmugb5goypvllm@vireshk-i7/ [ Viresh: Fixed rebase conflict ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 5f19d09 commit a3aa97b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/cpufreq/tegra194-cpufreq.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,21 @@ static int tegra194_cpufreq_init(struct cpufreq_policy *policy)
508508
return 0;
509509
}
510510

511+
static int tegra194_cpufreq_online(struct cpufreq_policy *policy)
512+
{
513+
/* We did light-weight tear down earlier, nothing to do here */
514+
return 0;
515+
}
516+
517+
static int tegra194_cpufreq_offline(struct cpufreq_policy *policy)
518+
{
519+
/*
520+
* Preserve policy->driver_data and don't free resources on light-weight
521+
* tear down.
522+
*/
523+
return 0;
524+
}
525+
511526
static int tegra194_cpufreq_set_target(struct cpufreq_policy *policy,
512527
unsigned int index)
513528
{
@@ -535,6 +550,8 @@ static struct cpufreq_driver tegra194_cpufreq_driver = {
535550
.target_index = tegra194_cpufreq_set_target,
536551
.get = tegra194_get_speed,
537552
.init = tegra194_cpufreq_init,
553+
.online = tegra194_cpufreq_online,
554+
.offline = tegra194_cpufreq_offline,
538555
.attr = cpufreq_generic_attr,
539556
};
540557

0 commit comments

Comments
 (0)