[PATCH 02/13] powerpc/powernv: Check OPAL elog calls exist before using

tim.gardner at canonical.com tim.gardner at canonical.com
Thu Nov 20 17:01:46 UTC 2014


From: Michael Neuling <mikey at neuling.org>

BugLink: http://bugs.launchpad.net/bugs/1391953

Check that the OPAL_ELOG_READ token exists before initalising the elog
infrastructure.

This avoids littering the OPAL console with:
  "OPAL: Called with bad token 74"

Signed-off-by: Michael Neuling <mikey at neuling.org>
Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 arch/powerpc/platforms/powernv/opal-elog.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 0ad533b..feb47b9 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -295,6 +295,10 @@ int __init opal_elog_init(void)
 {
 	int rc = 0;
 
+	/* ELOG not supported by firmware */
+	if (!opal_check_token(OPAL_ELOG_READ))
+		return -1;
+
 	elog_kset = kset_create_and_add("elog", NULL, opal_kobj);
 	if (!elog_kset) {
 		pr_warn("%s: failed to create elog kset\n", __func__);
-- 
2.1.3





More information about the kernel-team mailing list