ARM: tegra: moving the clock gating procedure to tegra_cpu_kill
authorJoseph Lo <josephl@nvidia.com>
Thu, 3 Jan 2013 06:43:00 +0000 (14:43 +0800)
committerStephen Warren <swarren@nvidia.com>
Mon, 28 Jan 2013 17:21:48 +0000 (10:21 -0700)
The tegra_cpu_die was be executed by the CPU itslf. So the clock gating
procedure won't be executed after the CPU hardware shutdown code. Moving
the clock gating procedure to tegra_cpu_kill that will be run by another
CPU after the CPU died.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
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 02f71b4f1e51d54eda5a8ccaba52c666f887898c..32f8eb3fe344958d395d89b17785b38f17f06673 100644 (file)
@@ -1,4 +1,5 @@
 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 d8c683b875d1a6ae1b39cb900afe05ddcc657dcc..6a27de4001ee6d700b8b05642d9676a72b8356dd 100644 (file)
 
 static void (*tegra_hotplug_shutdown)(void);
 
+int tegra_cpu_kill(unsigned cpu)
+{
+       cpu = cpu_logical_map(cpu);
+
+       /* Clock gate the CPU */
+       tegra_wait_cpu_in_reset(cpu);
+       tegra_disable_cpu_clock(cpu);
+
+       return 1;
+}
+
 /*
  * platform-specific code to shutdown a CPU
  *
@@ -26,18 +37,12 @@ static void (*tegra_hotplug_shutdown)(void);
  */
 void __ref tegra_cpu_die(unsigned int cpu)
 {
-       cpu = cpu_logical_map(cpu);
-
        /* Clean L1 data cache */
        tegra_disable_clean_inv_dcache();
 
        /* Shut down the current CPU. */
        tegra_hotplug_shutdown();
 
-       /* Clock gate the CPU */
-       tegra_wait_cpu_in_reset(cpu);
-       tegra_disable_cpu_clock(cpu);
-
        /* Should never return here. */
        BUG();
 }
index 40f8c37c817893172d5b8b059f0c9c949e17f63a..5882da0f4d8a7f4f0a9ff8304989f4657d20314c 100644 (file)
@@ -212,6 +212,7 @@ struct smp_operations tegra_smp_ops __initdata = {
        .smp_secondary_init     = tegra_secondary_init,
        .smp_boot_secondary     = tegra_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
+       .cpu_kill               = tegra_cpu_kill,
        .cpu_die                = tegra_cpu_die,
        .cpu_disable            = tegra_cpu_disable,
 #endif