summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/mcpm-exynos.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2019-03-26 15:03:59 +0100
committerKrzysztof Kozlowski <krzk@kernel.org>2019-04-09 15:07:33 +0200
commit98a3308ea864afa1e42ae546ddbe5e4641f7716c (patch)
treeb3fa50bb7519bb75521203b13fd4404a079213e2 /arch/arm/mach-exynos/mcpm-exynos.c
parent629266bf7229cd6a550075f5961f95607b823b59 (diff)
downloadlinux-stable-98a3308ea864afa1e42ae546ddbe5e4641f7716c.tar.gz
linux-stable-98a3308ea864afa1e42ae546ddbe5e4641f7716c.tar.bz2
linux-stable-98a3308ea864afa1e42ae546ddbe5e4641f7716c.zip
ARM: exynos: Fix infinite loops on CPU powerup failure
Add timeout to infinite loops during the CPU powerup procedures. It is better to report an error instead of busylooping for infinite time in case of failure. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Diffstat (limited to 'arch/arm/mach-exynos/mcpm-exynos.c')
-rw-r--r--arch/arm/mach-exynos/mcpm-exynos.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
index 72bc035bedbe..9a681b421ae1 100644
--- a/arch/arm/mach-exynos/mcpm-exynos.c
+++ b/arch/arm/mach-exynos/mcpm-exynos.c
@@ -75,14 +75,25 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
*/
if (cluster &&
cluster == MPIDR_AFFINITY_LEVEL(cpu_logical_map(0), 1)) {
+ unsigned int timeout = 16;
+
/*
* Before we reset the Little cores, we should wait
* the SPARE2 register is set to 1 because the init
* codes of the iROM will set the register after
* initialization.
*/
- while (!pmu_raw_readl(S5P_PMU_SPARE2))
+ while (timeout && !pmu_raw_readl(S5P_PMU_SPARE2)) {
+ timeout--;
udelay(10);
+ }
+
+ if (timeout == 0) {
+ pr_err("cpu %u cluster %u powerup failed\n",
+ cpu, cluster);
+ exynos_cpu_power_down(cpunr);
+ return -ETIMEDOUT;
+ }
pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
EXYNOS_SWRESET);