public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier
@ 2007-03-20  2:12 Jay Lan
  2007-03-20  2:34 ` Horms
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jay Lan @ 2007-03-20  2:12 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 622 bytes --]

In my original patch to support MCA in kdump, changes were made to
kdump_init_notifier() of arch/ia64/kernel/crash.c. But one change
was somehow incorrectly modified in 2.6.20 to as below:

>        if ((val == DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
>                 nd->sos->rv_rc == 1)
>                return NOTIFY_DONE;

Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc
==1" is always evaluated. The kdump kernel aborted because nd->sos
is NULL in (at least some) MCA cases.

This patch corrects the problem. It was created against 2.6.21-rc4.

Signed-Off-By: Jay Lan <jlan@sgi.com>


[-- Attachment #2: mca-fix-in-kdump_init_notifier --]
[-- Type: text/plain, Size: 602 bytes --]

Index: linux/arch/ia64/kernel/crash.c
===================================================================
--- linux.orig/arch/ia64/kernel/crash.c	2007-03-15 17:20:01.000000000 -0700
+++ linux/arch/ia64/kernel/crash.c	2007-03-19 17:27:42.102401208 -0700
@@ -164,7 +164,7 @@ kdump_init_notifier(struct notifier_bloc
 
 	nd = (struct ia64_mca_notify_die *)args->err;
 	/* Reason code 1 means machine check rendezous*/
-	if ((val == DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
+	if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) &&
 		 nd->sos->rv_rc == 1)
 		return NOTIFY_DONE;
 

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

* Re: [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier
  2007-03-20  2:12 [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier Jay Lan
@ 2007-03-20  2:34 ` Horms
  2007-03-20  2:53 ` Keith Owens
  2007-03-20  4:29 ` Horms
  2 siblings, 0 replies; 4+ messages in thread
From: Horms @ 2007-03-20  2:34 UTC (permalink / raw)
  To: linux-ia64

On Mon, Mar 19, 2007 at 07:12:44PM -0700, Jay Lan wrote:
> In my original patch to support MCA in kdump, changes were made to
> kdump_init_notifier() of arch/ia64/kernel/crash.c. But one change
> was somehow incorrectly modified in 2.6.20 to as below:
> 
> >        if ((val = DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
> >                 nd->sos->rv_rc = 1)
> >                return NOTIFY_DONE;
> 
> Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc
> =1" is always evaluated. The kdump kernel aborted because nd->sos
> is NULL in (at least some) MCA cases.
> 
> This patch corrects the problem. It was created against 2.6.21-rc4.

Hi Jay,

I think that your fix below does correct a problem,
in that "|| DIE_INIT_SLAVE_ENTER" appears to be quite bogus.
But if you are worried about nd->sos being NULL, is it worth checking
for that explicitly. Or will it always be non-NULL with the code below?

> 
> Signed-Off-By: Jay Lan <jlan@sgi.com>
> 

> Index: linux/arch/ia64/kernel/crash.c
> =================================> --- linux.orig/arch/ia64/kernel/crash.c	2007-03-15 17:20:01.000000000 -0700
> +++ linux/arch/ia64/kernel/crash.c	2007-03-19 17:27:42.102401208 -0700
> @@ -164,7 +164,7 @@ kdump_init_notifier(struct notifier_bloc
>  
>  	nd = (struct ia64_mca_notify_die *)args->err;
>  	/* Reason code 1 means machine check rendezous*/
> -	if ((val = DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
> +	if ((val = DIE_INIT_MONARCH_ENTER || val = DIE_INIT_SLAVE_ENTER) &&
>  		 nd->sos->rv_rc = 1)
>  		return NOTIFY_DONE;
>  


-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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

* Re: [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier
  2007-03-20  2:12 [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier Jay Lan
  2007-03-20  2:34 ` Horms
@ 2007-03-20  2:53 ` Keith Owens
  2007-03-20  4:29 ` Horms
  2 siblings, 0 replies; 4+ messages in thread
From: Keith Owens @ 2007-03-20  2:53 UTC (permalink / raw)
  To: linux-ia64

Horms (on Tue, 20 Mar 2007 11:34:28 +0900) wrote:
>On Mon, Mar 19, 2007 at 07:12:44PM -0700, Jay Lan wrote:
>> Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc
>> =1" is always evaluated. The kdump kernel aborted because nd->sos
>> is NULL in (at least some) MCA cases.
>
>I think that your fix below does correct a problem,
>in that "|| DIE_INIT_SLAVE_ENTER" appears to be quite bogus.
>But if you are worried about nd->sos being NULL, is it worth checking
>for that explicitly. Or will it always be non-NULL with the code below?

nd->sos is only (and always) defined for the MCA/INIT SAL to OS
handlers.  nd->sos is NULL for events such as MCA rendezvous interrupt,
since that event runs on the normal kernel stack.


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

* Re: [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier
  2007-03-20  2:12 [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier Jay Lan
  2007-03-20  2:34 ` Horms
  2007-03-20  2:53 ` Keith Owens
@ 2007-03-20  4:29 ` Horms
  2 siblings, 0 replies; 4+ messages in thread
From: Horms @ 2007-03-20  4:29 UTC (permalink / raw)
  To: linux-ia64

On Tue, Mar 20, 2007 at 01:53:51PM +1100, Keith Owens wrote:
> Horms (on Tue, 20 Mar 2007 11:34:28 +0900) wrote:
> >On Mon, Mar 19, 2007 at 07:12:44PM -0700, Jay Lan wrote:
> >> Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc
> >> =1" is always evaluated. The kdump kernel aborted because nd->sos
> >> is NULL in (at least some) MCA cases.
> >
> >I think that your fix below does correct a problem,
> >in that "|| DIE_INIT_SLAVE_ENTER" appears to be quite bogus.
> >But if you are worried about nd->sos being NULL, is it worth checking
> >for that explicitly. Or will it always be non-NULL with the code below?
> 
> nd->sos is only (and always) defined for the MCA/INIT SAL to OS
> handlers.  nd->sos is NULL for events such as MCA rendezvous interrupt,
> since that event runs on the normal kernel stack.

Thanks for the clarification.

In that case.

Acked-by: Simon Horman <horms@verge.net.au>

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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

end of thread, other threads:[~2007-03-20  4:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-20  2:12 [PATCH] fix an IA64 MCA kdump bug in kdump_init_notifier Jay Lan
2007-03-20  2:34 ` Horms
2007-03-20  2:53 ` Keith Owens
2007-03-20  4:29 ` Horms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox