Thread (2 messages) 2 messages, 2 authors, 2015-01-21

Re: [PATCH 2/2] powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n

From: Stewart Smith <hidden>
Date: 2015-01-21 04:29:09
Also in: lkml

Pranith Kumar [off-list ref] writes:
When CONFIG_PRINTK=n, log_buf_addr_get() returns NULL and log_buf_len_get()
return 0. Check for these return values and skip registering the dump buffer.

Signed-off-by: Pranith Kumar <redacted>
CC: Michael Ellerman <mpe@ellerman.id.au>
(investigating what would occur on systems with current firmware..)

Looking at hw/fsp/fsp-mdst-table.c in skiboot it appears that we'd end
up logging an error log about being passed the size 0 and return
OPAL_PARAMETER back to Linux.

While harmless, this is, naturally, not awesome to log an error about
being unable to grab kernel log on crash every time you boot.

Reviewed-by: Stewart Smith <redacted>
quoted hunk ↗ jump to hunk
---
 arch/powerpc/platforms/powernv/opal.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index f10b9ec..1db119f0 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -667,7 +667,13 @@ static void __init opal_dump_region_init(void)
 
 	/* Register kernel log buffer */
 	addr = log_buf_addr_get();
+	if (addr == NULL)
+		return;
+
 	size = log_buf_len_get();
+	if (size == 0)
+		return;
+
 	rc = opal_register_dump_region(OPAL_DUMP_REGION_LOG_BUF,
 				       __pa(addr), size);
 	/* Don't warn if this is just an older OPAL that doesn't
-- 
1.9.1

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help