浏览代码

powerpc/powernv: Check OPAL dump calls exist before using

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

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

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Michael Neuling 11 年之前
父节点
当前提交
831cf65b02
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      arch/powerpc/platforms/powernv/opal-dump.c

+ 4 - 0
arch/powerpc/platforms/powernv/opal-dump.c

@@ -427,6 +427,10 @@ void __init opal_platform_dump_init(void)
 {
 {
 	int rc;
 	int rc;
 
 
+	/* ELOG not supported by firmware */
+	if (!opal_check_token(OPAL_DUMP_READ))
+		return;
+
 	dump_kset = kset_create_and_add("dump", NULL, opal_kobj);
 	dump_kset = kset_create_and_add("dump", NULL, opal_kobj);
 	if (!dump_kset) {
 	if (!dump_kset) {
 		pr_warn("%s: Failed to create dump kset\n", __func__);
 		pr_warn("%s: Failed to create dump kset\n", __func__);