summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/fadump.c
diff options
context:
space:
mode:
authorSourabh Jain <sourabhjain@linux.ibm.com>2019-12-11 21:39:10 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2020-02-19 22:46:07 +1100
commitd8e73458f33a24810413ee3a0cd020b644de2f98 (patch)
tree488a517b3ba91bcc04fad8ceafba596619c579f9 /arch/powerpc/kernel/fadump.c
parent3f5f1f22ef10ee0278cef1243944c93aca01b236 (diff)
downloadlwn-d8e73458f33a24810413ee3a0cd020b644de2f98.tar.gz
lwn-d8e73458f33a24810413ee3a0cd020b644de2f98.zip
powerpc/fadump: sysfs for fadump memory reservation
Add a sys interface to allow querying the memory reserved by FADump for saving the crash dump. Also added Documentation/ABI for the new sysfs file. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20191211160910.21656-7-sourabhjain@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/fadump.c')
-rw-r--r--arch/powerpc/kernel/fadump.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 1182ae44ef14..265b4aa72252 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1369,6 +1369,13 @@ static ssize_t enabled_show(struct kobject *kobj,
return sprintf(buf, "%d\n", fw_dump.fadump_enabled);
}
+static ssize_t mem_reserved_show(struct kobject *kobj,
+ struct kobj_attribute *attr,
+ char *buf)
+{
+ return sprintf(buf, "%ld\n", fw_dump.reserve_dump_area_size);
+}
+
static ssize_t registered_show(struct kobject *kobj,
struct kobj_attribute *attr,
char *buf)
@@ -1433,10 +1440,12 @@ static int fadump_region_show(struct seq_file *m, void *private)
static struct kobj_attribute release_attr = __ATTR_WO(release_mem);
static struct kobj_attribute enable_attr = __ATTR_RO(enabled);
static struct kobj_attribute register_attr = __ATTR_RW(registered);
+static struct kobj_attribute mem_reserved_attr = __ATTR_RO(mem_reserved);
static struct attribute *fadump_attrs[] = {
&enable_attr.attr,
&register_attr.attr,
+ &mem_reserved_attr.attr,
NULL,
};