summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Gupta <sumitg@nvidia.com>2023-08-25 16:49:20 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2023-08-28 11:43:54 +0530
commita3aa97be69a7cc14ddc2bb0add0b9c51cb74bf83 (patch)
tree47bd474116b7f99ad3d5d863056a393d219c7340
parent5f19d0969a9a29cff7fbbb0f758c9246e3f6beaf (diff)
downloadlinux-stable-a3aa97be69a7cc14ddc2bb0add0b9c51cb74bf83.tar.gz
linux-stable-a3aa97be69a7cc14ddc2bb0add0b9c51cb74bf83.tar.bz2
linux-stable-a3aa97be69a7cc14ddc2bb0add0b9c51cb74bf83.zip
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>
-rw-r--r--drivers/cpufreq/tegra194-cpufreq.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c
index c90b30469165..88df7e5a0573 100644
--- a/drivers/cpufreq/tegra194-cpufreq.c
+++ b/drivers/cpufreq/tegra194-cpufreq.c
@@ -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)
{
@@ -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,
};