ARM: tegra: update the cache maintenance order for CPU shutdown
authorJoseph Lo <josephl@nvidia.com>
Thu, 3 Jan 2013 06:42:59 +0000 (14:42 +0800)
committerStephen Warren <swarren@nvidia.com>
Mon, 28 Jan 2013 17:21:44 +0000 (10:21 -0700)
Updating the cache maintenance order before CPU shutdown when doing CPU
hotplug.
The old order:
* clean L1 by flush_cache_all
* exit SMP
* CPU shutdown
Adapt to:
* disable L1 data cache by clear C bit
* clean L1 by v7_flush_dcache_louis
* exit SMP
* CPU shutdown

For CPU hotplug case, it's no need to do "flush_cache_all". And we should
disable L1 data cache before clean L1 data cache. Then leaving the SMP
coherency.

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/hotplug.c
arch/arm/mach-tegra/sleep-tegra20.S
arch/arm/mach-tegra/sleep-tegra30.S
arch/arm/mach-tegra/sleep.S
arch/arm/mach-tegra/sleep.h

index dca5141a2c31d1ff7f523f000c6a3ca08f9806e9..d8c683b875d1a6ae1b39cb900afe05ddcc657dcc 100644 (file)
@@ -28,8 +28,8 @@ void __ref tegra_cpu_die(unsigned int cpu)
 {
        cpu = cpu_logical_map(cpu);
 
-       /* Flush the L1 data cache. */
-       flush_cache_all();
+       /* Clean L1 data cache */
+       tegra_disable_clean_inv_dcache();
 
        /* Shut down the current CPU. */
        tegra_hotplug_shutdown();
index 72ce709799dac5e55cff19b5d279d6e5aceca4b8..ad2ca07d057869923bcb5e2fa32612eb440a6744 100644 (file)
@@ -33,9 +33,6 @@
  * should never return
  */
 ENTRY(tegra20_hotplug_shutdown)
-       /* Turn off SMP coherency */
-       exit_smp r4, r5
-
        /* Put this CPU down */
        cpu_id  r0
        bl      tegra20_cpu_shutdown
index 562a8e7e413dfc18f0edf9d6bab97df428a1b36c..63a15bd9b6530bdda7009000906c09db7854972e 100644 (file)
@@ -32,9 +32,6 @@
  * Should never return.
  */
 ENTRY(tegra30_hotplug_shutdown)
-       /* Turn off SMP coherency */
-       exit_smp r4, r5
-
        /* Powergate this CPU */
        mov     r0, #TEGRA30_POWER_HOTPLUG_SHUTDOWN
        bl      tegra30_cpu_shutdown
index 26afa7cbed11b9de91a10dd50f5634beb094f77d..addae357da3f800a4b28ead0726dabb07ee9aebf 100644 (file)
@@ -34,7 +34,7 @@
 #include "flowctrl.h"
 #include "sleep.h"
 
-#ifdef CONFIG_PM_SLEEP
+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
 /*
  * tegra_disable_clean_inv_dcache
  *
@@ -60,7 +60,9 @@ ENTRY(tegra_disable_clean_inv_dcache)
 
        ldmfd   sp!, {r0, r4-r5, r7, r9-r11, pc}
 ENDPROC(tegra_disable_clean_inv_dcache)
+#endif
 
+#ifdef CONFIG_PM_SLEEP
 /*
  * tegra_sleep_cpu_finish(unsigned long v2p)
  *
index 9821ee725420440524cff5ae81ed8d417312cf10..56505c381ea83209d0185696f500cf6bd2d5988d 100644 (file)
@@ -106,6 +106,7 @@ exit_l2_resume:
 #else
 void tegra_resume(void);
 int tegra_sleep_cpu_finish(unsigned long);
+void tegra_disable_clean_inv_dcache(void);
 
 #ifdef CONFIG_HOTPLUG_CPU
 void tegra20_hotplug_init(void);