linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] reorganize and add FADump sysfs files
@ 2019-10-18 13:05 Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 1/4] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_* Sourabh Jain
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sourabh Jain @ 2019-10-18 13:05 UTC (permalink / raw)
  To: mpe
  Cc: corbet, mahesh, linux-doc, linux-kernel, Sourabh Jain,
	linuxppc-dev, hbathini

Currently, FADump sysfs files are present inside /sys/kernel directory.
But as the number of FADump sysfs file increases it is not a good idea to
push all of them in /sys/kernel directory. It is better to have separate
directory to keep all the FADump sysfs files.

The patch series reorganizes the FADump sysfs files and avail all the
existing FADump sysfs files present inside /sys/kernel into a new
directory /sys/kernel/fadump. Currently, all the FADump sysfs files
are replicated into a new directory to maintain the backward compatibility
and will eventually get removed in future. In addition to this a new FADump
sys interface is added to get the amount of memory reserved by FADump for
saving the crash dump.

Changelog v1->v2:
 - Move fadump_release_opalcore sysfs to FADump Kobject instead of
   replicating.
 - Changed the patch order 1,2,3,4 -> 2,1,3,4 (First add the ABI doc for
   exisiting sysfs file then replicate them under FADump kobject).

Sourabh Jain (4):
  Documentation/ABI: add ABI documentation for /sys/kernel/fadump_*
  powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files
  Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated
  powerpc/fadump: sysfs for fadump memory reservation

 .../ABI/obsolete/sysfs-kernel-fadump_enabled  | 10 ++++
 .../obsolete/sysfs-kernel-fadump_registered   | 11 +++++
 .../obsolete/sysfs-kernel-fadump_release_mem  | 11 +++++
 .../sysfs-kernel-fadump_release_opalcore      |  9 ++++
 Documentation/ABI/testing/sysfs-kernel-fadump | 48 +++++++++++++++++++
 .../powerpc/firmware-assisted-dump.rst        | 20 +++++++-
 arch/powerpc/kernel/fadump.c                  | 42 ++++++++++++++++
 arch/powerpc/platforms/powernv/opal-core.c    |  6 ++-
 8 files changed, 154 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-kernel-fadump_enabled
 create mode 100644 Documentation/ABI/obsolete/sysfs-kernel-fadump_registered
 create mode 100644 Documentation/ABI/obsolete/sysfs-kernel-fadump_release_mem
 create mode 100644 Documentation/ABI/removed/sysfs-kernel-fadump_release_opalcore
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-fadump

-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/4] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_*
  2019-10-18 13:05 [PATCH v2 0/4] reorganize and add FADump sysfs files Sourabh Jain
@ 2019-10-18 13:05 ` Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 2/4] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files Sourabh Jain
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Sourabh Jain @ 2019-10-18 13:05 UTC (permalink / raw)
  To: mpe
  Cc: corbet, mahesh, linux-doc, linux-kernel, Sourabh Jain,
	linuxppc-dev, hbathini

Add the missing ABI documentation for the already available FADump
sysfs files.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
 Documentation/ABI/testing/sysfs-kernel-fadump_enabled     | 7 +++++++
 Documentation/ABI/testing/sysfs-kernel-fadump_registered  | 8 ++++++++
 Documentation/ABI/testing/sysfs-kernel-fadump_release_mem | 8 ++++++++
 .../ABI/testing/sysfs-kernel-fadump_release_opalcore      | 7 +++++++
 4 files changed, 30 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-fadump_enabled
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-fadump_registered
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-fadump_release_mem
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore

diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_enabled b/Documentation/ABI/testing/sysfs-kernel-fadump_enabled
new file mode 100644
index 000000000000..f73632b1c006
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fadump_enabled
@@ -0,0 +1,7 @@
+What:		/sys/kernel/fadump_enabled
+Date:		Feb 2012
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	read only
+		Primarily used to identify whether the FADump is enabled in
+		the kernel or not.
+User:		Kdump service
diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_registered b/Documentation/ABI/testing/sysfs-kernel-fadump_registered
new file mode 100644
index 000000000000..dcf925e53f0f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fadump_registered
@@ -0,0 +1,8 @@
+What:		/sys/kernel/fadump_registered
+Date:		Feb 2012
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	read/write
+		Helps to control the dump collect feature from userspace.
+		Setting 1 to this file enables the system to collect the
+		dump and 0 to disable it.
+User:		Kdump service
diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_release_mem b/Documentation/ABI/testing/sysfs-kernel-fadump_release_mem
new file mode 100644
index 000000000000..9c20d64ab48d
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fadump_release_mem
@@ -0,0 +1,8 @@
+What:		/sys/kernel/fadump_release_mem
+Date:		Feb 2012
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	write only
+		This is a special sysfs file and only available when
+		the system is booted to capture the vmcore using FADump.
+		It is used to release the memory reserved by FADump to
+		save the crash dump.
diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore b/Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore
new file mode 100644
index 000000000000..53313c1d4e7a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore
@@ -0,0 +1,7 @@
+What:		/sys/kernel/fadump_release_opalcore
+Date:		Sep 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	write only
+		The sysfs file is available when the system is booted to
+		collect the dump on OPAL based machine. It used to release
+		the memory used to collect the opalcore.
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/4] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files
  2019-10-18 13:05 [PATCH v2 0/4] reorganize and add FADump sysfs files Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 1/4] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_* Sourabh Jain
@ 2019-10-18 13:05 ` Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 4/4] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain
  3 siblings, 0 replies; 9+ messages in thread
