summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-01-18 13:41:09 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2012-02-22 18:36:43 +0000
commitb6f188611659d167b6284d43116b9b2ea542cacf (patch)
tree83c36d160d91496740248e71c38aaf8ae86eca7d /arch
parentbb54447ace2ee892982f0f576307998d84bf854a (diff)
ARM: hotplug: Introduce dummy_cpu_disable
Most platforms don't implement their cpu_disable method. Some because they simply don't offer the capability, some other because nobody cared enough to implement the necessary code. Either way, this code is duplicated all over the place. Implement a global dummy_cpu_disable method and convert all SMP (but shmobile) to use it. Hopefully the "dummy" prefix will be an insentive for people to do the right thing.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/smp_plat.h1
-rw-r--r--arch/arm/kernel/smp.c9
-rw-r--r--arch/arm/mach-exynos/common.h1
-rw-r--r--arch/arm/mach-exynos/hotplug.c9
-rw-r--r--arch/arm/mach-exynos/platsmp.c2
-rw-r--r--arch/arm/mach-highbank/core.h1
-rw-r--r--arch/arm/mach-highbank/hotplug.c9
-rw-r--r--arch/arm/mach-highbank/platsmp.c2
-rw-r--r--arch/arm/mach-imx/hotplug.c9
-rw-r--r--arch/arm/mach-imx/platsmp.c2
-rw-r--r--arch/arm/mach-msm/core.h1
-rw-r--r--arch/arm/mach-msm/hotplug.c9
-rw-r--r--arch/arm/mach-msm/platsmp.c2
-rw-r--r--arch/arm/mach-omap2/common.h1
-rw-r--r--arch/arm/mach-omap2/omap-hotplug.c9
-rw-r--r--arch/arm/mach-omap2/omap-smp.c2
-rw-r--r--arch/arm/mach-realview/core.h1
-rw-r--r--arch/arm/mach-realview/hotplug.c9
-rw-r--r--arch/arm/mach-realview/platsmp.c2
-rw-r--r--arch/arm/mach-tegra/common.h1
-rw-r--r--arch/arm/mach-tegra/hotplug.c9
-rw-r--r--arch/arm/mach-tegra/platsmp.c2
-rw-r--r--arch/arm/mach-ux500/hotplug.c9
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h1
-rw-r--r--arch/arm/mach-ux500/platsmp.c2
-rw-r--r--arch/arm/mach-vexpress/core.h1
-rw-r--r--arch/arm/mach-vexpress/hotplug.c9
-rw-r--r--arch/arm/mach-vexpress/platsmp.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h1
29 files changed, 19 insertions, 99 deletions
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
index 8b2ffe2f3d84..f43d0399f4e1 100644
--- a/arch/arm/include/asm/smp_plat.h
+++ b/arch/arm/include/asm/smp_plat.h
@@ -51,5 +51,6 @@ extern int __cpu_logical_map[];
/* Only use this if your platform doesn't have any CPU PM */
extern int dummy_cpu_kill(unsigned int cpu);
+extern int dummy_cpu_disable(unsigned int cpu);
#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index eabd6b831b11..e0d1622c13c1 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -184,6 +184,15 @@ int dummy_cpu_kill(unsigned int cpu)
return 1;
}
+int dummy_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;
+}
+
static int __cpuinit platform_cpu_kill(unsigned int cpu)
{
if (soc_smp_ops && soc_smp_ops->cpu_kill)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 9046df86dac1..f13631a9bfa2 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -32,7 +32,6 @@ extern struct arm_soc_smp_ops exynos4_soc_smp_ops;
extern struct arm_soc_desc exynos4_soc_desc;
extern void exynos4_cpu_die(unsigned int cpu);
-extern int exynos4_cpu_disable(unsigned int cpu);
#ifdef CONFIG_ARCH_EXYNOS
extern int exynos_init(void);
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 1235df1f3999..be7a96b7f0cc 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -120,12 +120,3 @@ void exynos4_cpu_die(unsigned int cpu)
if (spurious)
pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
}
-
-int exynos4_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-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index b263e6399aa9..4d22c2a7a1b8 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -209,6 +209,6 @@ struct arm_soc_smp_ops exynos4_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = exynos4_cpu_die,
- .cpu_disable = exynos4_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
index 115793e765c2..7f4aaca971c6 100644
--- a/arch/arm/mach-highbank/core.h
+++ b/arch/arm/mach-highbank/core.h
@@ -11,7 +11,6 @@ static inline void highbank_lluart_map_io(void) {}
#endif
extern void highbank_cpu_die(unsigned int cpu);
-extern int highbank_cpu_disable(unsigned int cpu);
extern struct arm_soc_smp_init_ops highbank_soc_smp_init_ops;
extern struct arm_soc_smp_ops highbank_soc_smp_ops;
diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c
index 6fda597d9907..1277da30e58f 100644
--- a/arch/arm/mach-highbank/hotplug.c
+++ b/arch/arm/mach-highbank/hotplug.c
@@ -40,12 +40,3 @@ void highbank_cpu_die(unsigned int cpu)
/* We should never return from idle */
panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
}
-
-int highbank_cpu_disable(unsigned int cpu)
-{
- /*
- * CPU0 should not be shut down via hotplug. cpu_idle can WFI
- * or a proper shutdown or hibernate should be used.
- */
- return cpu == 0 ? -EPERM : 0;
-}
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
index b90ad838b2b3..789147d4273d 100644
--- a/arch/arm/mach-highbank/platsmp.c
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -89,6 +89,6 @@ struct arm_soc_smp_ops highbank_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = highbank_cpu_die,
- .cpu_disable = highbank_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c
index 7e75f8ed8a6c..63d5144cdf15 100644
--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -28,12 +28,3 @@ void imx_cpu_die(unsigned int cpu)
/* We should never return from idle */
panic("cpu %d unexpectedly exit from shutdown\n", cpu);
}
-
-int imx_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-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 64d9c9eb189f..2fea1e32ba4d 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -97,6 +97,6 @@ struct arm_soc_smp_ops imx_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = imx_cpu_die,
- .cpu_disable = imx_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-msm/core.h b/arch/arm/mach-msm/core.h
index 533130d6af57..623474a31fea 100644
--- a/arch/arm/mach-msm/core.h
+++ b/arch/arm/mach-msm/core.h
@@ -5,4 +5,3 @@ extern struct arm_soc_smp_ops msm_soc_smp_ops;
extern struct arm_soc_desc msm_soc_desc;
extern void msm_cpu_die(unsigned int cpu);
-extern int msm_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
index 5f09e5a16e30..d0f79e8467e6 100644
--- a/arch/arm/mach-msm/hotplug.c
+++ b/arch/arm/mach-msm/hotplug.c
@@ -78,12 +78,3 @@ void msm_cpu_die(unsigned int cpu)
*/
cpu_leave_lowpower();
}
-
-int msm_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 0664a91adcf9..f7e27d9076e9 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -185,6 +185,6 @@ struct arm_soc_smp_ops msm_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = msm_cpu_die,
- .cpu_disable = msm_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index e0ae233f2da5..c8e3c3e803a3 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -196,7 +196,6 @@ extern void omap_auxcoreboot_addr(u32 cpu_addr);
extern u32 omap_read_auxcoreboot0(void);
extern void omap4_cpu_die(unsigned int cpu);
-extern int omap4_cpu_disable(unsigned int cpu);
struct arm_soc_smp_init_ops;
struct arm_soc_smp_ops;
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c
index d3d01fecfb7f..1d955208cc84 100644
--- a/arch/arm/mach-omap2/omap-hotplug.c
+++ b/arch/arm/mach-omap2/omap-hotplug.c
@@ -56,12 +56,3 @@ void omap4_cpu_die(unsigned int cpu)
pr_debug("CPU%u: spurious wakeup call\n", cpu);
}
}
-
-int omap4_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-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 2c97b14d6ae8..6b1d652290ee 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -194,6 +194,6 @@ struct arm_soc_smp_ops omap4_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = omap4_cpu_die,
- .cpu_disable = omap4_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 6cdfdf9dab1a..dd4bcdbd39c0 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -72,6 +72,5 @@ extern struct arm_soc_smp_init_ops realview_soc_smp_init_ops;
extern struct arm_soc_smp_ops realview_soc_smp_ops;
extern void realview_cpu_die(unsigned int cpu);
-extern int realview_cpu_disable(unsigned int cpu);
#endif
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
index 7f28a56ec949..12af6349a502 100644
--- a/arch/arm/mach-realview/hotplug.c
+++ b/arch/arm/mach-realview/hotplug.c
@@ -112,12 +112,3 @@ void realview_cpu_die(unsigned int cpu)
if (spurious)
pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
}
-
-int realview_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-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index ebe975e57c16..5b7535d02877 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -91,6 +91,6 @@ struct arm_soc_smp_ops realview_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = realview_cpu_die,
- .cpu_disable = realview_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-tegra/common.h b/arch/arm/mach-tegra/common.h
index c135700f63ff..b02cc8701a61 100644
--- a/arch/arm/mach-tegra/common.h
+++ b/arch/arm/mach-tegra/common.h
@@ -7,4 +7,3 @@ extern struct arm_soc_smp_init_ops tegra_soc_smp_init_ops;
extern struct arm_soc_smp_ops tegra_soc_smp_ops;
extern void tegra_cpu_die(unsigned int cpu);
-extern int tegra_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index 51e86900effe..15433b2cbcf9 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -110,12 +110,3 @@ void tegra_cpu_die(unsigned int cpu)
if (spurious)
pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
}
-
-int tegra_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-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index c31018ec4ace..4edc8ab8bada 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -147,6 +147,6 @@ struct arm_soc_smp_ops tegra_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = tegra_cpu_die,
- .cpu_disable = tegra_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c
index 1e86d5aab5b8..ec1c77f4fae9 100644
--- a/arch/arm/mach-ux500/hotplug.c
+++ b/arch/arm/mach-ux500/hotplug.c
@@ -46,12 +46,3 @@ void ux500_cpu_die(unsigned int cpu)
/* directly enter low power state, skipping secure registers */
platform_do_lowpower(cpu);
}
-
-int ux500_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-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 72ba37d8ed32..2935f859502a 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -56,6 +56,5 @@ extern struct arm_soc_smp_ops ux500_soc_smp_ops;
extern struct arm_soc_desc ux500_soc_desc;
extern void ux500_cpu_die(unsigned int cpu);
-extern int ux500_cpu_disable(unsigned int cpu);
#endif /* __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index f105192e5944..bbd6480dc0e1 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -187,6 +187,6 @@ struct arm_soc_smp_ops ux500_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = ux500_cpu_die,
- .cpu_disable = ux500_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index f07268208c2c..d9b1ec009879 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -25,4 +25,3 @@ extern struct arm_soc_smp_init_ops vexpress_soc_smp_init_ops;
extern struct arm_soc_smp_ops vexpress_soc_smp_ops;
extern void vexpress_cpu_die(unsigned int cpu);
-extern int vexpress_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
index 11d2c778178a..e1a7fefa0021 100644
--- a/arch/arm/mach-vexpress/hotplug.c
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -108,12 +108,3 @@ void vexpress_cpu_die(unsigned int cpu)
if (spurious)
pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
}
-
-int vexpress_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-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index 80ab030b4556..a5196f87d7d4 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -62,6 +62,6 @@ struct arm_soc_smp_ops vexpress_soc_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = dummy_cpu_kill,
.cpu_die = vexpress_cpu_die,
- .cpu_disable = vexpress_cpu_disable,
+ .cpu_disable = dummy_cpu_disable,
#endif
};
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 08b241cd0a5d..c0d0a21fbc9c 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -134,7 +134,6 @@ extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
extern void imx6q_clock_map_io(void);
extern void imx_cpu_die(unsigned int cpu);
-extern int imx_cpu_disable(unsigned int cpu);
#ifdef CONFIG_PM
extern void imx6q_pm_init(void);