aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-02-27 04:13:38 -0500
committerArnd Bergmann <arnd@arndb.de>2017-03-02 11:53:17 -0500
commit3131d970f0d86bea41811766d55fc638e382daf3 (patch)
tree81be3e19d388f0b874dbbdf24bd17e211e23e859
parentd4b80d9aacfa760cf0f363caec33b6d54f3afa2b (diff)
ARM: ux500: resume the second core properly
The pen hold/release scheme was copied over to Ux500 from the ARM reference designs like most of these at the time. It is not needed at all, and was mostly removed in commit c00def71efd9 "ARM: ux500: simplify secondary CPU boot". However on the suspend/resume path and hot plug/unplug of CPUs, the .cpu_die() callback was still waiting for the pen to be released which made it spin forever and the second core never come back online after suspend/resume. Fix this by simply replacing the strange custom .cpu_die() with a oneline wfi() just like e.g. the qcom platform does. This fixes the issue and makes the second core come up properly after suspend/resume. As a side effect, this rids us of the completely surplus local setup.h and hotplug.c files, and we just compile this into platsmp.c with everything else SMP. Cc: stable@vger.kernel.org Fixes: c00def71efd9 ("ARM: ux500: simplify secondary CPU boot") Cc: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/mach-ux500/Makefile3
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c2
-rw-r--r--arch/arm/mach-ux500/hotplug.c37
-rw-r--r--arch/arm/mach-ux500/platsmp.c9
-rw-r--r--arch/arm/mach-ux500/setup.h16
5 files changed, 7 insertions, 60 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index c2499bff4986..a9a3453548f4 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -5,7 +5,4 @@
5obj-y := pm.o 5obj-y := pm.o
6obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o 6obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o
7obj-$(CONFIG_SMP) += platsmp.o 7obj-$(CONFIG_SMP) += platsmp.o
8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
9obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o 8obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
10
11CFLAGS_hotplug.o += -march=armv7-a
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 24529cf58df6..28083ef72819 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -31,8 +31,6 @@
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33 33
34#include "setup.h"
35
36#include "db8500-regs.h" 34#include "db8500-regs.h"
37 35
38static int __init ux500_l2x0_unlock(void) 36static int __init ux500_l2x0_unlock(void)
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c
deleted file mode 100644
index 1cbed0331fd3..000000000000
--- a/arch/arm/mach-ux500/hotplug.c
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Copyright (C) STMicroelectronics 2009
3 * Copyright (C) ST-Ericsson SA 2010
4 *
5 * License Terms: GNU General Public License v2
6 * Based on ARM realview platform
7 *
8 * Author: Sundar Iyer <sundar.iyer@stericsson.com>
9 *
10 */
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/smp.h>
14
15#include <asm/smp_plat.h>
16
17#include "setup.h"
18
19/*
20 * platform-specific code to shutdown a CPU
21 *
22 * Called with IRQs disabled
23 */
24void ux500_cpu_die(unsigned int cpu)
25{
26 /* directly enter low power state, skipping secure registers */
27 for (;;) {
28 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
29 : : : "memory");
30 if (pen_release == cpu_logical_map(cpu)) {
31 /*
32 * OK, proper wakeup, we're done
33 */
34 break;
35 }
36 }
37}
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index e0ee139fdebf..19c165aeecd2 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -23,8 +23,6 @@
23#include <asm/smp_plat.h> 23#include <asm/smp_plat.h>
24#include <asm/smp_scu.h> 24#include <asm/smp_scu.h>
25 25
26#include "setup.h"
27
28#include "db8500-regs.h" 26#include "db8500-regs.h"
29 27
30/* Magic triggers in backup RAM */ 28/* Magic triggers in backup RAM */
@@ -90,6 +88,13 @@ static int ux500_boot_secondary(unsigned int cpu, struct task_struct *idle)
90 return 0; 88 return 0;
91} 89}
92 90
91#ifdef CONFIG_HOTPLUG_CPU
92void ux500_cpu_die(unsigned int cpu)
93{
94 wfi();
95}
96#endif
97
93static const struct smp_operations ux500_smp_ops __initconst = { 98static const struct smp_operations ux500_smp_ops __initconst = {
94 .smp_prepare_cpus = ux500_smp_prepare_cpus, 99 .smp_prepare_cpus = ux500_smp_prepare_cpus,
95 .smp_boot_secondary = ux500_boot_secondary, 100 .smp_boot_secondary = ux500_boot_secondary,
diff --git a/arch/arm/mach-ux500/setup.h b/arch/arm/mach-ux500/setup.h
deleted file mode 100644
index 988e7c77068d..000000000000
--- a/arch/arm/mach-ux500/setup.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * These symbols are needed for board-specific files to call their
9 * own cpu-specific files
10 */
11#ifndef __ASM_ARCH_SETUP_H
12#define __ASM_ARCH_SETUP_H
13
14extern void ux500_cpu_die(unsigned int cpu);
15
16#endif /* __ASM_ARCH_SETUP_H */