aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Gupta <sumitg@nvidia.com>2023-08-25 16:46:17 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2023-08-28 15:45:24 +0530
commitde0e85b29edfc68046d587c7d67bbd2bdc31b73f (patch)
tree2f890bc3d1f4b867ba40b95d679a093d4101e717
parent03997da042dac73c69e60d91942c727c76828b65 (diff)
downloadcloudkernel-de0e85b29edfc68046d587c7d67bbd2bdc31b73f.tar.gz
cpufreq: tegra194: remove opp table in exit hook
Add exit hook and remove OPP table when the device gets unregistered. This will fix the error messages when the CPU FREQ driver module is removed and then re-inserted. It also fixes these messages while onlining the first CPU from a policy whose all CPU's were previously offlined. debugfs: File 'cpu5' in directory 'opp' already present! debugfs: File 'cpu6' in directory 'opp' already present! debugfs: File 'cpu7' in directory 'opp' already present! Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Signed-off-by: Sumit Gupta <sumitg@nvidia.com> [ Viresh: Dropped irrelevant change from it ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rw-r--r--drivers/cpufreq/tegra194-cpufreq.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c
index 88df7e5a057306..88ef5e57ccd05c 100644
--- a/drivers/cpufreq/tegra194-cpufreq.c
+++ b/drivers/cpufreq/tegra194-cpufreq.c
@@ -520,6 +520,17 @@ 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);
+
+ dev_pm_opp_remove_all_dynamic(cpu_dev);
+ dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
+
return 0;
}
@@ -550,6 +561,7 @@ static struct cpufreq_driver tegra194_cpufreq_driver = {
.target_index = tegra194_cpufreq_set_target,
.get = tegra194_get_speed,
.init = tegra194_cpufreq_init,
+ .exit = tegra194_cpufreq_exit,
.online = tegra194_cpufreq_online,
.offline = tegra194_cpufreq_offline,
.attr = cpufreq_generic_attr,