From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Cc: Michael Neuling <mikey@neuling.org>, Jeremy Kerr <jk@ozlabs.org>,
cbe-oss-dev@ozlabs.org
Subject: [patch 3/3] powerpc/cell: disable ptcal in case of crash kdump
Date: Thu, 12 Jun 2008 11:14:36 +0200 [thread overview]
Message-ID: <20080612092511.569422083@arndb.de> (raw)
In-Reply-To: 20080612091433.851620325@arndb.de
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>
---
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 655704a..505f9b9 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -17,6 +17,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>
@@ -226,6 +227,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
};
@@ -241,12 +247,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);
--
1.5.4.3
--
next prev parent reply other threads:[~2008-06-12 9:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 9:14 [patch 0/3] disable ptcal in case of kdump reboot, v2 Arnd Bergmann
2008-06-12 9:14 ` [patch 1/3] powerpc: provide dummy crash_shutdown_register Arnd Bergmann
2008-06-12 9:14 ` [patch 2/3] powerpc/pseries: call pseries_kexec_setup only on pseries Arnd Bergmann
2008-06-12 9:14 ` Arnd Bergmann [this message]
2008-06-16 3:53 ` [patch 3/3] powerpc/cell: disable ptcal in case of crash kdump Jeremy Kerr
2008-06-12 9:34 ` [PATCH 4/3] powerpc: increase CRASH_HANDLER_MAX Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080612092511.569422083@arndb.de \
--to=arnd@arndb.de \
--cc=cbe-oss-dev@ozlabs.org \
--cc=jk@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).