linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor
       [not found] <1347461906-13527-7-git-send-email-arnd@arndb.de>
@ 2012-09-12 23:01 ` David Brown
  2012-09-12 23:01   ` [PATCH 2/2] ARM: msm: Move core.h contents into common.h David Brown
  2012-09-13  8:47   ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor Arnd Bergmann
  0 siblings, 2 replies; 5+ messages in thread
From: David Brown @ 2012-09-12 23:01 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-arm-kernel, linux-kernel, David Brown, Arnd Bergmann,
	linux-arm-msm

From: Marc Zyngier <marc.zyngier@arm.com>

Convert MSM SMP platforms to use the SoC descriptor to provide
their SMP and CPU hotplug operations.

Cc: David Brown <davidb@codeaurora.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
This is an adaptation of this change on top of the msm-for-3.7 tree I
recently sent out a pull request for.  The only real change is to
resolve the conflicts with the simplified board files.

 arch/arm/mach-msm/board-dt-8660.c |  2 ++
 arch/arm/mach-msm/board-dt-8960.c |  2 ++
 arch/arm/mach-msm/core.h          |  2 ++
 arch/arm/mach-msm/hotplug.c       | 18 +++---------------
 arch/arm/mach-msm/platsmp.c       | 19 +++++++++++++++----
 5 files changed, 24 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm/mach-msm/core.h

diff --git a/arch/arm/mach-msm/board-dt-8660.c b/arch/arm/mach-msm/board-dt-8660.c
index f77f57f..e5643f6 100644
--- a/arch/arm/mach-msm/board-dt-8660.c
+++ b/arch/arm/mach-msm/board-dt-8660.c
@@ -20,6 +20,7 @@
 
 #include <mach/board.h>
 #include "common.h"
+#include "core.h"
 
 static const struct of_device_id msm_dt_gic_match[] __initconst = {
 	{ .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
@@ -53,6 +54,7 @@ static const char *msm8x60_fluid_match[] __initdata = {
 };
 
 DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
+	.smp = smp_ops(msm_smp_ops),
 	.map_io = msm_map_msm8x60_io,
 	.init_irq = msm8x60_init_irq,
 	.handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-msm/board-dt-8960.c b/arch/arm/mach-msm/board-dt-8960.c
index 8df99b8..139d61b 100644
--- a/arch/arm/mach-msm/board-dt-8960.c
+++ b/arch/arm/mach-msm/board-dt-8960.c
@@ -18,6 +18,7 @@
 #include <asm/mach/arch.h>
 
 #include "common.h"
+#include "core.h"
 
 static const struct of_device_id msm_dt_gic_match[] __initconst = {
 	{ .compatible = "qcom,msm-qgic2", .data = gic_of_init },
@@ -40,6 +41,7 @@ static const char * const msm8960_dt_match[] __initconst = {
 };
 
 DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)")
+	.smp = smp_ops(msm_smp_ops),
 	.map_io = msm_map_msm8960_io,
 	.init_irq = msm_dt_init_irq,
 	.timer = &msm_dt_timer,
diff --git a/arch/arm/mach-msm/core.h b/arch/arm/mach-msm/core.h
new file mode 100644
index 0000000..a9bab53
--- /dev/null
+++ b/arch/arm/mach-msm/core.h
@@ -0,0 +1,2 @@
+extern struct smp_operations msm_smp_ops;
+extern void msm_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
index a446fc1..d0f79e8 100644
--- a/arch/arm/mach-msm/hotplug.c
+++ b/arch/arm/mach-msm/hotplug.c
@@ -13,6 +13,8 @@
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
 
+#include "core.h"
+
 extern volatile int pen_release;
 
 static inline void cpu_enter_lowpower(void)
@@ -57,17 +59,12 @@ static inline void platform_do_lowpower(unsigned int cpu)
 	}
 }
 
-int platform_cpu_kill(unsigned int cpu)
-{
-	return 1;
-}
-
 /*
  * platform-specific code to shutdown a CPU
  *
  * Called with IRQs disabled
  */
-void platform_cpu_die(unsigned int cpu)
+void msm_cpu_die(unsigned int cpu)
 {
 	/*
 	 * we're ready for shutdown now, so do it
@@ -81,12 +78,3 @@ void platform_cpu_die(unsigned int cpu)
 	 */
 	cpu_leave_lowpower();
 }
-
-int platform_cpu_disable(unsigned int cpu)
-{
-	/*
-	 * we don't allow CPU 0 to be shutdown (it is still too special
-	 * e.g. clock tick interrupts)
-	 */
-	return cpu == 0 ? -EPERM : 0;
-}
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index b119f99..313bd7d 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -23,6 +23,7 @@
 #include <asm/smp_plat.h>
 
 #include "scm-boot.h"
+#include "core.h"
 
 #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
 #define SCSS_CPU1CORE_RESET 0xD80
@@ -43,7 +44,7 @@ static inline int get_core_count(void)
 	return ((read_cpuid_id() >> 4) & 3) + 1;
 }
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+static void __cpuinit msm_secondary_init(unsigned int cpu)
 {
 	/*
 	 * if any interrupts are already enabled for the primary
@@ -85,7 +86,7 @@ static __cpuinit void prepare_cold_cpu(unsigned int cpu)
 				  "address\n");
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
 	static int cold_boot_done;
@@ -145,7 +146,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
  * does not support the ARM SCU, so just set the possible cpu mask to
  * NR_CPUS.
  */
-void __init smp_init_cpus(void)
+static void __init msm_smp_init_cpus(void)
 {
 	unsigned int i, ncores = get_core_count();
 
@@ -161,6 +162,16 @@ void __init smp_init_cpus(void)
         set_smp_cross_call(gic_raise_softirq);
 }
 
-void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
 {
 }
+
+struct smp_operations msm_smp_ops __initdata = {
+	.smp_init_cpus		= msm_smp_init_cpus,
+	.smp_prepare_cpus	= msm_smp_prepare_cpus,
+	.smp_secondary_init	= msm_secondary_init,
+	.smp_boot_secondary	= msm_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_die		= msm_cpu_die,
+#endif
+};
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ARM: msm: Move core.h contents into common.h
  2012-09-12 23:01 ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor David Brown
@ 2012-09-12 23:01   ` David Brown
  2012-09-13  8:47   ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor Arnd Bergmann
  1 sibling, 0 replies; 5+ messages in thread
From: David Brown @ 2012-09-12 23:01 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: David Brown, linux-arm-kernel, linux-kernel, Arnd Bergmann,
	linux-arm-msm

No real need to have a separate core.h from the common.h file.  Fold
these two prototypes into the common header file.

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David Brown <davidb@codeaurora.org>
---
This is Stephen Boyd's suggestion to not have a separate core.h.  It
is probably best to just fold this into the previous patch.

 arch/arm/mach-msm/board-dt-8660.c | 1 -
 arch/arm/mach-msm/board-dt-8960.c | 1 -
 arch/arm/mach-msm/common.h        | 2 ++
 arch/arm/mach-msm/core.h          | 2 --
 arch/arm/mach-msm/hotplug.c       | 2 +-
 arch/arm/mach-msm/platsmp.c       | 2 +-
 6 files changed, 4 insertions(+), 6 deletions(-)
 delete mode 100644 arch/arm/mach-msm/core.h

diff --git a/arch/arm/mach-msm/board-dt-8660.c b/arch/arm/mach-msm/board-dt-8660.c
index e5643f6..b5b4de2 100644
--- a/arch/arm/mach-msm/board-dt-8660.c
+++ b/arch/arm/mach-msm/board-dt-8660.c
@@ -20,7 +20,6 @@
 
 #include <mach/board.h>
 #include "common.h"
-#include "core.h"
 
 static const struct of_device_id msm_dt_gic_match[] __initconst = {
 	{ .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
diff --git a/arch/arm/mach-msm/board-dt-8960.c b/arch/arm/mach-msm/board-dt-8960.c
index 139d61b..4490edb 100644
--- a/arch/arm/mach-msm/board-dt-8960.c
+++ b/arch/arm/mach-msm/board-dt-8960.c
@@ -18,7 +18,6 @@
 #include <asm/mach/arch.h>
 
 #include "common.h"
-#include "core.h"
 
 static const struct of_device_id msm_dt_gic_match[] __initconst = {
 	{ .compatible = "qcom,msm-qgic2", .data = gic_of_init },
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h
index d68e5d7..633a7159 100644
--- a/arch/arm/mach-msm/common.h
+++ b/arch/arm/mach-msm/common.h
@@ -26,5 +26,7 @@ extern void msm_map_qsd8x50_io(void);
 extern void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size,
 					  unsigned int mtype, void *caller);
 
+extern struct smp_operations msm_smp_ops;
+extern void msm_cpu_die(unsigned int cpu);
 
 #endif
diff --git a/arch/arm/mach-msm/core.h b/arch/arm/mach-msm/core.h
deleted file mode 100644
index a9bab53..0000000
--- a/arch/arm/mach-msm/core.h
+++ /dev/null
@@ -1,2 +0,0 @@
-extern struct smp_operations msm_smp_ops;
-extern void msm_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
index d0f79e8..3f87911 100644
--- a/arch/arm/mach-msm/hotplug.c
+++ b/arch/arm/mach-msm/hotplug.c
@@ -13,7 +13,7 @@
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
 
-#include "core.h"
+#include "common.h"
 
 extern volatile int pen_release;
 
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index 313bd7d..948f970 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -23,7 +23,7 @@
 #include <asm/smp_plat.h>
 
 #include "scm-boot.h"
-#include "core.h"
+#include "common.h"
 
 #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
 #define SCSS_CPU1CORE_RESET 0xD80
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor
  2012-09-12 23:01 ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor David Brown
  2012-09-12 23:01   ` [PATCH 2/2] ARM: msm: Move core.h contents into common.h David Brown
@ 2012-09-13  8:47   ` Arnd Bergmann
  2012-09-13 16:15     ` David Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2012-09-13  8:47 UTC (permalink / raw)
  To: David Brown; +Cc: Marc Zyngier, linux-arm-kernel, linux-kernel, linux-arm-msm

On Wednesday 12 September 2012, David Brown wrote:
> 
> From: Marc Zyngier <marc.zyngier@arm.com>
> 
> Convert MSM SMP platforms to use the SoC descriptor to provide
> their SMP and CPU hotplug operations.
> 
> Cc: David Brown <davidb@codeaurora.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> This is an adaptation of this change on top of the msm-for-3.7 tree I
> recently sent out a pull request for.  The only real change is to
> resolve the conflicts with the simplified board files.

Not sure what I'm supposed to do with this patch, it doesn't apply
unless I rebase all of the SMP patches on top of your msm-for-3.7 branch,
which would be rather odd.

I'll make sure the branches merge fine and then apply your patch 2/2
on top of the merge, ok?

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor
  2012-09-13  8:47   ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor Arnd Bergmann
@ 2012-09-13 16:15     ` David Brown
  2012-09-14  7:57       ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: David Brown @ 2012-09-13 16:15 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Marc Zyngier, linux-arm-kernel, linux-kernel, linux-arm-msm

On Thu, Sep 13, 2012 at 08:47:19AM +0000, Arnd Bergmann wrote:
> On Wednesday 12 September 2012, David Brown wrote:
> > 
> > From: Marc Zyngier <marc.zyngier@arm.com>
> > 
> > Convert MSM SMP platforms to use the SoC descriptor to provide
> > their SMP and CPU hotplug operations.
> > 
> > Cc: David Brown <davidb@codeaurora.org>
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > This is an adaptation of this change on top of the msm-for-3.7 tree I
> > recently sent out a pull request for.  The only real change is to
> > resolve the conflicts with the simplified board files.
> 
> Not sure what I'm supposed to do with this patch, it doesn't apply
> unless I rebase all of the SMP patches on top of your msm-for-3.7 branch,
> which would be rather odd.
> 
> I'll make sure the branches merge fine and then apply your patch 2/2
> on top of the merge, ok?

Yeah, it shouldn't hurt anything to just wait until both get merged
in.  The patch was mostly a heads up that your series was going to
conflict with msm changes coming in.

Olof wanted me to try and split the msm-for-3.7 into a few branches,
so I'm going to work on that this morning.  I'm not quite sure how
well it will work, since, for example, most of the cleanups are
preparing the tree for the devicetree changes.

David

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor
  2012-09-13 16:15     ` David Brown
@ 2012-09-14  7:57       ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2012-09-14  7:57 UTC (permalink / raw)
  To: David Brown; +Cc: Marc Zyngier, linux-arm-kernel, linux-kernel, linux-arm-msm

On Thursday 13 September 2012, David Brown wrote:
> Olof wanted me to try and split the msm-for-3.7 into a few branches,
> so I'm going to work on that this morning.  I'm not quite sure how
> well it will work, since, for example, most of the cleanups are
> preparing the tree for the devicetree changes.

That is the common scenario. What you should do there is to have
one cleanup branch that collects all the cleanups from the other
branches, and then base each of the other branches on top of that.

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-14  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1347461906-13527-7-git-send-email-arnd@arndb.de>
2012-09-12 23:01 ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor David Brown
2012-09-12 23:01   ` [PATCH 2/2] ARM: msm: Move core.h contents into common.h David Brown
2012-09-13  8:47   ` [PATCH 1/2] ARM: SoC: convert MSM SMP to SoC descriptor Arnd Bergmann
2012-09-13 16:15     ` David Brown
2012-09-14  7:57       ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).