]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ARM: tegra: add cpu_disable for hotplug
authorJoseph Lo <josephl@nvidia.com>
Tue, 21 May 2013 10:13:35 +0000 (18:13 +0800)
committerStephen Warren <swarren@nvidia.com>
Tue, 28 May 2013 21:26:07 +0000 (15:26 -0600)
The Tegra114 could hotplug the CPU0, but the common cpu_disable didn't
support that. Adding a Tegra specific cpu_disable function for it.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
[swarren: adjusted the switch statement to be future-proof]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/mach-tegra/common.h
arch/arm/mach-tegra/hotplug.c
arch/arm/mach-tegra/platsmp.c

index 5900cc44f780d33ab84434d3d4393643bab4e541..32f8eb3fe344958d395d89b17785b38f17f06673 100644 (file)
@@ -2,3 +2,4 @@ extern struct smp_operations tegra_smp_ops;
 
 extern int tegra_cpu_kill(unsigned int cpu);
 extern void tegra_cpu_die(unsigned int cpu);
+extern int tegra_cpu_disable(unsigned int cpu);
index d07f152b275f1cccec7ca37b0bdf42a5426d6ce9..a52c10e0a85752cc0a47f9919d73eb46233c36aa 100644 (file)
@@ -46,6 +46,17 @@ void __ref tegra_cpu_die(unsigned int cpu)
        BUG();
 }
 
+int tegra_cpu_disable(unsigned int cpu)
+{
+       switch (tegra_chip_id) {
+       case TEGRA20:
+       case TEGRA30:
+               return cpu == 0 ? -EPERM : 0;
+       default:
+               return 0;
+       }
+}
+
 void __init tegra_hotplug_init(void)
 {
        if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
index 554aedc98c9f5ba198370bf830daee24d7570c82..24db4ac428ae9641e503a1cc1c3638ebf05c9142 100644 (file)
@@ -196,5 +196,6 @@ struct smp_operations tegra_smp_ops __initdata = {
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_kill               = tegra_cpu_kill,
        .cpu_die                = tegra_cpu_die,
+       .cpu_disable            = tegra_cpu_disable,
 #endif
 };