LinuxPPC-Dev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 rebased] powerpc/fadump: when fadump is supported register the fadump sysfs files.
@ 2019-09-23  7:54 Michal Suchanek
  2019-10-23 17:56 ` [PATCH] powerpc/fadump: Remove duplicate message Michal Suchanek
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Suchanek @ 2019-09-23  7:54 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Mahesh Salgaonkar, linux-kernel, Paul Mackerras, Michal Suchanek,
	Hari Bathini


Currently it is not possible to distinguish the case when fadump is
supported by firmware and disabled in kernel and completely unsupported
using the kernel sysfs interface. User can investigate the devicetree
but it is more reasonable to provide sysfs files in case we get some
fadumpv2 in the future.

With this patch sysfs files are available whenever fadump is supported
by firmware.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
---
v2: move the sysfs initialization earlier to avoid condition nesting
rebase: on top of the powernv fadump support
---
 arch/powerpc/kernel/fadump.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index ed59855430b9..cdcdea6c6453 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1466,16 +1466,20 @@ static void fadump_init_files(void)
  */
 int __init setup_fadump(void)
 {
-	if (!fw_dump.fadump_enabled)
-		return 0;
-
-	if (!fw_dump.fadump_supported) {
+	if (!fw_dump.fadump_supported && fw_dump.fadump_enabled) {
 		printk(KERN_ERR "Firmware-assisted dump is not supported on"
 			" this hardware\n");
-		return 0;
 	}
 
+	if (!fw_dump.fadump_supported)
+		return 0;
+
+	fadump_init_files();
 	fadump_show_config();
+
+	if (!fw_dump.fadump_enabled)
+		return 1;
+
 	/*
 	 * If dump data is available then see if it is valid and prepare for
 	 * saving it to the disk.
@@ -1492,8 +1496,6 @@ int __init setup_fadump(void)
 	else if (fw_dump.reserve_dump_area_size)
 		fw_dump.ops->fadump_init_mem_struct(&fw_dump);
 
-	fadump_init_files();
-
 	return 1;
 }
 subsys_initcall(setup_fadump);
-- 
2.23.0


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

* [PATCH] powerpc/fadump: Remove duplicate message.
  2019-09-23  7:54 [PATCH v2 rebased] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
@ 2019-10-23 17:56 ` Michal Suchanek
  2019-10-24 10:38   ` Hari Bathini
  2019-11-07 16:47   ` [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
  0 siblings, 2 replies; 8+ messages in thread
From: Michal Suchanek @ 2019-10-23 17:56 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Mahesh Salgaonkar, linux-kernel, Paul Mackerras, Michal Suchanek,
	Hari Bathini

There is duplicate message about lack of support by firmware in
fadump_reserve_mem and setup_fadump. Due to different capitalization it
is clear that the one in setup_fadump is shown on boot. Remove the
duplicate that is not shown.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 arch/powerpc/kernel/fadump.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index cdcdea6c6453..f40dc713f089 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -438,10 +438,8 @@ int __init fadump_reserve_mem(void)
 	if (!fw_dump.fadump_enabled)
 		return 0;
 
-	if (!fw_dump.fadump_supported) {
-		pr_info("Firmware-Assisted Dump is not supported on this hardware\n");
+	if (!fw_dump.fadump_supported)
 		goto error_out;
-	}
 
 	/*
 	 * Initialize boot memory size
-- 
2.23.0


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

* Re: [PATCH] powerpc/fadump: Remove duplicate message.
  2019-10-23 17:56 ` [PATCH] powerpc/fadump: Remove duplicate message Michal Suchanek
@ 2019-10-24 10:38   ` Hari Bathini
  2019-10-24 11:16     ` Michal Suchánek
  2019-11-07 16:47   ` [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
  1 sibling, 1 reply; 8+ messages in thread
From: Hari Bathini @ 2019-10-24 10:38 UTC (permalink / raw)
  To: Michal Suchanek, linuxppc-dev
  Cc: Mahesh Salgaonkar, Paul Mackerras, linux-kernel


Michal, thanks for looking into this.

On 23/10/19 11:26 PM, Michal Suchanek wrote:
> There is duplicate message about lack of support by firmware in
> fadump_reserve_mem and setup_fadump. Due to different capitalization it
> is clear that the one in setup_fadump is shown on boot. Remove the
> duplicate that is not shown.

Actually, the message in fadump_reserve_mem() is logged. fadump_reserve_mem()
executes first and sets fw_dump.fadump_enabled to `0`, if fadump is not supported.
So, the other message in setup_fadump() doesn't get logged anymore with recent
changes. The right thing to do would be to remove similar message in setup_fadump() instead.

- Hari


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

* Re: [PATCH] powerpc/fadump: Remove duplicate message.
  2019-10-24 10:38   ` Hari Bathini
@ 2019-10-24 11:16     ` Michal Suchánek
  2019-11-07 16:42       ` Michal Suchánek
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Suchánek @ 2019-10-24 11:16 UTC (permalink / raw)
  To: Hari Bathini
  Cc: Mahesh Salgaonkar, linuxppc-dev, linux-kernel, Paul Mackerras

On Thu, Oct 24, 2019 at 04:08:08PM +0530, Hari Bathini wrote:
> 
> Michal, thanks for looking into this.
> 
> On 23/10/19 11:26 PM, Michal Suchanek wrote:
> > There is duplicate message about lack of support by firmware in
> > fadump_reserve_mem and setup_fadump. Due to different capitalization it
> > is clear that the one in setup_fadump is shown on boot. Remove the
> > duplicate that is not shown.
> 
> Actually, the message in fadump_reserve_mem() is logged. fadump_reserve_mem()
> executes first and sets fw_dump.fadump_enabled to `0`, if fadump is not supported.
> So, the other message in setup_fadump() doesn't get logged anymore with recent
> changes. The right thing to do would be to remove similar message in setup_fadump() instead.

I need to re-check with a recent kernel build. I saw the message from
setup_fadump and not the one from fadump_reserve_mem but not sure what
the platform init code looked like in the kernel I tested with.

Thanks

Michal

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

* Re: [PATCH] powerpc/fadump: Remove duplicate message.
  2019-10-24 11:16     ` Michal Suchánek
@ 2019-11-07 16:42       ` Michal Suchánek
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Suchánek @ 2019-11-07 16:42 UTC (permalink / raw)
  To: Hari Bathini
  Cc: Mahesh Salgaonkar, linuxppc-dev, linux-kernel, Paul Mackerras

On Thu, Oct 24, 2019 at 01:16:51PM +0200, Michal Suchánek wrote:
> On Thu, Oct 24, 2019 at 04:08:08PM +0530, Hari Bathini wrote:
> > 
> > Michal, thanks for looking into this.
> > 
> > On 23/10/19 11:26 PM, Michal Suchanek wrote:
> > > There is duplicate message about lack of support by firmware in
> > > fadump_reserve_mem and setup_fadump. Due to different capitalization it
> > > is clear that the one in setup_fadump is shown on boot. Remove the
> > > duplicate that is not shown.
> > 
> > Actually, the message in fadump_reserve_mem() is logged. fadump_reserve_mem()
> > executes first and sets fw_dump.fadump_enabled to `0`, if fadump is not supported.
> > So, the other message in setup_fadump() doesn't get logged anymore with recent
> > changes. The right thing to do would be to remove similar message in setup_fadump() instead.
> 
> I need to re-check with a recent kernel build. I saw the message from
> setup_fadump and not the one from fadump_reserve_mem but not sure what
> the platform init code looked like in the kernel I tested with.

Indeed, I was missing the patch that changes the capitalization in
fadump_reserve_mem. In my kernel both messages are the same and the one
from fadump_reserve_mem is displayed.

Thanks

Michal

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

* [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files.
  2019-10-23 17:56 ` [PATCH] powerpc/fadump: Remove duplicate message Michal Suchanek
  2019-10-24 10:38   ` Hari Bathini
@ 2019-11-07 16:47   ` Michal Suchanek
  2019-11-08 11:38     ` Hari Bathini
  2019-11-14  9:08     ` Michael Ellerman
  1 sibling, 2 replies; 8+ messages in thread
From: Michal Suchanek @ 2019-11-07 16:47 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Mahesh Salgaonkar, linux-kernel, Paul Mackerras, Michal Suchanek,
	Hari Bathini

Currently it is not possible to distinguish the case when fadump is
supported by firmware and disabled in kernel and completely unsupported
using the kernel sysfs interface. User can investigate the devicetree
but it is more reasonable to provide sysfs files in case we get some
fadumpv2 in the future.

With this patch sysfs files are available whenever fadump is supported
by firmware.

There is duplicate message about lack of support by firmware in
fadump_reserve_mem and setup_fadump. Remove the duplicate message in
setup_fadump.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
v2: move the sysfs initialization earlier to avoid condition nesting
v3: remove duplicate message
---
 arch/powerpc/kernel/fadump.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index ed59855430b9..ff0114aeba9b 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1466,16 +1466,15 @@ static void fadump_init_files(void)
  */
 int __init setup_fadump(void)
 {
-	if (!fw_dump.fadump_enabled)
-		return 0;
-
-	if (!fw_dump.fadump_supported) {
-		printk(KERN_ERR "Firmware-assisted dump is not supported on"
-			" this hardware\n");
+	if (!fw_dump.fadump_supported)
 		return 0;
-	}
 
+	fadump_init_files();
 	fadump_show_config();
+
+	if (!fw_dump.fadump_enabled)
+		return 1;
+
 	/*
 	 * If dump data is available then see if it is valid and prepare for
 	 * saving it to the disk.
@@ -1492,8 +1491,6 @@ int __init setup_fadump(void)
 	else if (fw_dump.reserve_dump_area_size)
 		fw_dump.ops->fadump_init_mem_struct(&fw_dump);
 
-	fadump_init_files();
-
 	return 1;
 }
 subsys_initcall(setup_fadump);
-- 
2.23.0


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

* Re: [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files.
  2019-11-07 16:47   ` [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
@ 2019-11-08 11:38     ` Hari Bathini
  2019-11-14  9:08     ` Michael Ellerman
  1 sibling, 0 replies; 8+ messages in thread
From: Hari Bathini @ 2019-11-08 11:38 UTC (permalink / raw)
  To: Michal Suchanek, linuxppc-dev
  Cc: Mahesh Salgaonkar, Paul Mackerras, linux-kernel



On 07/11/19 10:17 PM, Michal Suchanek wrote:
> Currently it is not possible to distinguish the case when fadump is
> supported by firmware and disabled in kernel and completely unsupported
> using the kernel sysfs interface. User can investigate the devicetree
> but it is more reasonable to provide sysfs files in case we get some
> fadumpv2 in the future.
> 
> With this patch sysfs files are available whenever fadump is supported
> by firmware.
> 
> There is duplicate message about lack of support by firmware in
> fadump_reserve_mem and setup_fadump. Remove the duplicate message in
> setup_fadump.

Thanks for doing this, Michal.
Exporting the node will be helpful in finding if FADump is supported,
given FADump is now supported on two different platforms...

Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>

> 
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
> v2: move the sysfs initialization earlier to avoid condition nesting
> v3: remove duplicate message
> ---
>  arch/powerpc/kernel/fadump.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index ed59855430b9..ff0114aeba9b 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -1466,16 +1466,15 @@ static void fadump_init_files(void)
>   */
>  int __init setup_fadump(void)
>  {
> -	if (!fw_dump.fadump_enabled)
> -		return 0;
> -
> -	if (!fw_dump.fadump_supported) {
> -		printk(KERN_ERR "Firmware-assisted dump is not supported on"
> -			" this hardware\n");
> +	if (!fw_dump.fadump_supported)
>  		return 0;
> -	}
>  
> +	fadump_init_files();
>  	fadump_show_config();
> +
> +	if (!fw_dump.fadump_enabled)
> +		return 1;
> +
>  	/*
>  	 * If dump data is available then see if it is valid and prepare for
>  	 * saving it to the disk.
> @@ -1492,8 +1491,6 @@ int __init setup_fadump(void)
>  	else if (fw_dump.reserve_dump_area_size)
>  		fw_dump.ops->fadump_init_mem_struct(&fw_dump);
>  
> -	fadump_init_files();
> -
>  	return 1;
>  }
>  subsys_initcall(setup_fadump);
> 

-- 
- Hari


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

* Re: [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files.
  2019-11-07 16:47   ` [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
  2019-11-08 11:38     ` Hari Bathini
@ 2019-11-14  9:08     ` Michael Ellerman
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2019-11-14  9:08 UTC (permalink / raw)
  To: Michal Suchanek, linuxppc-dev
  Cc: Mahesh Salgaonkar, Michal Suchanek, Paul Mackerras, linux-kernel,
	Hari Bathini

On Thu, 2019-11-07 at 16:47:57 UTC, Michal Suchanek wrote:
> Currently it is not possible to distinguish the case when fadump is
> supported by firmware and disabled in kernel and completely unsupported
> using the kernel sysfs interface. User can investigate the devicetree
> but it is more reasonable to provide sysfs files in case we get some
> fadumpv2 in the future.
> 
> With this patch sysfs files are available whenever fadump is supported
> by firmware.
> 
> There is duplicate message about lack of support by firmware in
> fadump_reserve_mem and setup_fadump. Remove the duplicate message in
> setup_fadump.
> 
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/565f9bc05e2dad6c7fdfc7c2e641be580aa599cd

cheers

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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23  7:54 [PATCH v2 rebased] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
2019-10-23 17:56 ` [PATCH] powerpc/fadump: Remove duplicate message Michal Suchanek
2019-10-24 10:38   ` Hari Bathini
2019-10-24 11:16     ` Michal Suchánek
2019-11-07 16:42       ` Michal Suchánek
2019-11-07 16:47   ` [PATCH v3] powerpc/fadump: when fadump is supported register the fadump sysfs files Michal Suchanek
2019-11-08 11:38     ` Hari Bathini
2019-11-14  9:08     ` Michael Ellerman

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git