aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/process.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-26 07:22:12 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-27 05:48:42 -0400
commit9ca03a21e320a6bf44559323527aba704bcc8772 (patch)
treec3422c49decfdca220c0088938546c49ee71ba64 /arch/arm/kernel/process.c
parentb8ab5397bcbd92e3fd4a9770e0bf59315fa38dab (diff)
ARM: Factor out common code from cpu_proc_fin()
All implementations of cpu_proc_fin() start by disabling interrupts and then flush caches. Rather than have every processors proc_fin() implementation do this, move it out into generic code - and move the cache flush past setup_mm_for_reboot() (so it can benefit from having caches still enabled.) This allows cpu_proc_fin() to become independent of the L1/L2 cache types, and eventually move the L2 cache flushing into the L2 support code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r--arch/arm/kernel/process.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index a4a9cc88bec7..aaf51159203a 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -29,6 +29,7 @@
29#include <linux/utsname.h> 29#include <linux/utsname.h>
30#include <linux/uaccess.h> 30#include <linux/uaccess.h>
31 31
32#include <asm/cacheflush.h>
32#include <asm/leds.h> 33#include <asm/leds.h>
33#include <asm/processor.h> 34#include <asm/processor.h>
34#include <asm/system.h> 35#include <asm/system.h>
@@ -84,10 +85,9 @@ __setup("hlt", hlt_setup);
84 85
85void arm_machine_restart(char mode, const char *cmd) 86void arm_machine_restart(char mode, const char *cmd)
86{ 87{
87 /* 88 /* Disable interrupts first */
88 * Clean and disable cache, and turn off interrupts 89 local_irq_disable();
89 */ 90 local_fiq_disable();
90 cpu_proc_fin();
91 91
92 /* 92 /*
93 * Tell the mm system that we are going to reboot - 93 * Tell the mm system that we are going to reboot -
@@ -96,6 +96,15 @@ void arm_machine_restart(char mode, const char *cmd)
96 */ 96 */
97 setup_mm_for_reboot(mode); 97 setup_mm_for_reboot(mode);
98 98
99 /* Clean and invalidate caches */
100 flush_cache_all();
101
102 /* Turn off caching */
103 cpu_proc_fin();
104
105 /* Push out any further dirty data, and ensure cache is empty */
106 flush_cache_all();
107
99 /* 108 /*
100 * Now call the architecture specific reboot code. 109 * Now call the architecture specific reboot code.
101 */ 110 */