ARM: tegra: power: Lock force_policy_max update
Alex Frid [Fri, 7 Oct 2011 04:19:40 +0000 (21:19 -0700)]
(cherry picked from commit dc2f416df4664f5ddeba6f14f41cd6bcd717abab)
(cherry picked from commit caa79c7d6219231d02260ae91876eff4f411dee8)

Change-Id: I29eb42c73a7e3cd3f401e8b5d44bcf3f06478c2c
Reviewed-on: http://git-master/r/61021
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

Rebase-Id: Ref5015bb8336d8106c80fa390911ff0371b3ec57

arch/arm/mach-tegra/cpu-tegra.c

index 6ec80fc..968a527 100644 (file)
@@ -59,11 +59,13 @@ static int force_policy_max_set(const char *arg, const struct kernel_param *kp)
        int ret;
        bool old_policy = force_policy_max;
 
-       ret = param_set_bool(arg, kp);
+       mutex_lock(&tegra_cpu_lock);
 
+       ret = param_set_bool(arg, kp);
        if ((ret == 0) && (old_policy != force_policy_max))
                tegra_cpu_set_speed_cap(NULL);
 
+       mutex_unlock(&tegra_cpu_lock);
        return ret;
 }