[PATCH] powerpc: opal-msglog: Report size of memcons log

From
Joel Stanley <joel@jms.id.au>
Date
2017-01-13 03:54:04
The OPAL memory console is reported to be size zero, as we do not
initialise the struct attr with any size information due to the size
being variable. This leads users to think that the console is empty.

Instead report the maximum size.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/powerpc/platforms/powernv/opal-msglog.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/opal-msglog.c b/arch/powerpc/platforms/powernv/opal-msglog.c
index 39d6ff9e5630..8486b2ceb510 100644
--- a/arch/powerpc/platforms/powernv/opal-msglog.c
+++ b/arch/powerpc/platforms/powernv/opal-msglog.c
@@ -123,6 +123,10 @@ void __init opal_msglog_init(void)
 		return;
 	}
 
+	/* Report maximum size */
+	opal_msglog_attr.size =  be64_to_cpu(mc->ibuf_size) +
+		be64_to_cpu(mc->obuf_size);
+
 	opal_memcons = mc;
 }
 
-- 
2.11.0
Thread (5 messages) 5 messages, 3 authors, 2017-01-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help