From: Sourabh Jain @ 2019-10-18 13:05 UTC (permalink / raw)
  To: mpe
  Cc: corbet, mahesh, linux-doc, linux-kernel, Sourabh Jain,
	linuxppc-dev, hbathini

As the number of FADump sysfs files increases it is hard to manage all of
them inside /sys/kernel directory. It's better to have all the FADump
related sysfs files in a dedicated directory /sys/kernel/fadump. But in
order to maintain the backward compatibility the /sys/kernel/fadump_*
sysfs files are replicated inside /sys/kernel/fadump/ and eventually get
removed in future.

Consolidate ABI documentation for all the FADump sysfs file in a single
file Documentation/ABI/testing/sysfs-kernel-fadump.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
 Documentation/ABI/testing/sysfs-kernel-fadump | 41 +++++++++++++++++++
 arch/powerpc/kernel/fadump.c                  | 28 +++++++++++++
 arch/powerpc/platforms/powernv/opal-core.c    |  6 ++-
 3 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ABI/testing/sysfs-kernel-fadump

diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump b/Documentation/ABI/testing/sysfs-kernel-fadump
new file mode 100644
index 000000000000..dbf0606ba917
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fadump
@@ -0,0 +1,41 @@
+What:		/sys/kernel/fadump/*
+Date:		Oct 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:
+		The /sys/kernel/fadump/* is a collection of FADump sysfs
+		file provide information about the configuration status
+		of Firmware Assisted Dump (FADump).
+
+What:		/sys/kernel/fadump/fadump_enabled
+Date:		Oct 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	read only
+		Primarily used to identify whether the FADump is enabled in
+		the kernel or not.
+User:		Kdump service
+
+What:		/sys/kernel/fadump/fadump_registered
+Date:		Oct 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	read/write
+		Helps to control the dump collect feature from userspace.
+		Setting 1 to this file enables the system to collect the
+		dump and 0 to disable it.
+User:		Kdump service
+
+What:		/sys/kernel/fadump/fadump_release_mem
+Date:		Oct 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	write only
+		This is a special sysfs file and only available when
+		the system is booted to capture the vmcore using FADump.
+		It is used to release the memory reserved by FADump to
+		save the crash dump.
+
+What:		/sys/kernel/fadump/fadump_release_opalcore
+Date:		Oct 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	write only
+		The sysfs file is available when the system is booted to
+		collect the dump on OPAL based machine. It used to release
+		the memory used to collect the opalcore.
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index ed59855430b9..866eddc279d8 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1418,6 +1418,9 @@ static int fadump_region_show(struct seq_file *m, void *private)
 	return 0;
 }
 
+struct kobject *fadump_kobj;
+EXPORT_SYMBOL_GPL(fadump_kobj);
+
 static struct kobj_attribute fadump_release_attr = __ATTR(fadump_release_mem,
 						0200, NULL,
 						fadump_release_memory_store);
@@ -1435,6 +1438,11 @@ static void fadump_init_files(void)
 	struct dentry *debugfs_file;
 	int rc = 0;
 
+	fadump_kobj = kobject_create_and_add("fadump", kernel_kobj);
+	if (!fadump_kobj) {
+		pr_err("failed to create fadump kobject\n");
+		return;
+	}
 	rc = sysfs_create_file(kernel_kobj, &fadump_attr.attr);
 	if (rc)
 		printk(KERN_ERR "fadump: unable to create sysfs file"
@@ -1458,6 +1466,26 @@ static void fadump_init_files(void)
 			printk(KERN_ERR "fadump: unable to create sysfs file"
 				" fadump_release_mem (%d)\n", rc);
 	}
+	/* Replicating the following sysfs attributes under FADump kobject.
+	 *
+	 *	- fadump_enabled
+	 *	- fadump_registered
+	 *	- fadump_release_mem
+	 */
+	rc = sysfs_create_file(fadump_kobj, &fadump_attr.attr);
+	if (rc)
+		pr_err("unable to create fadump/fadump_enabled sysfs file (%d)\n",
+		       rc);
+	rc = sysfs_create_file(fadump_kobj, &fadump_register_attr.attr);
+	if (rc)
+		pr_err("unable to create fadump/fadump_registered sysfs file (%d)\n",
+		       rc);
+	if (fw_dump.dump_active) {
+		rc = sysfs_create_file(fadump_kobj, &fadump_release_attr.attr);
+		if (rc)
+			pr_err("unable to create fadump/fadump_release_mem sysfs file (%d)\n",
+			       rc);
+	}
 	return;
 }
 
diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c
index ed895d82c048..2c7355768d3f 100644
--- a/arch/powerpc/platforms/powernv/opal-core.c
+++ b/arch/powerpc/platforms/powernv/opal-core.c
@@ -625,7 +625,11 @@ static int __init opalcore_init(void)
 		return rc;
 	}
 
-	rc = sysfs_create_file(kernel_kobj, &opalcore_rel_attr.attr);
+	/*
+	 * Originally fadump_release_opalcore sysfs was part of kernel_kobj
+	 * later moved to fadump_kobj.
+	 */
+	rc = sysfs_create_file(fadump_kobj, &opalcore_rel_attr.attr);
 	if (rc) {
 		pr_warn("unable to create sysfs file fadump_release_opalcore (%d)\n",
 			rc);
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated
  2019-10-18 13:05 [PATCH v2 0/4] reorganize and add FADump sysfs files Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 1/4] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_* Sourabh Jain
  2019-10-18 13:05 ` [PATCH v2 2/4] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files Sourabh Jain
@ 2019-10-18 13:05 ` Sourabh Jain
  2019-10-21  7:41   ` Hari Bathini
  2019-10-18 13:05 ` [PATCH v2 4/4] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain
  3 siblings, 1 reply; 9+ messages in thread
From: Sourabh Jain @ 2019-10-18 13:05 UTC (permalink / raw)
  To: mpe
  Cc: corbet, mahesh, linux-doc, linux-kernel, Sourabh Jain,
	linuxppc-dev, hbathini

The /sys/kernel/fadump_* sysfs files are replicated under
/sys/kernel/fadump/ directory. But we need to keep the old
sysfs files to maintain the backward compatibility.

The sysfs files are scheduled to remove by 2021.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
 .../sysfs-kernel-fadump_enabled                   |  3 +++
 .../sysfs-kernel-fadump_registered                |  3 +++
 .../sysfs-kernel-fadump_release_mem               |  3 +++
 .../sysfs-kernel-fadump_release_opalcore          |  2 ++
 Documentation/powerpc/firmware-assisted-dump.rst  | 15 +++++++++++++--
 5 files changed, 24 insertions(+), 2 deletions(-)
 rename Documentation/ABI/{testing => obsolete}/sysfs-kernel-fadump_enabled (66%)
 rename Documentation/ABI/{testing => obsolete}/sysfs-kernel-fadump_registered (71%)
 rename Documentation/ABI/{testing => obsolete}/sysfs-kernel-fadump_release_mem (73%)
 rename Documentation/ABI/{testing => removed}/sysfs-kernel-fadump_release_opalcore (84%)

diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_enabled b/Documentation/ABI/obsolete/sysfs-kernel-fadump_enabled
similarity index 66%
rename from Documentation/ABI/testing/sysfs-kernel-fadump_enabled
rename to Documentation/ABI/obsolete/sysfs-kernel-fadump_enabled
index f73632b1c006..ca35a285905b 100644
--- a/Documentation/ABI/testing/sysfs-kernel-fadump_enabled
+++ b/Documentation/ABI/obsolete/sysfs-kernel-fadump_enabled
@@ -1,3 +1,6 @@
+This ABI is deprecated and will be removed after 2021. It is replaced
+with /sys/kernel/fadump/fadump_enabled.
+
 What:		/sys/kernel/fadump_enabled
 Date:		Feb 2012
 Contact:	linuxppc-dev@lists.ozlabs.org
diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_registered b/Documentation/ABI/obsolete/sysfs-kernel-fadump_registered
similarity index 71%
rename from Documentation/ABI/testing/sysfs-kernel-fadump_registered
rename to Documentation/ABI/obsolete/sysfs-kernel-fadump_registered
index dcf925e53f0f..3d881701dc11 100644
--- a/Documentation/ABI/testing/sysfs-kernel-fadump_registered
+++ b/Documentation/ABI/obsolete/sysfs-kernel-fadump_registered
@@ -1,3 +1,6 @@
+This ABI is deprecated and will be removed after 2021. It is replaced
+with /sys/kernel/fadump/fadump_registered.
+
 What:		/sys/kernel/fadump_registered
 Date:		Feb 2012
 Contact:	linuxppc-dev@lists.ozlabs.org
diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_release_mem b/Documentation/ABI/obsolete/sysfs-kernel-fadump_release_mem
similarity index 73%
rename from Documentation/ABI/testing/sysfs-kernel-fadump_release_mem
rename to Documentation/ABI/obsolete/sysfs-kernel-fadump_release_mem
index 9c20d64ab48d..8fef37d9b5ba 100644
--- a/Documentation/ABI/testing/sysfs-kernel-fadump_release_mem
+++ b/Documentation/ABI/obsolete/sysfs-kernel-fadump_release_mem
@@ -1,3 +1,6 @@
+This ABI is deprecated and will be removed after 2021. It is replaced
+with /sys/kernel/fadump/fadump_release_mem.
+
 What:		/sys/kernel/fadump_release_mem
 Date:		Feb 2012
 Contact:	linuxppc-dev@lists.ozlabs.org
diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore b/Documentation/ABI/removed/sysfs-kernel-fadump_release_opalcore
similarity index 84%
rename from Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore
rename to Documentation/ABI/removed/sysfs-kernel-fadump_release_opalcore
index 53313c1d4e7a..b42e768bf922 100644
--- a/Documentation/ABI/testing/sysfs-kernel-fadump_release_opalcore
+++ b/Documentation/ABI/removed/sysfs-kernel-fadump_release_opalcore
@@ -1,3 +1,5 @@
+This ABI is moved to /sys/kernel/fadump/ directory.
+
 What:		/sys/kernel/fadump_release_opalcore
 Date:		Sep 2019
 Contact:	linuxppc-dev@lists.ozlabs.org
diff --git a/Documentation/powerpc/firmware-assisted-dump.rst b/Documentation/powerpc/firmware-assisted-dump.rst
index 0455a78486d5..6e2d329efda9 100644
--- a/Documentation/powerpc/firmware-assisted-dump.rst
+++ b/Documentation/powerpc/firmware-assisted-dump.rst
@@ -283,14 +283,25 @@ Here is the list of files under kernel sysfs:
     enhanced to use this interface to release the memory reserved for
     dump and continue without 2nd reboot.
 
