Skip to content

Commit

Permalink
cpufreq: tegra194: add online/offline hooks
Browse files Browse the repository at this point in the history
[ Upstream commit a3aa97b ]

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]>
Link: https://lore.kernel.org/lkml/20230816033402.3abmugb5goypvllm@vireshk-i7/
[ Viresh: Fixed rebase conflict ]
Signed-off-by: Viresh Kumar <[email protected]>
Stable-dep-of: de0e85b ("cpufreq: tegra194: remove opp table in exit hook")
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Sumit Gupta authored and gregkh committed Sep 13, 2023
1 parent bf6b336 commit 88dbf43
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/cpufreq/tegra194-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,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_set_target(struct cpufreq_policy *policy,
unsigned int index)
{
Expand Down Expand Up @@ -535,6 +550,8 @@ static struct cpufreq_driver tegra194_cpufreq_driver = {
.target_index = tegra194_cpufreq_set_target,
.get = tegra194_get_speed,
.init = tegra194_cpufreq_init,
.online = tegra194_cpufreq_online,
.offline = tegra194_cpufreq_offline,
.attr = cpufreq_generic_attr,
};

Expand Down

0 comments on commit 88dbf43

Please sign in to comment.