aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Ahuja <ahuja@austin.ibm.com>2008-03-22 11:40:53 +1100
committerPaul Mackerras <paulus@samba.org>2008-03-26 08:44:07 +1100
commit7415d5e0bec6ecd79d2698ae9655b10be47d8aa8 (patch)
tree8b11f20c0d66f7e0dbabca80e6a047f5d556a864
parent654f596da4a83a8d2734fba26c2a1257533e6d75 (diff)
[POWERPC] pseries: phyp dump: Inform kdump when phyp-dump is loaded
This adds /sys/kernel/phyp_dump_active so that kdump init scripts may look for it and take appropriate action if this file is found. This file is only created when phyp_dump has been registered. Signed-off-by: Manish Ahuja <mahuja@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/pseries/phyp_dump.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
index f80f8606c6b..7ddd10526ce 100644
--- a/arch/powerpc/platforms/pseries/phyp_dump.c
+++ b/arch/powerpc/platforms/pseries/phyp_dump.c
@@ -182,6 +182,18 @@ static void print_dump_header(const struct phyp_dump_header *ph)
#endif
}
+static ssize_t show_phyp_dump_active(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+
+ /* create filesystem entry so kdump is phyp-dump aware */
+ return sprintf(buf, "%lx\n", phyp_dump_info->phyp_dump_at_boot);
+}
+
+static struct kobj_attribute pdl = __ATTR(phyp_dump_active, 0600,
+ show_phyp_dump_active,
+ NULL);
+
static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
{
int rc;
@@ -204,7 +216,13 @@ static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
printk(KERN_ERR "phyp-dump: unexpected error (%d) on "
"register\n", rc);
print_dump_header(ph);
+ return;
}
+
+ rc = sysfs_create_file(kernel_kobj, &pdl.attr);
+ if (rc)
+ printk(KERN_ERR "phyp-dump: unable to create sysfs"
+ " file (%d)\n", rc);
}
static