Commit b8119431 authored by Joseph Lo's avatar Joseph Lo Committed by Stephen Warren

ARM: tegra: moving the clock gating procedure to tegra_cpu_kill

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: default avatarJoseph Lo <josephl@nvidia.com>
Acked-by: default avatarPeter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
parent 57886616
extern struct smp_operations tegra_smp_ops; extern struct smp_operations tegra_smp_ops;
extern int tegra_cpu_kill(unsigned int cpu);
extern void tegra_cpu_die(unsigned int cpu); extern void tegra_cpu_die(unsigned int cpu);
extern int tegra_cpu_disable(unsigned int cpu); extern int tegra_cpu_disable(unsigned int cpu);
...@@ -19,6 +19,17 @@ ...@@ -19,6 +19,17 @@
static void (*tegra_hotplug_shutdown)(void); 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 * platform-specific code to shutdown a CPU
* *
...@@ -26,18 +37,12 @@ static void (*tegra_hotplug_shutdown)(void); ...@@ -26,18 +37,12 @@ static void (*tegra_hotplug_shutdown)(void);
*/ */
void __ref tegra_cpu_die(unsigned int cpu) void __ref tegra_cpu_die(unsigned int cpu)
{ {
cpu = cpu_logical_map(cpu);
/* Clean L1 data cache */ /* Clean L1 data cache */
tegra_disable_clean_inv_dcache(); tegra_disable_clean_inv_dcache();
/* Shut down the current CPU. */ /* Shut down the current CPU. */
tegra_hotplug_shutdown(); tegra_hotplug_shutdown();
/* Clock gate the CPU */
tegra_wait_cpu_in_reset(cpu);
tegra_disable_cpu_clock(cpu);
/* Should never return here. */ /* Should never return here. */
BUG(); BUG();
} }
......
...@@ -212,6 +212,7 @@ struct smp_operations tegra_smp_ops __initdata = { ...@@ -212,6 +212,7 @@ struct smp_operations tegra_smp_ops __initdata = {
.smp_secondary_init = tegra_secondary_init, .smp_secondary_init = tegra_secondary_init,
.smp_boot_secondary = tegra_boot_secondary, .smp_boot_secondary = tegra_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = tegra_cpu_kill,
.cpu_die = tegra_cpu_die, .cpu_die = tegra_cpu_die,
.cpu_disable = tegra_cpu_disable, .cpu_disable = tegra_cpu_disable,
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment