ARM: vexpress: fix CPU idle C1 state enablement

This patch defines C1 as disabled by default on TC2. If the state is
later enabled but deep shutdown states are required to be enabled on
a cluster basis, a coupled barrier must be added to the coupled enter
function so that coupled CPUs cannot exit the polling C1 state while
other ones are still entering.

This patch fixes a race in C1 code where one CPU exits a coupled
C-state while another one, part of the coupled mask is still
selecting the coupled C-state value. This can cause some CPUs to
select the -1 state index which triggers an undefined instruction fault.

The added coupled C-state barrier fixes the issue by forcing coupled
C-states to be entered and exited at the same time by all CPUs even
if cluster shutdown is disabled.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
1 file changed