linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type
@ 2015-12-11  1:08 Stewart Smith
  2015-12-11  2:21 ` Michael Ellerman
  2015-12-17 10:19 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Stewart Smith @ 2015-12-11  1:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: 蒲文

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.

Cc: stable@vger.kernel.org
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/opal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 4296d55e88f3..57cffb80bc36 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -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);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type
  2015-12-11  1:08 [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type Stewart Smith
@ 2015-12-11  2:21 ` Michael Ellerman
  2015-12-11  2:43   ` Wen Pu
  2015-12-11  6:54   ` Stewart Smith
  2015-12-17 10:19 ` Michael Ellerman
  1 sibling, 2 replies; 5+ messages in thread
From: Michael Ellerman @ 2015-12-11  2:21 UTC (permalink / raw)
  To: Stewart Smith, linuxppc-dev; +Cc: 蒲文

On Fri, 2015-12-11 at 12:08 +1100, Stewart Smith wrote:
> 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.
> 
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index 4296d55e88f3..57cffb80bc36 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type
  2015-12-11  2:21 ` Michael Ellerman
@ 2015-12-11  2:43   ` Wen Pu
  2015-12-11  6:54   ` Stewart Smith
  1 sibling, 0 replies; 5+ messages in thread
From: Wen Pu @ 2015-12-11  2:43 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Stewart Smith, linuxppc-dev

On Friday, December 11, 2015 01:21:05 PM Michael Ellerman wrote:
> On Fri, 2015-12-11 at 12:08 +1100, Stewart Smith wrote:
> > 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.
> > 
> > diff --git a/arch/powerpc/platforms/powernv/opal.c
> > b/arch/powerpc/platforms/powernv/opal.c index 4296d55e88f3..57cffb80bc36
> > 100644
> > --- a/arch/powerpc/platforms/powernv/opal.c
> > +++ b/arch/powerpc/platforms/powernv/opal.c
> > @@ -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

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

Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type
  2015-12-11  2:21 ` Michael Ellerman
  2015-12-11  2:43   ` Wen Pu
@ 2015-12-11  6:54   ` Stewart Smith
  1 sibling, 0 replies; 5+ messages in thread
From: Stewart Smith @ 2015-12-11  6:54 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: 蒲文

Michael Ellerman <mpe@ellerman.id.au> writes:
> On Fri, 2015-12-11 at 12:08 +1100, Stewart Smith wrote:
>> 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.
>> 
>> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
>> index 4296d55e88f3..57cffb80bc36 100644
>> --- a/arch/powerpc/platforms/powernv/opal.c
>> +++ b/arch/powerpc/platforms/powernv/opal.c
>> @@ -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?

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.....

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type
  2015-12-11  1:08 [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type Stewart Smith
  2015-12-11  2:21 ` Michael Ellerman
@ 2015-12-17 10:19 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2015-12-17 10:19 UTC (permalink / raw)
  To: Stewart Smith, linuxppc-dev; +Cc: 蒲文

On Fri, 2015-11-12 at 01:08:23 UTC, Stewart Smith wrote:
> 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.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Applied to powerpc fixes, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-17 10:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-11  1:08 [PATCH] powerpc/powernv: pr_warn_once on unsupported OPAL_MSG type Stewart Smith
2015-12-11  2:21 ` Michael Ellerman
2015-12-11  2:43   ` Wen Pu
2015-12-11  6:54   ` Stewart Smith
2015-12-17 10:19 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).