Commit 7415d5e0 authored by Manish Ahuja's avatar Manish Ahuja Committed by Paul Mackerras

[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: default avatarManish Ahuja <mahuja@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 654f596d
...@@ -182,6 +182,18 @@ static void print_dump_header(const struct phyp_dump_header *ph) ...@@ -182,6 +182,18 @@ static void print_dump_header(const struct phyp_dump_header *ph)
#endif #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) static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
{ {
int rc; int rc;
...@@ -204,7 +216,13 @@ static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr) ...@@ -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 " printk(KERN_ERR "phyp-dump: unexpected error (%d) on "
"register\n", rc); "register\n", rc);
print_dump_header(ph); 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 static
......
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