ARM: vexpress: refine MCPM smp operations override criteria
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 23 Sep 2016 13:09:06 +0000 (14:09 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 17 Oct 2016 13:27:54 +0000 (14:27 +0100)
commit525d4015e633027c93645208a9bb9a6ce8d3f5a6
tree055dda355c3e1fec6f9836cf8a28233f213d11c7
parent1001354ca34179f3db924eb66672442a173147dc
ARM: vexpress: refine MCPM smp operations override criteria

Current vexpress smp init code detects whether to override the
default smp ops with MCPM smp ops by matching the "cci-400"
compatible string, in that MCPM requires control over CCI ports
to manage low-power states entry/exit.

The "cci-400" compatible string check is a necessary but not
sufficient condition for MCPM to work, because the cci-400
can be made visible to the kernel, but firmware can nonetheless
disable non-secure CCI ports control, while still allowing PMU
access; if booted in non-secure world, the kernel would still
blindly override smp operations with MCPM operations, resulting
in kernel faults when the CCI ports programming interface is
accessed from non-secure world.

This means that the "cci-400" compatible string check would
result in a false positive in systems that eg boot in HYP mode,
where CCI ports non-secure access is explicitly not allowed,
and it is reported in the respective device tree nodes with
CCI ports marked as disabled.

Refactor the smp operations initialization to make sure that
the kernel is actually allowed to take control over CCI ports
(by enabling MCPM smp operations) before overriding default
vexpress smp operations.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
arch/arm/mach-vexpress/platsmp.c