From: AMEET M. PARANJAPE <aparanja@redhat.com> Date: Fri, 24 Oct 2008 15:45:44 -0400 Subject: [ppc64] kexec/kdump: disable ptcal on QS21 Message-id: 20081024194525.27751.43432.sendpatchset@squad5-lp1.lab.bos.redhat.com O-Subject: [PATCH 2/2 RHEL5.3 BZ462744] ptcal has to be disabled to use kexec on QS21 Bugzilla: 462744 RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: David Howells <dhowells@redhat.com> RHBZ#: ====== https://bugzilla.redhat.com/show_bug.cgi?id=462744 Description: =========== We need to disable ptcal before starting a new kernel after a crash, in order to avoid overwriting data in the kdump kernel. RHEL Version Found: ================ RHEL 5.2 kABI Status: ============ No symbols were harmed. Brew: ===== Built on all platforms. http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1540066 Upstream Status: ================ http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.26-rc8/2.6.26-rc8-mm1/broken-out/linux-next.patch Commit: 5acb08070dcbabf7347ad73cb8a79a145a2a5152 Mon Sep 17 00:00:00 2001 Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Test Status: ============ On QS21, when doing a kexec e.g. to save a dump, the ptcal feature has to be disable, otherwise the system will stop with a "cpu internal fault" and reboot. Infrastructure to support this has been written by Michael Neuling, posted on ppc64-dev and accepted upstream. This patch is already included in the 111.el5 RHEL kernel. With these patches in internal fault is avoided. =============================================================== Ameet Paranjape 978-392-3903 ext 23903 IBM on-site partner Proposed Patch: =============== diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 74aa947..2dbaba7 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c @@ -8,6 +8,7 @@ #include <asm/reg.h> #include <asm/io.h> #include <asm/prom.h> +#include <asm/kexec.h> #include <asm/machdep.h> #include <asm/rtas.h> #include <asm/cell-regs.h> @@ -217,6 +218,11 @@ static int cbe_ptcal_notify_reboot(struct notifier_block *nb, return cbe_ptcal_disable(); } +static void cbe_ptcal_crash_shutdown(void) +{ + cbe_ptcal_disable(); +} + static struct notifier_block cbe_ptcal_reboot_notifier = { .notifier_call = cbe_ptcal_notify_reboot }; @@ -232,12 +238,20 @@ int __init cbe_ptcal_init(void) return -ENODEV; ret = register_reboot_notifier(&cbe_ptcal_reboot_notifier); - if (ret) { - printk(KERN_ERR "Can't disable PTCAL, so not enabling\n"); - return ret; - } + if (ret) + goto out1; + + ret = crash_shutdown_register(&cbe_ptcal_crash_shutdown); + if (ret) + goto out2; 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);