VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Viresh Kumar <viresh.kumar@linaro.org> 2018-08-03 07:05:21 +0530 committer: Viresh Kumar <viresh.kumar@linaro.org> 2018-09-19 14:56:40 -0700 commit: 3d2556992a878a2210d3be498416aee39e0c32aa parent: 404b1369ea26f598b96ae4d3183262a879703cfe
Commit Summary:
OPP: Protect dev_list with opp_table lock
Diffstat:
1 file changed, 2 insertions, 0 deletions
diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c
index 2eb5e2e7ff66..36586f66cd83 100644
--- a/drivers/opp/cpu.c
+++ b/drivers/opp/cpu.c
@@ -226,8 +226,10 @@ int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
 	cpumask_clear(cpumask);
 
 	if (opp_table->shared_opp == OPP_TABLE_ACCESS_SHARED) {
+		mutex_lock(&opp_table->lock);
 		list_for_each_entry(opp_dev, &opp_table->dev_list, node)
 			cpumask_set_cpu(opp_dev->dev->id, cpumask);
+		mutex_unlock(&opp_table->lock);
 	} else {
 		cpumask_set_cpu(cpu_dev->id, cpumask);
 	}