]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: mcpm: introduce helpers for platform coherency exit/setup
authorDave Martin <dave.martin@linaro.org>
Tue, 17 Jul 2012 13:25:42 +0000 (14:25 +0100)
committerNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 24 Apr 2013 14:37:00 +0000 (10:37 -0400)
commit7fe31d28e839f9565c8176ec584676a045970802
treec3fcc8b99461e1fbff13eb08f8dbec891dc1baa4
parent7c2b860534d02d11923dd0504b961f21508173f1
ARM: mcpm: introduce helpers for platform coherency exit/setup

This provides helper methods to coordinate between CPUs coming down
and CPUs going up, as well as documentation on the used algorithms,
so that cluster teardown and setup
operations are not done for a cluster simultaneously.

For use in the power_down() implementation:
  * __mcpm_cpu_going_down(unsigned int cluster, unsigned int cpu)
  * __mcpm_outbound_enter_critical(unsigned int cluster)
  * __mcpm_outbound_leave_critical(unsigned int cluster)
  * __mcpm_cpu_down(unsigned int cluster, unsigned int cpu)

The power_up_setup() helper should do platform-specific setup in
preparation for turning the CPU on, such as invalidating local caches
or entering coherency.  It must be assembler for now, since it must
run before the MMU can be switched on.  It is passed the affinity level
for which initialization should be performed.

Because the mcpm_sync_struct content is looked-up and modified
with the cache enabled or disabled depending on the code path, it is
crucial to always ensure proper cache maintenance to update main memory
right away.  The sync_cache_*() helpers are used to that end.

Also, in order to prevent a cached writer from interfering with an
adjacent non-cached writer, we ensure each state variable is located to
a separate cache line.

Thanks to Nicolas Pitre and Achin Gupta for the help with this
patch.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Documentation/arm/cluster-pm-race-avoidance.txt [new file with mode: 0644]
arch/arm/common/mcpm_entry.c
arch/arm/common/mcpm_head.S
arch/arm/include/asm/mcpm.h
arch/arm/kernel/asm-offsets.c