diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-26 07:22:12 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-27 05:48:42 -0400 |
commit | 9ca03a21e320a6bf44559323527aba704bcc8772 (patch) | |
tree | c3422c49decfdca220c0088938546c49ee71ba64 /arch/arm/kernel | |
parent | b8ab5397bcbd92e3fd4a9770e0bf59315fa38dab (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')
-rw-r--r-- | arch/arm/kernel/machine_kexec.c | 6 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index 598ca61e7bca..3b4872c2da8e 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -74,7 +74,11 @@ void machine_kexec(struct kimage *image) | |||
74 | (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); | 74 | (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); |
75 | printk(KERN_INFO "Bye!\n"); | 75 | printk(KERN_INFO "Bye!\n"); |
76 | 76 | ||
77 | cpu_proc_fin(); | 77 | local_irq_disable(); |
78 | local_fiq_disable(); | ||
78 | setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ | 79 | setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ |
80 | flush_cache_all(); | ||
81 | cpu_proc_fin(); | ||
82 | flush_cache_all(); | ||
79 | cpu_reset(reboot_code_buffer_phys); | 83 | cpu_reset(reboot_code_buffer_phys); |
80 | } | 84 | } |
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 | ||
85 | void arm_machine_restart(char mode, const char *cmd) | 86 | void 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 | */ |