b6e9bbac57264b5eff4b3c08269a9b743b735b70
[openwrt/staging/mkresin.git] / target / linux / ipq806x / patches / 0003-ARM-msm-kill-off-hotplug.c.patch
1 From b5a3a19e3efa6238c6a00a8f36a8ab2c25eeebc3 Mon Sep 17 00:00:00 2001
2 From: Kumar Gala <galak@codeaurora.org>
3 Date: Fri, 31 Jan 2014 13:48:29 -0600
4 Subject: [PATCH 003/182] ARM: msm: kill off hotplug.c
5
6 Right now hotplug.c only really implements msm_cpu_die as a wfi. Just
7 move that implementation into platsmp.c. At the same time we use the
8 existing wfi() instead of inline asm.
9
10 Signed-off-by: Kumar Gala <galak@codeaurora.org>
11 ---
12 arch/arm/mach-msm/Makefile | 1 -
13 arch/arm/mach-msm/common.h | 1 -
14 arch/arm/mach-msm/hotplug.c | 51 -------------------------------------------
15 arch/arm/mach-msm/platsmp.c | 7 ++++++
16 4 files changed, 7 insertions(+), 53 deletions(-)
17 delete mode 100644 arch/arm/mach-msm/hotplug.c
18
19 diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
20 index 721f27f..8327f60 100644
21 --- a/arch/arm/mach-msm/Makefile
22 +++ b/arch/arm/mach-msm/Makefile
23 @@ -18,7 +18,6 @@ obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
24
25 CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
26
27 -obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
28 obj-$(CONFIG_SMP) += platsmp.o
29
30 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
31 diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h
32 index 33c7725..0a4899b 100644
33 --- a/arch/arm/mach-msm/common.h
34 +++ b/arch/arm/mach-msm/common.h
35 @@ -24,7 +24,6 @@ extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
36 unsigned int mtype, void *caller);
37
38 extern struct smp_operations msm_smp_ops;
39 -extern void msm_cpu_die(unsigned int cpu);
40
41 struct msm_mmc_platform_data;
42
43 diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
44 deleted file mode 100644
45 index cea80fc..0000000
46 --- a/arch/arm/mach-msm/hotplug.c
47 +++ /dev/null
48 @@ -1,51 +0,0 @@
49 -/*
50 - * Copyright (C) 2002 ARM Ltd.
51 - * All Rights Reserved
52 - *
53 - * This program is free software; you can redistribute it and/or modify
54 - * it under the terms of the GNU General Public License version 2 as
55 - * published by the Free Software Foundation.
56 - */
57 -#include <linux/kernel.h>
58 -#include <linux/errno.h>
59 -#include <linux/smp.h>
60 -
61 -#include <asm/smp_plat.h>
62 -
63 -#include "common.h"
64 -
65 -static inline void cpu_enter_lowpower(void)
66 -{
67 -}
68 -
69 -static inline void cpu_leave_lowpower(void)
70 -{
71 -}
72 -
73 -static inline void platform_do_lowpower(unsigned int cpu)
74 -{
75 - asm("wfi"
76 - :
77 - :
78 - : "memory", "cc");
79 -}
80 -
81 -/*
82 - * platform-specific code to shutdown a CPU
83 - *
84 - * Called with IRQs disabled
85 - */
86 -void __ref msm_cpu_die(unsigned int cpu)
87 -{
88 - /*
89 - * we're ready for shutdown now, so do it
90 - */
91 - cpu_enter_lowpower();
92 - platform_do_lowpower(cpu);
93 -
94 - /*
95 - * bring this CPU back into the world of cache
96 - * coherency, and then restore interrupts
97 - */
98 - cpu_leave_lowpower();
99 -}
100 diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
101 index 3721b31..251a91e 100644
102 --- a/arch/arm/mach-msm/platsmp.c
103 +++ b/arch/arm/mach-msm/platsmp.c
104 @@ -29,6 +29,13 @@ extern void secondary_startup(void);
105
106 static DEFINE_SPINLOCK(boot_lock);
107
108 +#ifdef CONFIG_HOTPLUG_CPU
109 +static void __ref msm_cpu_die(unsigned int cpu)
110 +{
111 + wfi();
112 +}
113 +#endif
114 +
115 static inline int get_core_count(void)
116 {
117 /* 1 + the PART[1:0] field of MIDR */
118 --
119 1.7.10.4
120