diff options
author | Arnd Bergmann <arnd@arndb.de> | 2008-06-12 05:14:36 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-30 08:30:58 -0400 |
commit | 5acb08070dcbabf7347ad73cb8a79a145a2a5152 (patch) | |
tree | ebc163bae3fd236996ff6f031ce28d8e75849c56 /arch | |
parent | cf2076012f3efbd945ceea67704fe515f8d6171f (diff) |
powerpc/cell: Disable ptcal in case of crash kdump
We need to disable ptcal before starting a new kernel after a crash,
in order to avoid overwriting data in the kdump kernel.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/cell/ras.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 655704ad03cf..505f9b9bdf0c 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/reg.h> | 17 | #include <asm/reg.h> |
18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
19 | #include <asm/prom.h> | 19 | #include <asm/prom.h> |
20 | #include <asm/kexec.h> | ||
20 | #include <asm/machdep.h> | 21 | #include <asm/machdep.h> |
21 | #include <asm/rtas.h> | 22 | #include <asm/rtas.h> |
22 | #include <asm/cell-regs.h> | 23 | #include <asm/cell-regs.h> |
@@ -226,6 +227,11 @@ static int cbe_ptcal_notify_reboot(struct notifier_block *nb, | |||
226 | return cbe_ptcal_disable(); | 227 | return cbe_ptcal_disable(); |
227 | } | 228 | } |
228 | 229 | ||
230 | static void cbe_ptcal_crash_shutdown(void) | ||
231 | { | ||
232 | cbe_ptcal_disable(); | ||
233 | } | ||
234 | |||
229 | static struct notifier_block cbe_ptcal_reboot_notifier = { | 235 | static struct notifier_block cbe_ptcal_reboot_notifier = { |
230 | .notifier_call = cbe_ptcal_notify_reboot | 236 | .notifier_call = cbe_ptcal_notify_reboot |
231 | }; | 237 | }; |
@@ -241,12 +247,20 @@ int __init cbe_ptcal_init(void) | |||
241 | return -ENODEV; | 247 | return -ENODEV; |
242 | 248 | ||
243 | ret = register_reboot_notifier(&cbe_ptcal_reboot_notifier); | 249 | ret = register_reboot_notifier(&cbe_ptcal_reboot_notifier); |
244 | if (ret) { | 250 | if (ret) |
245 | printk(KERN_ERR "Can't disable PTCAL, so not enabling\n"); | 251 | goto out1; |
246 | return ret; | 252 | |
247 | } | 253 | ret = crash_shutdown_register(&cbe_ptcal_crash_shutdown); |
254 | if (ret) | ||
255 | goto out2; | ||
248 | 256 | ||
249 | return cbe_ptcal_enable(); | 257 | return cbe_ptcal_enable(); |
258 | |||
259 | out2: | ||
260 | unregister_reboot_notifier(&cbe_ptcal_reboot_notifier); | ||
261 | out1: | ||
262 | printk(KERN_ERR "Can't disable PTCAL, so not enabling\n"); | ||
263 | return ret; | ||
250 | } | 264 | } |
251 | 265 | ||
252 | arch_initcall(cbe_ptcal_init); | 266 | arch_initcall(cbe_ptcal_init); |