diff options
author | Rohit Vaswani <rvaswani@codeaurora.org> | 2013-06-21 15:17:37 -0400 |
---|---|---|
committer | Kumar Gala <galak@codeaurora.org> | 2014-02-04 17:25:04 -0500 |
commit | 52b52b4681df8bad450692cf3fa8a61ca1e1599a (patch) | |
tree | 93ed76f17d41f3e8f0125e8f0a22187552ddb034 | |
parent | cc60a1a4d47a4dea2ca04bad6f16bf43dcd5c1d6 (diff) |
ARM: msm: Remove pen_release usage
pen_release is no longer required as the synchronization
is now managed by generic arm code.
This is done as suggested in https://lkml.org/lkml/2013/6/4/184
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Kumar Gala <galak@codeaurora.org>
-rw-r--r-- | arch/arm/mach-msm/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/headsmp.S | 39 | ||||
-rw-r--r-- | arch/arm/mach-msm/hotplug.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-msm/platsmp.c | 37 |
4 files changed, 8 insertions, 101 deletions
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index 8e307a10d3c3..721f27f50d96 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile | |||
@@ -19,7 +19,7 @@ obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o | |||
19 | CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) | 19 | CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) |
20 | 20 | ||
21 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 21 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
22 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | 22 | obj-$(CONFIG_SMP) += platsmp.o |
23 | 23 | ||
24 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o | 24 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o |
25 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o | 25 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o |
diff --git a/arch/arm/mach-msm/headsmp.S b/arch/arm/mach-msm/headsmp.S deleted file mode 100644 index 6c62c3f82fe6..000000000000 --- a/arch/arm/mach-msm/headsmp.S +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/headsmp.S | ||
3 | * | ||
4 | * Copyright (c) 2003 ARM Limited | ||
5 | * All Rights Reserved | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/linkage.h> | ||
12 | #include <linux/init.h> | ||
13 | |||
14 | /* | ||
15 | * MSM specific entry point for secondary CPUs. This provides | ||
16 | * a "holding pen" into which all secondary cores are held until we're | ||
17 | * ready for them to initialise. | ||
18 | */ | ||
19 | ENTRY(msm_secondary_startup) | ||
20 | mrc p15, 0, r0, c0, c0, 5 | ||
21 | and r0, r0, #15 | ||
22 | adr r4, 1f | ||
23 | ldmia r4, {r5, r6} | ||
24 | sub r4, r4, r5 | ||
25 | add r6, r6, r4 | ||
26 | pen: ldr r7, [r6] | ||
27 | cmp r7, r0 | ||
28 | bne pen | ||
29 | |||
30 | /* | ||
31 | * we've been released from the holding pen: secondary_stack | ||
32 | * should now contain the SVC stack for this core | ||
33 | */ | ||
34 | b secondary_startup | ||
35 | ENDPROC(msm_secondary_startup) | ||
36 | |||
37 | .align | ||
38 | 1: .long . | ||
39 | .long pen_release | ||
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c index 326a87261f9a..cea80fc6e48e 100644 --- a/arch/arm/mach-msm/hotplug.c +++ b/arch/arm/mach-msm/hotplug.c | |||
@@ -24,33 +24,10 @@ static inline void cpu_leave_lowpower(void) | |||
24 | 24 | ||
25 | static inline void platform_do_lowpower(unsigned int cpu) | 25 | static inline void platform_do_lowpower(unsigned int cpu) |
26 | { | 26 | { |
27 | /* Just enter wfi for now. TODO: Properly shut off the cpu. */ | 27 | asm("wfi" |
28 | for (;;) { | 28 | : |
29 | /* | 29 | : |
30 | * here's the WFI | 30 | : "memory", "cc"); |
31 | */ | ||
32 | asm("wfi" | ||
33 | : | ||
34 | : | ||
35 | : "memory", "cc"); | ||
36 | |||
37 | if (pen_release == cpu_logical_map(cpu)) { | ||
38 | /* | ||
39 | * OK, proper wakeup, we're done | ||
40 | */ | ||
41 | break; | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * getting here, means that we have come out of WFI without | ||
46 | * having been woken up - this shouldn't happen | ||
47 | * | ||
48 | * The trouble is, letting people know about this is not really | ||
49 | * possible, since we are currently running incoherently, and | ||
50 | * therefore cannot safely call printk() or anything else | ||
51 | */ | ||
52 | pr_debug("CPU%u: spurious wakeup call\n", cpu); | ||
53 | } | ||
54 | } | 31 | } |
55 | 32 | ||
56 | /* | 33 | /* |
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c index f10a1f58fde9..3721b31ef6ae 100644 --- a/arch/arm/mach-msm/platsmp.c +++ b/arch/arm/mach-msm/platsmp.c | |||
@@ -12,13 +12,10 @@ | |||
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/jiffies.h> | ||
16 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
17 | #include <linux/io.h> | 16 | #include <linux/io.h> |
18 | 17 | ||
19 | #include <asm/cacheflush.h> | ||
20 | #include <asm/cputype.h> | 18 | #include <asm/cputype.h> |
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/smp_plat.h> | 19 | #include <asm/smp_plat.h> |
23 | 20 | ||
24 | #include "scm-boot.h" | 21 | #include "scm-boot.h" |
@@ -28,7 +25,7 @@ | |||
28 | #define SCSS_CPU1CORE_RESET 0xD80 | 25 | #define SCSS_CPU1CORE_RESET 0xD80 |
29 | #define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64 | 26 | #define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64 |
30 | 27 | ||
31 | extern void msm_secondary_startup(void); | 28 | extern void secondary_startup(void); |
32 | 29 | ||
33 | static DEFINE_SPINLOCK(boot_lock); | 30 | static DEFINE_SPINLOCK(boot_lock); |
34 | 31 | ||
@@ -41,13 +38,6 @@ static inline int get_core_count(void) | |||
41 | static void msm_secondary_init(unsigned int cpu) | 38 | static void msm_secondary_init(unsigned int cpu) |
42 | { | 39 | { |
43 | /* | 40 | /* |
44 | * let the primary processor know we're out of the | ||
45 | * pen, then head off into the C entry point | ||
46 | */ | ||
47 | pen_release = -1; | ||
48 | smp_wmb(); | ||
49 | |||
50 | /* | ||
51 | * Synchronise with the boot thread. | 41 | * Synchronise with the boot thread. |
52 | */ | 42 | */ |
53 | spin_lock(&boot_lock); | 43 | spin_lock(&boot_lock); |
@@ -57,7 +47,7 @@ static void msm_secondary_init(unsigned int cpu) | |||
57 | static void prepare_cold_cpu(unsigned int cpu) | 47 | static void prepare_cold_cpu(unsigned int cpu) |
58 | { | 48 | { |
59 | int ret; | 49 | int ret; |
60 | ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup), | 50 | ret = scm_set_boot_addr(virt_to_phys(secondary_startup), |
61 | SCM_FLAG_COLDBOOT_CPU1); | 51 | SCM_FLAG_COLDBOOT_CPU1); |
62 | if (ret == 0) { | 52 | if (ret == 0) { |
63 | void __iomem *sc1_base_ptr; | 53 | void __iomem *sc1_base_ptr; |
@@ -75,7 +65,6 @@ static void prepare_cold_cpu(unsigned int cpu) | |||
75 | 65 | ||
76 | static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle) | 66 | static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle) |
77 | { | 67 | { |
78 | unsigned long timeout; | ||
79 | static int cold_boot_done; | 68 | static int cold_boot_done; |
80 | 69 | ||
81 | /* Only need to bring cpu out of reset this way once */ | 70 | /* Only need to bring cpu out of reset this way once */ |
@@ -91,39 +80,19 @@ static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
91 | spin_lock(&boot_lock); | 80 | spin_lock(&boot_lock); |
92 | 81 | ||
93 | /* | 82 | /* |
94 | * The secondary processor is waiting to be released from | ||
95 | * the holding pen - release it, then wait for it to flag | ||
96 | * that it has been released by resetting pen_release. | ||
97 | * | ||
98 | * Note that "pen_release" is the hardware CPU ID, whereas | ||
99 | * "cpu" is Linux's internal ID. | ||
100 | */ | ||
101 | pen_release = cpu_logical_map(cpu); | ||
102 | sync_cache_w(&pen_release); | ||
103 | |||
104 | /* | ||
105 | * Send the secondary CPU a soft interrupt, thereby causing | 83 | * Send the secondary CPU a soft interrupt, thereby causing |
106 | * the boot monitor to read the system wide flags register, | 84 | * the boot monitor to read the system wide flags register, |
107 | * and branch to the address found there. | 85 | * and branch to the address found there. |
108 | */ | 86 | */ |
109 | arch_send_wakeup_ipi_mask(cpumask_of(cpu)); | 87 | arch_send_wakeup_ipi_mask(cpumask_of(cpu)); |
110 | 88 | ||
111 | timeout = jiffies + (1 * HZ); | ||
112 | while (time_before(jiffies, timeout)) { | ||
113 | smp_rmb(); | ||
114 | if (pen_release == -1) | ||
115 | break; | ||
116 | |||
117 | udelay(10); | ||
118 | } | ||
119 | |||
120 | /* | 89 | /* |
121 | * now the secondary core is starting up let it run its | 90 | * now the secondary core is starting up let it run its |
122 | * calibrations, then wait for it to finish | 91 | * calibrations, then wait for it to finish |
123 | */ | 92 | */ |
124 | spin_unlock(&boot_lock); | 93 | spin_unlock(&boot_lock); |
125 | 94 | ||
126 | return pen_release != -1 ? -ENOSYS : 0; | 95 | return 0; |
127 | } | 96 | } |
128 | 97 | ||
129 | /* | 98 | /* |