MLK-14874 ARM: imx7d: Ensure ARM clock only disabled if cpus in same state
authorLeonard Crestez <leonard.crestez@nxp.com>
Thu, 25 May 2017 13:51:57 +0000 (16:51 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:26 +0000 (15:22 -0500)
commit622aedddad5fc19cbbf0d974693e7c660c789dd4
treeb2738a7d0bfbbe707bb41e4ca616831ef70e78f9
parent57c1ecc40cbb1d572efe924ae6555dba1809ca4c
MLK-14874 ARM: imx7d: Ensure ARM clock only disabled if cpus in same state

GPC will stop ARM clock if both CPUs are in idle and CPU_CLK_ON_LPM is
set in GPC_LPCR_A7_BSC. Make sure that doesn't happen when cpu1 enters
state2 and cpu0 enters state0 because the default arm WFI state is not
marked with CPUIDLE_FLAG_TIMER_STOP and it can result in arch_sys_timer
being stopped unexpectedly.

It is possible to reproduce incorrect behavior by explicitly disabling
other idle states for cpu0/cpu1 and timing how much sleep calls take on
cpu0. Ocassionaly something like "sleep 1" will take 3-4 seconds to
complete.

Make sure that both CPUs are in the same idle state before entering
WAIT.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
arch/arm/mach-imx/cpuidle-imx7d.c