- /sys/kernel/fadump_release_opalcore
+Note: /sys/kernel/fadump_release_opalcore sysfs has moved to
+      /sys/kernel/fadump/fadump_release_opalcore.
+
+ /sys/kernel/fadump/fadump_release_opalcore
 
     This file is available only on OPAL based machines when FADump is
     active during capture kernel. This is used to release the memory
     used by the kernel to export /sys/firmware/opal/core file. To
     release this memory, echo '1' to it:
 
-    echo 1  > /sys/kernel/fadump_release_opalcore
+    echo 1  > /sys/kernel/fadump/fadump_release_opalcore
+
+Note: The following FADump sysfs files are deprecated.
+
+    Deprecated                       Alternative
+    -------------------------------------------------------------------------------
+    /sys/kernel/fadump_enabled           /sys/kernel/fadump/fadump_enabled
+    /sys/kernel/fadump_registered        /sys/kernel/fadump/fadump_registered
+    /sys/kernel/fadump_release_mem       /sys/kernel/fadump/fadump_release_mem
 
 Here is the list of files under powerpc debugfs:
 (Assuming debugfs is mounted on /sys/kernel/debug directory.)
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 4/4] powerpc/fadump: sysfs for fadump memory reservation
  2019-10-18 13:05 [PATCH v2 0/4] reorganize and add FADump sysfs files Sourabh Jain
                   ` (2 preceding siblings ...)
  2019-10-18 13:05 ` [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated Sourabh Jain
@ 2019-10-18 13:05 ` Sourabh Jain
  3 siblings, 0 replies; 9+ messages in thread
From: Sourabh Jain @ 2019-10-18 13:05 UTC (permalink / raw)
  To: mpe
  Cc: corbet, mahesh, linux-doc, linux-kernel, Sourabh Jain,
	linuxppc-dev, hbathini

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>
---
 Documentation/ABI/testing/sysfs-kernel-fadump    |  7 +++++++
 Documentation/powerpc/firmware-assisted-dump.rst |  5 +++++
 arch/powerpc/kernel/fadump.c                     | 14 ++++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-kernel-fadump b/Documentation/ABI/testing/sysfs-kernel-fadump
index dbf0606ba917..2b23af7e1c2f 100644
--- a/Documentation/ABI/testing/sysfs-kernel-fadump
+++ b/Documentation/ABI/testing/sysfs-kernel-fadump
@@ -39,3 +39,10 @@ Description:	write only
 		The sysfs file is available when the system is booted to
 		collect the dump on OPAL based machine. It used to release
 		the memory used to collect the opalcore.
+
+What:		/sys/kernel/fadump/fadump_mem_reserved
+Date:		Oct 2019
+Contact:	linuxppc-dev@lists.ozlabs.org
+Description:	read only
+		Provide information about the amount of memory reserved by
+		FADump to save the crash dump in bytes.
diff --git a/Documentation/powerpc/firmware-assisted-dump.rst b/Documentation/powerpc/firmware-assisted-dump.rst
index 6e2d329efda9..80c750847324 100644
--- a/Documentation/powerpc/firmware-assisted-dump.rst
+++ b/Documentation/powerpc/firmware-assisted-dump.rst
@@ -268,6 +268,11 @@ Here is the list of files under kernel sysfs:
     be handled and vmcore will not be captured. This interface can be
     easily integrated with kdump service start/stop.
 
+ /sys/kernel/fadump/fadump_mem_reserved
+
+   This is used to display the memory reserved by FADump for saving the
+   crash dump.
+
  /sys/kernel/fadump_release_mem
     This file is available only when FADump is active during
     second kernel. This is used to release the reserved memory
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 866eddc279d8..82cc92f135b2 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1357,6 +1357,13 @@ static ssize_t fadump_enabled_show(struct kobject *kobj,
 	return sprintf(buf, "%d\n", fw_dump.fadump_enabled);
 }
 
+static ssize_t fadump_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 fadump_register_show(struct kobject *kobj,
 					struct kobj_attribute *attr,
 					char *buf)
@@ -1430,6 +1437,9 @@ static struct kobj_attribute fadump_attr = __ATTR(fadump_enabled,
 static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
 						0644, fadump_register_show,
 						fadump_register_store);
+static struct kobj_attribute fadump_mem_reserved_attr =
+			__ATTR(fadump_mem_reserved, 0444,
+			       fadump_mem_reserved_show, NULL);
 
 DEFINE_SHOW_ATTRIBUTE(fadump_region);
 
@@ -1486,6 +1496,10 @@ static void fadump_init_files(void)
 			pr_err("unable to create fadump/fadump_release_mem sysfs file (%d)\n",
 			       rc);
 	}
+	rc = sysfs_create_file(fadump_kobj, &fadump_mem_reserved_attr.attr);
+	if (rc)
+		pr_err("unable to create fadump_mem_reserved sysfs file (%d)\n",
+		       rc);
 	return;
 }
 
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated
  2019-10-18 13:05 ` [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated Sourabh Jain
@ 2019-10-21  7:41   ` Hari Bathini
  2019-11-05  8:54     ` Sourabh Jain
  0 siblings, 1 reply; 9+ messages in thread
From: Hari Bathini @ 2019-10-21  7:41 UTC (permalink / raw)
  To: Sourabh Jain, mpe; +Cc: linuxppc-dev, mahesh, linux-doc, linux-kernel, corbet



On 18/10/19 6:35 PM, Sourabh Jain wrote:
> The /sys/kernel/fadump_* sysfs files are replicated under

[...]

> +Note: The following FADump sysfs files are deprecated.
> +
> +    Deprecated                       Alternative
> +    -------------------------------------------------------------------------------
> +    /sys/kernel/fadump_enabled           /sys/kernel/fadump/fadump_enabled
> +    /sys/kernel/fadump_registered        /sys/kernel/fadump/fadump_registered
> +    /sys/kernel/fadump_release_mem       /sys/kernel/fadump/fadump_release_mem

/sys/kernel/fadump/* looks tidy instead of /sys/kernel/fadump/fadump_* 
I mean, /sys/kernel/fadump/fadump_enabled => /sys/kernel/fadump/enabled and such..

- Hari


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated
  2019-10-21  7:41   ` Hari Bathini
@ 2019-11-05  8:54     ` Sourabh Jain
  2019-11-05 17:01       ` Hari Bathini
  0 siblings, 1 reply; 9+ messages in thread
From: Sourabh Jain @ 2019-11-05  8:54 UTC (permalink / raw)
  To: Hari Bathini, mpe; +Cc: linuxppc-dev, mahesh, linux-doc, linux-kernel, corbet



On 10/21/19 1:11 PM, Hari Bathini wrote:
> 
> 
> On 18/10/19 6:35 PM, Sourabh Jain wrote:
>> The /sys/kernel/fadump_* sysfs files are replicated under
> 
> [...]
> 
>> +Note: The following FADump sysfs files are deprecated.
>> +
>> +    Deprecated                       Alternative
>> +    -------------------------------------------------------------------------------
>> +    /sys/kernel/fadump_enabled           /sys/kernel/fadump/fadump_enabled
>> +    /sys/kernel/fadump_registered        /sys/kernel/fadump/fadump_registered
>> +    /sys/kernel/fadump_release_mem       /sys/kernel/fadump/fadump_release_mem
> 
> /sys/kernel/fadump/* looks tidy instead of /sys/kernel/fadump/fadump_* 
> I mean, /sys/kernel/fadump/fadump_enabled => /sys/kernel/fadump/enabled and such..



Could you please confirm whether you want to address the sysfs file path differently or
actually changing the sysfs file name from fadump_enabled to enabled.

- Sourabh Jain


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated
  2019-11-05  8:54     ` Sourabh Jain
@ 2019-11-05 17:01       ` Hari Bathini
  2019-11-06  5:29         ` Sourabh Jain
  0 siblings, 1 reply; 9+ messages in thread
From: Hari Bathini @ 2019-11-05 17:01 UTC (permalink / raw)
  To: Sourabh Jain, mpe; +Cc: linuxppc-dev, mahesh, linux-doc, linux-kernel, corbet



On 05/11/19 2:24 PM, Sourabh Jain wrote:
> 
> 
> On 10/21/19 1:11 PM, Hari Bathini wrote:
>>
>>
>> On 18/10/19 6:35 PM, Sourabh Jain wrote:
>>> The /sys/kernel/fadump_* sysfs files are replicated under
>>
>> [...]
>>
>>> +Note: The following FADump sysfs files are deprecated.
>>> +
>>> +    Deprecated                       Alternative
>>> +    -------------------------------------------------------------------------------
>>> +    /sys/kernel/fadump_enabled           /sys/kernel/fadump/fadump_enabled
>>> +    /sys/kernel/fadump_registered        /sys/kernel/fadump/fadump_registered
>>> +    /sys/kernel/fadump_release_mem       /sys/kernel/fadump/fadump_release_mem
>>
>> /sys/kernel/fadump/* looks tidy instead of /sys/kernel/fadump/fadump_* 
>> I mean, /sys/kernel/fadump/fadump_enabled => /sys/kernel/fadump/enabled and such..
> 
> 
> 
> Could you please confirm whether you want to address the sysfs file path differently or
> actually changing the sysfs file name from fadump_enabled to enabled.

I meant, given the path "/sys/kernel/fadump/", the prefix fadump_ is redundant.
If there are no conventions that we should retain the same file name, I suggest
to drop the fadump_ prefix and just call them enabled, registered, etc..

- Hari


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated
  2019-11-05 17:01       ` Hari Bathini
@ 2019-11-06  5:29         ` Sourabh Jain
  0 siblings, 0 replies; 9+ messages in thread
From: Sourabh Jain @ 2019-11-06  5:29 UTC (permalink / raw)
  To: Hari Bathini, mpe; +Cc: linuxppc-dev, mahesh, linux-doc, linux-kernel, corbet



On 11/5/19 10:31 PM, Hari Bathini wrote:
> 
> 
> On 05/11/19 2:24 PM, Sourabh Jain wrote:
>>
>>
>> On 10/21/19 1:11 PM, Hari Bathini wrote:
>>>
>>>
>>> On 18/10/19 6:35 PM, Sourabh Jain wrote:
>>>> The /sys/kernel/fadump_* sysfs files are replicated under
>>>
>>> [...]
>>>
>>>> +Note: The following FADump sysfs files are deprecated.
>>>> +
>>>> +    Deprecated                       Alternative
>>>> +    -------------------------------------------------------------------------------
>>>> +    /sys/kernel/fadump_enabled           /sys/kernel/fadump/fadump_enabled
>>>> +    /sys/kernel/fadump_registered        /sys/kernel/fadump/fadump_registered
>>>> +    /sys/kernel/fadump_release_mem       /sys/kernel/fadump/fadump_release_mem
>>>
>>> /sys/kernel/fadump/* looks tidy instead of /sys/kernel/fadump/fadump_* 
>>> I mean, /sys/kernel/fadump/fadump_enabled => /sys/kernel/fadump/enabled and such..
>>
>>
>>
>> Could you please confirm whether you want to address the sysfs file path differently or
>> actually changing the sysfs file name from fadump_enabled to enabled.
> 
> I meant, given the path "/sys/kernel/fadump/", the prefix fadump_ is redundant.
> If there are no conventions that we should retain the same file name, I suggest
> to drop the fadump_ prefix and just call them enabled, registered, etc..

Oh Yes, I agree with you. It's better not to prefix the sysfs files with fadump_. As we already
have directory that convey the same information.

I did not find any rule regarding renaming an obsolete sysfs file in Documentation/ABI/README.
So lets remove the fadump_ prefix from fadump sysfs file. 

Thanks,
Sourabh Jain


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-11-06  5:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 13:05 [PATCH v2 0/4] reorganize and add FADump sysfs files Sourabh Jain
2019-10-18 13:05 ` [PATCH v2 1/4] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_* Sourabh Jain
2019-10-18 13:05 ` [PATCH v2 2/4] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files Sourabh Jain
2019-10-18 13:05 ` [PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated Sourabh Jain
2019-10-21  7:41   ` Hari Bathini
2019-11-05  8:54     ` Sourabh Jain
2019-11-05 17:01       ` Hari Bathini
2019-11-06  5:29         ` Sourabh Jain
2019-10-18 13:05 ` [PATCH v2 4/4] powerpc/fadump: sysfs for fadump memory reservation Sourabh Jain

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).