linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: don't create OPAL msglog sysfs entry if memcons init fails
@ 2016-02-18  1:12 Andrew Donnellan
  2016-02-24 14:34 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Donnellan @ 2016-02-18  1:12 UTC (permalink / raw)
  To: linuxppc-dev

When initialising OPAL interfaces, there is a possibility that
opal_msglog_init() may fail to initialise the msglog/memory console.

Fix opal_msglog_sysfs_init() so it doesn't try to create sysfs entry for
the msglog if this occurs.

Suggested-by: Joel Stanley <joel@jms.id.au>
Fixes: 9b4fffa14906 ("powerpc/powernv: new function to access OPAL msglog")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
---
 arch/powerpc/platforms/powernv/opal-msglog.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-msglog.c b/arch/powerpc/platforms/powernv/opal-msglog.c
index 59fa6e1..39d6ff9 100644
--- a/arch/powerpc/platforms/powernv/opal-msglog.c
+++ b/arch/powerpc/platforms/powernv/opal-msglog.c
@@ -128,6 +128,11 @@ void __init opal_msglog_init(void)
 
 void __init opal_msglog_sysfs_init(void)
 {
+	if (!opal_memcons) {
+		pr_warn("OPAL: message log initialisation failed, not creating sysfs entry\n");
+		return;
+	}
+
 	if (sysfs_create_bin_file(opal_kobj, &opal_msglog_attr) != 0)
 		pr_warn("OPAL: sysfs file creation failed\n");
 }
-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited

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

* Re: powerpc/powernv: don't create OPAL msglog sysfs entry if memcons init fails
  2016-02-18  1:12 [PATCH] powerpc/powernv: don't create OPAL msglog sysfs entry if memcons init fails Andrew Donnellan
@ 2016-02-24 14:34 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-02-24 14:34 UTC (permalink / raw)
  To: Andrew Donnellan, linuxppc-dev

On Thu, 2016-18-02 at 01:12:54 UTC, Andrew Donnellan wrote:
> When initialising OPAL interfaces, there is a possibility that
> opal_msglog_init() may fail to initialise the msglog/memory console.
> 
> Fix opal_msglog_sysfs_init() so it doesn't try to create sysfs entry for
> the msglog if this occurs.
> 
> Suggested-by: Joel Stanley <joel@jms.id.au>
> Fixes: 9b4fffa14906 ("powerpc/powernv: new function to access OPAL msglog")
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/88409d0c863b3ba7d9e3090fb4

cheers

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

end of thread, other threads:[~2016-02-24 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18  1:12 [PATCH] powerpc/powernv: don't create OPAL msglog sysfs entry if memcons init fails Andrew Donnellan
2016-02-24 14:34 ` Michael Ellerman

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