Skip to content

Commit de0e85b

Browse files
Sumit Guptavireshk
authored andcommitted
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: f41e144 ("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>
1 parent 03997da commit de0e85b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/cpufreq/tegra194-cpufreq.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,17 @@ static int tegra194_cpufreq_offline(struct cpufreq_policy *policy)
520520
* Preserve policy->driver_data and don't free resources on light-weight
521521
* tear down.
522522
*/
523+
524+
return 0;
525+
}
526+
527+
static int tegra194_cpufreq_exit(struct cpufreq_policy *policy)
528+
{
529+
struct device *cpu_dev = get_cpu_device(policy->cpu);
530+
531+
dev_pm_opp_remove_all_dynamic(cpu_dev);
532+
dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
533+
523534
return 0;
524535
}
525536

@@ -550,6 +561,7 @@ static struct cpufreq_driver tegra194_cpufreq_driver = {
550561
.target_index = tegra194_cpufreq_set_target,
551562
.get = tegra194_get_speed,
552563
.init = tegra194_cpufreq_init,
564+
.exit = tegra194_cpufreq_exit,
553565
.online = tegra194_cpufreq_online,
554566
.offline = tegra194_cpufreq_offline,
555567
.attr = cpufreq_generic_attr,

0 commit comments

Comments
 (0)