* [patch 1/3] powerpc: provide dummy crash_shutdown_register
2008-06-12 9:14 [patch 0/3] disable ptcal in case of kdump reboot, v2 Arnd Bergmann
@ 2008-06-12 9:14 ` Arnd Bergmann
2008-06-12 9:14 ` [patch 2/3] powerpc/pseries: call pseries_kexec_setup only on pseries Arnd Bergmann
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2008-06-12 9:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Michael Neuling, Jeremy Kerr, cbe-oss-dev
When kexec is disabled, the crash_shutdown_{un,}register
functions are not available in the kernel.
This provides dummy inline functions for those so that
the callers don't have to worry about it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/asm-powerpc/kexec.h | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 701857b..acdcdc6 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -34,6 +34,8 @@
#ifndef __ASSEMBLY__
#include <linux/cpumask.h>
+typedef void (*crash_shutdown_t)(void);
+
#ifdef CONFIG_KEXEC
#ifdef __powerpc64__
@@ -123,7 +125,6 @@ struct pt_regs;
extern void default_machine_kexec(struct kimage *image);
extern int default_machine_kexec_prepare(struct kimage *image);
extern void default_machine_crash_shutdown(struct pt_regs *regs);
-typedef void (*crash_shutdown_t)(void);
extern int crash_shutdown_register(crash_shutdown_t handler);
extern int crash_shutdown_unregister(crash_shutdown_t handler);
@@ -143,6 +144,16 @@ static inline int overlaps_crashkernel(unsigned long start, unsigned long size)
static inline void reserve_crashkernel(void) { ; }
+static inline int crash_shutdown_register(crash_shutdown_t handler)
+{
+ return 0;
+}
+
+static inline int crash_shutdown_unregister(crash_shutdown_t handler)
+{
+ return 0;
+}
+
#endif /* CONFIG_KEXEC */
#endif /* ! __ASSEMBLY__ */
#endif /* __KERNEL__ */
--
1.5.4.3
--
^ permalink raw reply related [flat|nested] 6+ messages in thread* [patch 2/3] powerpc/pseries: call pseries_kexec_setup only on pseries
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 ` Arnd Bergmann
2008-06-12 9:14 ` [patch 3/3] powerpc/cell: disable ptcal in case of crash kdump Arnd Bergmann
2008-06-12 9:34 ` [PATCH 4/3] powerpc: increase CRASH_HANDLER_MAX Arnd Bergmann
3 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2008-06-12 9:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Michael Neuling, Jeremy Kerr, cbe-oss-dev
The pseries_kexec_setup function overwrites some ppc_md
pointers, so make sure it only gets called when running on
the right architecture.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/platforms/pseries/kexec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pseries/kexec.c
index e9dd5fe..53cbd53 100644
--- a/arch/powerpc/platforms/pseries/kexec.c
+++ b/arch/powerpc/platforms/pseries/kexec.c
@@ -70,4 +70,4 @@ static int __init pseries_kexec_setup(void)
return 0;
}
-__initcall(pseries_kexec_setup);
+machine_device_initcall(pseries, pseries_kexec_setup);
--
1.5.4.3
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch 3/3] powerpc/cell: disable ptcal in case of crash kdump
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
2008-06-16 3:53 ` Jeremy Kerr
2008-06-12 9:34 ` [PATCH 4/3] powerpc: increase CRASH_HANDLER_MAX Arnd Bergmann
3 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2008-06-12 9:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Michael Neuling, Jeremy Kerr, cbe-oss-dev
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
--
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/3] powerpc: increase CRASH_HANDLER_MAX
2008-06-12 9:14 [patch 0/3] disable ptcal in case of kdump reboot, v2 Arnd Bergmann
` (2 preceding siblings ...)
2008-06-12 9:14 ` [patch 3/3] powerpc/cell: disable ptcal in case of crash kdump Arnd Bergmann
@ 2008-06-12 9:34 ` Arnd Bergmann
3 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2008-06-12 9:34 UTC (permalink / raw)
To: cbe-oss-dev; +Cc: linuxppc-dev, Michael Neuling, Jeremy Kerr
There are now two potential callers of machine_crash_shutdown,
so increase the limit accordingly.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/kernel/crash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index eae401d..0a8439a 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -48,7 +48,7 @@ int crashing_cpu = -1;
static cpumask_t cpus_in_crash = CPU_MASK_NONE;
cpumask_t cpus_in_sr = CPU_MASK_NONE;
-#define CRASH_HANDLER_MAX 1
+#define CRASH_HANDLER_MAX 2
/* NULL terminated list of shutdown handles */
static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];
static DEFINE_SPINLOCK(crash_handlers_lock);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread