ARM: tegra: power: Flush cache just before cpu shutdown
Alex Frid [Wed, 21 Sep 2011 01:45:53 +0000 (18:45 -0700)]
Re-arranged cpu die procedure to flush L1 cache just before shutdown.
This is necessary as code executed after L1 flush included spin-lock
protected sections, and the unlock operation was not properly detected
by SCU. As a result CPUs that stayed on-line hanged trying to acquire
the same spin-lock.

Bug 864256

Change-Id: I415160d60686094059e62d91cdcf4b264a4fb69f
Reviewed-on: http://git-master/r/53637
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Tested-by: Gaurav Sarode <gsarode@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>

Rebase-Id: R0663eac9b5c3c84d8b7380873bde6af6b2a74a9f

arch/arm/mach-tegra/hotplug.c

index 682e0ea..2d0f7bd 100644 (file)
@@ -41,9 +41,6 @@ void tegra_cpu_die(unsigned int cpu)
 {
        cpu = cpu_logical_map(cpu);
 
-       /* Flush the L1 data cache. */
-       flush_cache_all();
-
 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
        /* Disable GIC CPU interface for this CPU. */
        tegra_gic_cpu_disable();
@@ -55,6 +52,9 @@ void tegra_cpu_die(unsigned int cpu)
        tegra_gic_pass_through_disable();
 #endif
 
+       /* Flush the L1 data cache. */
+       flush_cache_all();
+
        /* Shut down the current CPU. */
        tegra_hotplug_shutdown();