Skip to contentSkip to conversation

powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type

PATCH Applied Stewart Smith 3 participants 5 messages Dec 11, 2015 – Dec 17, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type

When running on newer OPAL firmware that supports sending extra OPAL_MSG types, we would print a warning on *every* message received.

This could be a problem for kernels that don't support OPAL_MSG_OCC on machines that are running real close to thermal limits and the OCC is throttling the chip. For a kernel that is paying attention to the message queue, we could get these notifications quite often.

Conceivably, future message types could also come fairly often, and printing that we didn't understand them 10,000 times provides no further information than printing them once.

---
 arch/powerpc/platforms/powernv/opal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powernv/opal.c +1 -1
index 4296d55e88f3..57cffb80bc36 100644
@@ -278,7 +278,7 @@ static void opal_handle_message(void)
 
 	/* Sanity check */
 	if (type >= OPAL_MSG_TYPE_MAX) {
-		pr_warning("%s: Unknown message type: %u\n", __func__, type);
+		pr_warn_once("%s: Unknown message type: %u\n", __func__, type);
 		return;
 	}
 	opal_message_do_notify(type, (void *)&msg);
Signature · 1 line
2.1.4
#1 lore raw
Quoted 17 lines · Stewart Smith

When running on newer OPAL firmware that supports sending extra OPAL_MSG types, we would print a warning on *every* message received.

This could be a problem for kernels that don't support OPAL_MSG_OCC on machines that are running real close to thermal limits and the OCC is throttling the chip. For a kernel that is paying attention to the message queue, we could get these notifications quite often.

Conceivably, future message types could also come fairly often, and printing that we didn't understand them 10,000 times provides no further information than printing them once.

arch/powerpc/platforms/powernv/opal.c +0 -0
index 4296d55e88f3..57cffb80bc36 100644

arch/powerpc/platforms/powernv/opal.c static void opal_handle_message(void) · line 282

Quoted 6 lines
arch/powerpc/platforms/powernv/opal.c +1 -1
@@ -278,7 +278,7 @@ static void opal_handle_message(void)
 
 	/* Sanity check */
 	if (type >= OPAL_MSG_TYPE_MAX) {
-		pr_warning("%s: Unknown message type: %u\n", __func__, type);
+		pr_warn_once("%s: Unknown message type: %u\n", __func__, type);
 		return;

This will only print once, even if there are multiple unknown message types, are we happy with that?

cheers

#2 lore raw
Quoted 26 lines · Michael Ellerman
Quoted 25 lines · Stewart Smith

When running on newer OPAL firmware that supports sending extra OPAL_MSG types, we would print a warning on *every* message received.

This could be a problem for kernels that don't support OPAL_MSG_OCC on machines that are running real close to thermal limits and the OCC is throttling the chip. For a kernel that is paying attention to the message queue, we could get these notifications quite often.

Conceivably, future message types could also come fairly often, and printing that we didn't understand them 10,000 times provides no further information than printing them once.

(quoted diff) +0 -0

b/arch/powerpc/platforms/powernv/opal.c index 4296d55e88f3..57cffb80bc36 100644

arch/powerpc/platforms/powernv/opal.c +1 -1
@@ -278,7 +278,7 @@ static void opal_handle_message(void)
 
 	/* Sanity check */
 	if (type >= OPAL_MSG_TYPE_MAX) {
 
-		pr_warning("%s: Unknown message type: %u\n", __func__, type);
+		pr_warn_once("%s: Unknown message type: %u\n", __func__, type);
 
Quoted 6 lines

arch/powerpc/platforms/powernv/opal.c static void opal_handle_message(void) · line 284

Quoted 1 line
arch/powerpc/platforms/powernv/opal.c +0 -0
 		return;

This will only print once, even if there are multiple unknown message types, are we happy with that?

cheers

Yes, I also think it's much better that printing once than printing a warning on *every* message received.

Thanks!

#3 lore raw
In reply to Michael Ellerman
Quoted 19 lines · Michael Ellerman
Quoted 18 lines · Stewart Smith

When running on newer OPAL firmware that supports sending extra OPAL_MSG types, we would print a warning on *every* message received.

This could be a problem for kernels that don't support OPAL_MSG_OCC on machines that are running real close to thermal limits and the OCC is throttling the chip. For a kernel that is paying attention to the message queue, we could get these notifications quite often.

Conceivably, future message types could also come fairly often, and printing that we didn't understand them 10,000 times provides no further information than printing them once.

arch/powerpc/platforms/powernv/opal.c +0 -0
index 4296d55e88f3..57cffb80bc36 100644
@@ -278,7 +278,7 @@ static void opal_handle_message(void)
 
Quoted 8 lines

arch/powerpc/platforms/powernv/opal.c static void opal_handle_message(void) · line 282

Quoted 5 lines
arch/powerpc/platforms/powernv/opal.c +1 -1
 	/* Sanity check */
 	if (type >= OPAL_MSG_TYPE_MAX) {
-		pr_warning("%s: Unknown message type: %u\n", __func__, type);
+		pr_warn_once("%s: Unknown message type: %u\n", __func__, type);
 		return;

This will only print once, even if there are multiple unknown message types, are we happy with that?

I am - it's just "your firmware knows more than you do". From that, when diagnosing, you can grab firmware version to know how many it has, and from kernel version you'll know how many it has. There'll probably be something printed in OPAL logs if somebody starts to care about it.

We could always hexdump out what the message is and create Yet Another Unreadable Error Message.....

reviewer Applied
#4 lore raw
In reply to Stewart Smith
Quoted 8 lines · Stewart Smith

When running on newer OPAL firmware that supports sending extra OPAL_MSG types, we would print a warning on *every* message received.

This could be a problem for kernels that don't support OPAL_MSG_OCC on machines that are running real close to thermal limits and the OCC is throttling the chip. For a kernel that is paying attention to the message queue, we could get these notifications quite often.

Quoted 6 lines

Conceivably, future message types could also come fairly often, and printing that we didn't understand them 10,000 times provides no further information than printing them once.

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/98da62b716a3b24ab8e77453

cheers