Skip to contentSkip to conversation

powerpc/powernv: Rate limit opal-elog read failure message

PATCH Applied Andrew Donnellan 2 participants 2 messages Dec 11, 2020 – Dec 21, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv: Rate limit opal-elog read failure message

Sometimes we can't read an error log from OPAL, and we print an error message accordingly. But the OPAL userspace tools seem to like retrying a lot, in which case we flood the kernel log with a lot of messages.

Change pr_err() to pr_err_ratelimited() to help with this.

---
 arch/powerpc/platforms/powernv/opal-elog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/opal-elog.c +2 -2
index 37b380eef41a..5821b0fa8614 100644
@@ -171,8 +171,8 @@ static ssize_t raw_attr_read(struct file *filep, struct kobject *kobj,
 		opal_rc = opal_read_elog(__pa(elog->buffer),
 					 elog->size, elog->id);
 		if (opal_rc != OPAL_SUCCESS) {
-			pr_err("ELOG: log read failed for log-id=%llx\n",
-			       elog->id);
+			pr_err_ratelimited("ELOG: log read failed for log-id=%llx\n",
+					   elog->id);
 			kfree(elog->buffer);
 			elog->buffer = NULL;
 			return -EIO;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Andrew Donnellan

Sometimes we can't read an error log from OPAL, and we print an error message accordingly. But the OPAL userspace tools seem to like retrying a lot, in which case we flood the kernel log with a lot of messages.

Change pr_err() to pr_err_ratelimited() to help with this.

Applied to powerpc/next.

[1/1] powerpc/powernv: Rate limit opal-elog read failure message

      https://git.kernel.org/powerpc/c/c88017cf2af614409da69934c1738ed5ff2f7022

cheers