[PATCH 1/2] powerpc/powernv: Change BUG_ON to WARN_ON in elog code

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE4411d REVIEWED: 1 (0M)

1 review trailer.

4 messages, 2 authors, 2014-07-23 · open the first message on its own page

[PATCH 1/2] powerpc/powernv: Change BUG_ON to WARN_ON in elog code

From: Vasant Hegde <hidden>
Date: 2014-07-23 09:22:47

We can continue to read the error log (up to MAX size) even if
we get the elog size more than MAX size. Hence change BUG_ON to
WARN_ON.

Also updated error message.

Reported-by: Gopesh Kumar Chaudhary <redacted>
Signed-off-by: Vasant Hegde <redacted>
Signed-off-by: Ananth N Mavinakayanahalli <redacted>
Acked-by: Deepthi Dharwar <redacted>
---
 arch/powerpc/platforms/powernv/opal-elog.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 10268c4..0ad533b 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -249,7 +249,7 @@ static void elog_work_fn(struct work_struct *work)
 
 	rc = opal_get_elog_size(&id, &size, &type);
 	if (rc != OPAL_SUCCESS) {
-		pr_err("ELOG: Opal log read failed\n");
+		pr_err("ELOG: OPAL log info read failed\n");
 		return;
 	}
 
@@ -257,7 +257,7 @@ static void elog_work_fn(struct work_struct *work)
 	log_id = be64_to_cpu(id);
 	elog_type = be64_to_cpu(type);
 
-	BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
+	WARN_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
 
 	if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
 		elog_size  =  OPAL_MAX_ERRLOG_SIZE;

[PATCH 2/2] powerpc/powernv: Improve error message

From: Vasant Hegde <hidden>
Date: 2014-07-23 09:23:04

Presently we only support initiating Service Processor dump from host.
Hence update sysfs message. Also update couple of other error/info
messages.

Signed-off-by: Vasant Hegde <redacted>
---
 arch/powerpc/platforms/powernv/opal-dump.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 788a197..3e33e28 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -112,7 +112,7 @@ static ssize_t init_dump_show(struct dump_obj *dump_obj,
 			      struct dump_attribute *attr,
 			      char *buf)
 {
-	return sprintf(buf, "1 - initiate dump\n");
+	return sprintf(buf, "1 - initiate Service Processor(FSP) dump\n");
 }
 
 static int64_t dump_fips_init(uint8_t type)
@@ -121,7 +121,7 @@ static int64_t dump_fips_init(uint8_t type)
 
 	rc = opal_dump_init(type);
 	if (rc)
-		pr_warn("%s: Failed to initiate FipS dump (%d)\n",
+		pr_warn("%s: Failed to initiate FSP dump (%d)\n",
 			__func__, rc);
 	return rc;
 }
@@ -131,8 +131,12 @@ static ssize_t init_dump_store(struct dump_obj *dump_obj,
 			       const char *buf,
 			       size_t count)
 {
-	dump_fips_init(DUMP_TYPE_FSP);
-	pr_info("%s: Initiated FSP dump\n", __func__);
+	int rc;
+
+	rc = dump_fips_init(DUMP_TYPE_FSP);
+	if (rc == OPAL_SUCCESS)
+		pr_info("%s: Initiated FSP dump\n", __func__);
+
 	return count;
 }
 
@@ -297,7 +301,7 @@ static ssize_t dump_attr_read(struct file *filep, struct kobject *kobj,
 			 * and rely on userspace to ask us to try
 			 * again.
 			 */
-			pr_info("%s: Platform dump partially read.ID = 0x%x\n",
+			pr_info("%s: Platform dump partially read. ID = 0x%x\n",
 				__func__, dump->id);
 			return -EIO;
 		}

Re: [PATCH 2/2] powerpc/powernv: Improve error message

From: Stewart Smith <hidden>
Date: 2014-07-23 12:16:43

Vasant Hegde [off-list ref] writes:
Presently we only support initiating Service Processor dump from host.
Hence update sysfs message. Also update couple of other error/info
messages.

Signed-off-by: Vasant Hegde <redacted>
Acked-by: Stewart Smith <redacted>

Re: [PATCH 1/2] powerpc/powernv: Change BUG_ON to WARN_ON in elog code

From: Stewart Smith <hidden>
Date: 2014-07-23 13:07:32

Vasant Hegde [off-list ref] writes:
We can continue to read the error log (up to MAX size) even if
we get the elog size more than MAX size. Hence change BUG_ON to
WARN_ON.

Also updated error message.

Reported-by: Gopesh Kumar Chaudhary <redacted>
Signed-off-by: Vasant Hegde <redacted>
Signed-off-by: Ananth N Mavinakayanahalli <redacted>
Acked-by: Deepthi Dharwar <redacted>
So, it turns out the BUG_ON actually caught an FSP bug, at the very
least in their documentation.

The WARN_ON is probably the best thing we can do, along with the
OPAL/skiboot side fixes that I've mentioned separately.

Acked-by: Stewart Smith <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help