soc: cpupm: fix race condition when call at the same time.
authorSoohyun Kim <soohyuni.kim@samsung.com>
Tue, 3 Apr 2018 06:05:02 +0000 (15:05 +0900)
committerChungwoo Park <cww.park@samsung.com>
Wed, 23 May 2018 10:52:34 +0000 (19:52 +0900)
Change-Id: If5fd174b48e79e4aae7180d1558b014d53cb2e22
Signed-off-by: Soohyun Kim <soohyuni.kim@samsung.com>
drivers/soc/samsung/exynos-cpupm.c

index fc2c7affab0878bb2cb567ef34977ab6d9860fb7..0b5525492d769978ce730c15fda615e8c6214a49 100644 (file)
@@ -483,7 +483,7 @@ void disable_power_mode(int cpu, int type)
                         * The first mode disable request wakes the cpus to
                         * exit power mode
                         */
-                       if (atomic_inc_return(&mode->disable) == 1) {
+                       if (atomic_inc_return(&mode->disable) > 0) {
                                spin_unlock(&cpupm_lock);
                                awake_cpus(&mode->siblings);
                                return;