summaryrefslogtreecommitdiff
path: root/arch/arm/mach-exynos/platsmp.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2019-03-26 17:03:59 +0300
committerKrzysztof Kozlowski <krzk@kernel.org>2019-04-09 16:07:33 +0300
commit98a3308ea864afa1e42ae546ddbe5e4641f7716c (patch)
treeb3fa50bb7519bb75521203b13fd4404a079213e2 /arch/arm/mach-exynos/platsmp.c
parent629266bf7229cd6a550075f5961f95607b823b59 (diff)
downloadlinux-98a3308ea864afa1e42ae546ddbe5e4641f7716c.tar.xz
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/platsmp.c')
-rw-r--r--arch/arm/mach-exynos/platsmp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index abcac6164233..0cbbae8bf1f8 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -214,13 +214,20 @@ static inline void __iomem *cpu_boot_reg(int cpu)
*/
void exynos_core_restart(u32 core_id)
{
+ unsigned int timeout = 16;
u32 val;
if (!of_machine_is_compatible("samsung,exynos3250"))
return;
- while (!pmu_raw_readl(S5P_PMU_SPARE2))
+ while (timeout && !pmu_raw_readl(S5P_PMU_SPARE2)) {
+ timeout--;
udelay(10);
+ }
+ if (timeout == 0) {
+ pr_err("cpu core %u restart failed\n", core_id);
+ return;
+ }
udelay(10);
val = pmu_raw_readl(EXYNOS_ARM_CORE_STATUS(core_id));