Commit 5acb0807 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Paul Mackerras

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: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent cf207601
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/reg.h> #include <asm/reg.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/kexec.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/rtas.h> #include <asm/rtas.h>
#include <asm/cell-regs.h> #include <asm/cell-regs.h>
...@@ -226,6 +227,11 @@ static int cbe_ptcal_notify_reboot(struct notifier_block *nb, ...@@ -226,6 +227,11 @@ static int cbe_ptcal_notify_reboot(struct notifier_block *nb,
return cbe_ptcal_disable(); return cbe_ptcal_disable();
} }
static void cbe_ptcal_crash_shutdown(void)
{
cbe_ptcal_disable();
}
static struct notifier_block cbe_ptcal_reboot_notifier = { static struct notifier_block cbe_ptcal_reboot_notifier = {
.notifier_call = cbe_ptcal_notify_reboot .notifier_call = cbe_ptcal_notify_reboot
}; };
...@@ -241,12 +247,20 @@ int __init cbe_ptcal_init(void) ...@@ -241,12 +247,20 @@ int __init cbe_ptcal_init(void)
return -ENODEV; return -ENODEV;
ret = register_reboot_notifier(&cbe_ptcal_reboot_notifier); ret = register_reboot_notifier(&cbe_ptcal_reboot_notifier);
if (ret) { if (ret)
printk(KERN_ERR "Can't disable PTCAL, so not enabling\n"); goto out1;
return ret;
} ret = crash_shutdown_register(&cbe_ptcal_crash_shutdown);
if (ret)
goto out2;
return cbe_ptcal_enable(); return cbe_ptcal_enable();
out2:
unregister_reboot_notifier(&cbe_ptcal_reboot_notifier);
out1:
printk(KERN_ERR "Can't disable PTCAL, so not enabling\n");
return ret;
} }
arch_initcall(cbe_ptcal_init); arch_initcall(cbe_ptcal_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment