diff options
| author | Joel Stanley <joel@jms.id.au> | 2019-04-03 15:14:26 +1030 |
|---|---|---|
| committer | Joel Stanley <joel@jms.id.au> | 2019-04-03 15:14:30 +1030 |
| commit | 6931e7553b61cd4e9f20f2f230fc5cd54d160e86 (patch) | |
| tree | b9f13b1c2d222a1ae499bba94d4b9447cb5fac3d /arch/arm | |
| parent | 1fd5e60554e7194f8adc526e985714b9fc25c78d (diff) | |
| parent | 820c1fa515010d280551075da59fc2668ba8b3ae (diff) | |
| download | talos-obmc-linux-6931e7553b61cd4e9f20f2f230fc5cd54d160e86.tar.gz talos-obmc-linux-6931e7553b61cd4e9f20f2f230fc5cd54d160e86.zip | |
Merge tag 'v5.0.6' into dev-5.0
This is the 5.0.6 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'arch/arm')
| -rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6q.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index bfeb25aaf9a2..326e870d7123 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c @@ -16,30 +16,23 @@ #include "cpuidle.h" #include "hardware.h" -static atomic_t master = ATOMIC_INIT(0); -static DEFINE_SPINLOCK(master_lock); +static int num_idle_cpus = 0; +static DEFINE_SPINLOCK(cpuidle_lock); static int imx6q_enter_wait(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - if (atomic_inc_return(&master) == num_online_cpus()) { - /* - * With this lock, we prevent other cpu to exit and enter - * this function again and become the master. - */ - if (!spin_trylock(&master_lock)) - goto idle; + spin_lock(&cpuidle_lock); + if (++num_idle_cpus == num_online_cpus()) imx6_set_lpm(WAIT_UNCLOCKED); - cpu_do_idle(); - imx6_set_lpm(WAIT_CLOCKED); - spin_unlock(&master_lock); - goto done; - } + spin_unlock(&cpuidle_lock); -idle: cpu_do_idle(); -done: - atomic_dec(&master); + + spin_lock(&cpuidle_lock); + if (num_idle_cpus-- == num_online_cpus()) + imx6_set_lpm(WAIT_CLOCKED); + spin_unlock(&cpuidle_lock); return index; } |

