]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 7842/1: MCPM: don't explode if invoked without being initialized first
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 25 Sep 2013 22:26:24 +0000 (23:26 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 3 Oct 2013 09:36:37 +0000 (10:36 +0100)
commit3380476c447fe8854347ec0ce8fad766846e47ed
tree61aa1f92ae839e1afb3e37b0f68375506bf55088
parentbc0348379605195ba53680628ae3106552ff46d1
ARM: 7842/1: MCPM: don't explode if invoked without being initialized first

Currently mcpm_cpu_power_down() and mcpm_cpu_suspend() trigger BUG()
if mcpm_platform_register() is not called beforehand.  This may occur
for many reasons such as some incomplete device tree passed to the kernel
or the like.

Let's be nicer to users and avoid killing the kernel if that happens by
logging a warning and returning to the caller.  The mcpm_cpu_suspend()
user is already set to deal with this situation, and so is cpu_die()
invoking mcpm_cpu_die().

The problematic case would have been the B.L switcher's usage of
mcpm_cpu_power_down(), however it has to call mcpm_cpu_power_up() first
which is already set to catch an error resulting from a missing
mcpm_platform_register() call.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/common/mcpm_entry.c
arch/arm/include/asm/mcpm.h