aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/mcpm_entry.c
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2013-10-01 14:58:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-29 07:07:15 -0400
commit0de0d64675259bf21d06b18985318ffb66a5218f (patch)
tree06f797f0632d681d537e867d1e6a1bc69a9fa135 /arch/arm/common/mcpm_entry.c
parent1e5660999aa7703654ec345caaf06b83415dbdff (diff)
ARM: 7848/1: mcpm: Implement cpu_kill() to synchronise on powerdown
CPU hotplug and kexec rely on smp_ops.cpu_kill(), which is supposed to wait for the CPU to park or power down, and perform the last rites (such as disabling clocks etc., where the platform doesn't do this automatically). kexec in particular is unsafe without performing this synchronisation to park secondaries. Without it, the secondaries might not be parked when kexec trashes the kernel. There is no generic way to do this synchronisation, so a new mcpm platform_ops method power_down_finish() is added by this patch. The new method is mandatory. A platform which provides no way to detect when CPUs are parked is likely broken. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Reviewed-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/mcpm_entry.c')
-rw-r--r--arch/arm/common/mcpm_entry.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c
index 990250965f2c..6c03d0152e7f 100644
--- a/arch/arm/common/mcpm_entry.c
+++ b/arch/arm/common/mcpm_entry.c
@@ -90,6 +90,21 @@ void mcpm_cpu_power_down(void)
90 BUG(); 90 BUG();
91} 91}
92 92
93int mcpm_cpu_power_down_finish(unsigned int cpu, unsigned int cluster)
94{
95 int ret;
96
97 if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down_finish))
98 return -EUNATCH;
99
100 ret = platform_ops->power_down_finish(cpu, cluster);
101 if (ret)
102 pr_warn("%s: cpu %u, cluster %u failed to power down (%d)\n",
103 __func__, cpu, cluster, ret);
104
105 return ret;
106}
107
93void mcpm_cpu_suspend(u64 expected_residency) 108void mcpm_cpu_suspend(u64 expected_residency)
94{ 109{
95 phys_reset_t phys_reset; 110 phys_reset_t phys_reset;