public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
@ 2008-05-28 19:00 Cyrill Gorcunov
  2008-05-28 19:08 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-05-28 19:00 UTC (permalink / raw)
  To: H. Peter Anvin, Ingo Molnar, Thomas Gleixner
  Cc: Maciej W. Rozycki, Sitsofe Wheeler, Adrian Bunk, LKML

The commit

	commit 4b82b277707a39b97271439c475f186f63ec4692
	Author: Cyrill Gorcunov <gorcunov@gmail.com>
	Date:   Sat May 24 19:36:35 2008 +0400

set nmi_watchdog to NMI_IO_APIC as by default. This causes hangs on some
machines with buggy watchdogs. Fix it - i.e. restore old behaviour.

Thanks to Sitsofe Wheeler and Adrian Bunk for catching the problem
and Maciej W. Rozycki for explanation what is going on there.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
CC: Maciej W. Rozycki <macro@linux-mips.org>
---

The patch is over today tip/x86/nmi

Index: linux-2.6.git/arch/x86/kernel/nmi.c
====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/nmi.c	2008-05-28 22:32:38.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/nmi.c	2008-05-28 22:40:48.000000000 +0400
@@ -84,20 +84,15 @@ static inline unsigned int get_timer_irq
 #endif
 }
 
+#ifdef CONFIG_X86_64
 /* Run after command line and cpu_init init, but before all other checks */
 void nmi_watchdog_default(void)
 {
 	if (nmi_watchdog != NMI_DEFAULT)
 		return;
-#ifdef CONFIG_X86_64
 	nmi_watchdog = NMI_NONE;
-#else
-	if (lapic_watchdog_ok())
-		nmi_watchdog = NMI_LOCAL_APIC;
-	else
-		nmi_watchdog = NMI_IO_APIC;
-#endif
 }
+#endif
 
 #ifdef CONFIG_SMP
 /*
@@ -488,8 +483,15 @@ int proc_nmi_enabled(struct ctl_table *t
 		return -EIO;
 	}
 
+#ifdef CONFIG_X86_64
 	/* if nmi_watchdog is not set yet, then set it */
 	nmi_watchdog_default();
+#else
+	if (lapic_watchdog_ok())
+		nmi_watchdog = NMI_LOCAL_APIC;
+	else
+		nmi_watchdog = NMI_IO_APIC;
+#endif
 
 	if (nmi_watchdog == NMI_LOCAL_APIC) {
 		if (nmi_watchdog_enabled)
Index: linux-2.6.git/include/asm-x86/nmi.h
====================================================================
--- linux-2.6.git.orig/include/asm-x86/nmi.h	2008-05-28 22:32:41.000000000 +0400
+++ linux-2.6.git/include/asm-x86/nmi.h	2008-05-28 22:39:55.000000000 +0400
@@ -38,9 +38,11 @@ static inline void unset_nmi_pm_callback
 
 #ifdef CONFIG_X86_64
 extern void default_do_nmi(struct pt_regs *);
+extern void nmi_watchdog_default(void);
+#else
+#define nmi_watchdog_default(void) do {} while (0)
 #endif
 
-extern void nmi_watchdog_default(void);
 extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
 extern int check_nmi_watchdog(void);
 extern int nmi_watchdog_enabled;

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

* Re: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
  2008-05-28 19:00 [PATCH] x86: nmi - fix incorrect NMI watchdog used by default Cyrill Gorcunov
@ 2008-05-28 19:08 ` Ingo Molnar
  2008-05-30 12:54 ` Ingo Molnar
  2008-05-31  7:42 ` Sitsofe Wheeler
  2 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-05-28 19:08 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: H. Peter Anvin, Thomas Gleixner, Maciej W. Rozycki,
	Sitsofe Wheeler, Adrian Bunk, LKML, x86


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> The commit
> 
> 	commit 4b82b277707a39b97271439c475f186f63ec4692
> 	Author: Cyrill Gorcunov <gorcunov@gmail.com>
> 	Date:   Sat May 24 19:36:35 2008 +0400
> 
> set nmi_watchdog to NMI_IO_APIC as by default. This causes hangs on 
> some machines with buggy watchdogs. Fix it - i.e. restore old 
> behaviour.
> 
> Thanks to Sitsofe Wheeler and Adrian Bunk for catching the problem and 
> Maciej W. Rozycki for explanation what is going on there.

applied, thanks Cyrill.

	Ingo

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

* Re: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
  2008-05-28 19:00 [PATCH] x86: nmi - fix incorrect NMI watchdog used by default Cyrill Gorcunov
  2008-05-28 19:08 ` Ingo Molnar
@ 2008-05-30 12:54 ` Ingo Molnar
  2008-05-30 14:44   ` Cyrill Gorcunov
  2008-05-31  7:42 ` Sitsofe Wheeler
  2 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-05-30 12:54 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: H. Peter Anvin, Thomas Gleixner, Maciej W. Rozycki,
	Sitsofe Wheeler, Adrian Bunk, LKML


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> +extern void nmi_watchdog_default(void);
> +#else
> +#define nmi_watchdog_default(void) do {} while (0)
                                  ^------

that doesnt work too well in a macro ... :-)

	Ingo

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

* Re: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
  2008-05-30 12:54 ` Ingo Molnar
@ 2008-05-30 14:44   ` Cyrill Gorcunov
  2008-05-30 15:09     ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-05-30 14:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: H. Peter Anvin, Thomas Gleixner, Maciej W. Rozycki,
	Sitsofe Wheeler, Adrian Bunk, LKML

[Ingo Molnar - Fri, May 30, 2008 at 02:54:00PM +0200]
| 
| * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
| 
| > +extern void nmi_watchdog_default(void);
| > +#else
| > +#define nmi_watchdog_default(void) do {} while (0)
|                                   ^------
| 
| that doesnt work too well in a macro ... :-)
| 
| 	Ingo
| 

Oh my.... maybe two prerocessor passes would help? ;-)
here is an updated version, please reapply, and thanks a lot
for catching this Ingo! Sorry for inconvenience.

		- Cyrill -
---

Subject: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default

Commit

commit 4b82b277707a39b97271439c475f186f63ec4692
Author: Cyrill Gorcunov <gorcunov@gmail.com>
Date:   Sat May 24 19:36:35 2008 +0400

sets nmi_watchdog to NMI_IO_APIC as by default value
even not being asking to. That causes hangs on some
machines with buggy watchdogs. Fix it - i.e. restore
old behaviour.

Thanks to Sitsofe Wheeler and Adrian Bunk for catching
the problem and Maciej W. Rozycki for explanation what
is going on there.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
CC: Maciej W. Rozycki <macro@linux-mips.org>
---

Index: linux-2.6.git/arch/x86/kernel/nmi.c
====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/nmi.c	2008-05-28 22:32:38.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/nmi.c	2008-05-28 22:40:48.000000000 +0400
@@ -84,20 +84,15 @@ static inline unsigned int get_timer_irq
 #endif
 }
 
+#ifdef CONFIG_X86_64
 /* Run after command line and cpu_init init, but before all other checks */
 void nmi_watchdog_default(void)
 {
 	if (nmi_watchdog != NMI_DEFAULT)
 		return;
-#ifdef CONFIG_X86_64
 	nmi_watchdog = NMI_NONE;
-#else
-	if (lapic_watchdog_ok())
-		nmi_watchdog = NMI_LOCAL_APIC;
-	else
-		nmi_watchdog = NMI_IO_APIC;
-#endif
 }
+#endif
 
 #ifdef CONFIG_SMP
 /*
@@ -488,8 +483,15 @@ int proc_nmi_enabled(struct ctl_table *t
 		return -EIO;
 	}
 
+#ifdef CONFIG_X86_64
 	/* if nmi_watchdog is not set yet, then set it */
 	nmi_watchdog_default();
+#else
+	if (lapic_watchdog_ok())
+		nmi_watchdog = NMI_LOCAL_APIC;
+	else
+		nmi_watchdog = NMI_IO_APIC;
+#endif
 
 	if (nmi_watchdog == NMI_LOCAL_APIC) {
 		if (nmi_watchdog_enabled)
Index: linux-2.6.git/include/asm-x86/nmi.h
====================================================================
--- linux-2.6.git.orig/include/asm-x86/nmi.h	2008-05-28 22:32:41.000000000 +0400
+++ linux-2.6.git/include/asm-x86/nmi.h	2008-05-28 22:39:55.000000000 +0400
@@ -38,9 +38,11 @@ static inline void unset_nmi_pm_callback
 
 #ifdef CONFIG_X86_64
 extern void default_do_nmi(struct pt_regs *);
+extern void nmi_watchdog_default(void);
+#else
+#define nmi_watchdog_default() do {} while (0)
 #endif
 
-extern void nmi_watchdog_default(void);
 extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
 extern int check_nmi_watchdog(void);
 extern int nmi_watchdog_enabled;

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

* Re: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
  2008-05-30 14:44   ` Cyrill Gorcunov
@ 2008-05-30 15:09     ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-05-30 15:09 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: H. Peter Anvin, Thomas Gleixner, Maciej W. Rozycki,
	Sitsofe Wheeler, Adrian Bunk, LKML


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> | > +#else
> | > +#define nmi_watchdog_default(void) do {} while (0)
> |                                   ^------
> | 
> | that doesnt work too well in a macro ... :-)
> | 
> | 	Ingo
> | 
> 
> Oh my.... maybe two prerocessor passes would help? ;-) here is an 
> updated version, please reapply, and thanks a lot for catching this 
> Ingo! Sorry for inconvenience.

no problem, already fixed in latest -tip :)

	Ingo

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

* Re: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
  2008-05-28 19:00 [PATCH] x86: nmi - fix incorrect NMI watchdog used by default Cyrill Gorcunov
  2008-05-28 19:08 ` Ingo Molnar
  2008-05-30 12:54 ` Ingo Molnar
@ 2008-05-31  7:42 ` Sitsofe Wheeler
  2008-05-31  9:15   ` Cyrill Gorcunov
  2 siblings, 1 reply; 7+ messages in thread
From: Sitsofe Wheeler @ 2008-05-31  7:42 UTC (permalink / raw)
  To: linux-kernel

Cyrill Gorcunov wrote:

> The commit
> 
> commit 4b82b277707a39b97271439c475f186f63ec4692
> Author: Cyrill Gorcunov <gorcunov@gmail.com>
> Date:   Sat May 24 19:36:35 2008 +0400
> 
> set nmi_watchdog to NMI_IO_APIC as by default. This causes hangs on some
> machines with buggy watchdogs. Fix it - i.e. restore old behaviour.

Thanks for fixing this. Just for the record, the problem also seemed to
depend on the ACPI Video option. Removing that also stopped the problem...
However I can confirm that I don't have a boot hang with next-0530.

-- 
Sitsofe | http://sucs.org/~sits/


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

* Re: [PATCH] x86: nmi - fix incorrect NMI watchdog used by default
  2008-05-31  7:42 ` Sitsofe Wheeler
@ 2008-05-31  9:15   ` Cyrill Gorcunov
  0 siblings, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-05-31  9:15 UTC (permalink / raw)
  To: Sitsofe Wheeler; +Cc: linux-kernel

[Sitsofe Wheeler - Sat, May 31, 2008 at 08:42:06AM +0100]
| Cyrill Gorcunov wrote:
| 
| > The commit
| > 
| > commit 4b82b277707a39b97271439c475f186f63ec4692
| > Author: Cyrill Gorcunov <gorcunov@gmail.com>
| > Date:   Sat May 24 19:36:35 2008 +0400
| > 
| > set nmi_watchdog to NMI_IO_APIC as by default. This causes hangs on some
| > machines with buggy watchdogs. Fix it - i.e. restore old behaviour.
| 
| Thanks for fixing this. Just for the record, the problem also seemed to
| depend on the ACPI Video option. Removing that also stopped the problem...
| However I can confirm that I don't have a boot hang with next-0530.
| 
| -- 
| Sitsofe | http://sucs.org/~sits/
|

ok, thanks for testing and additional info

		- Cyrill -

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

end of thread, other threads:[~2008-05-31  9:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 19:00 [PATCH] x86: nmi - fix incorrect NMI watchdog used by default Cyrill Gorcunov
2008-05-28 19:08 ` Ingo Molnar
2008-05-30 12:54 ` Ingo Molnar
2008-05-30 14:44   ` Cyrill Gorcunov
2008-05-30 15:09     ` Ingo Molnar
2008-05-31  7:42 ` Sitsofe Wheeler
2008-05-31  9:15   ` Cyrill Gorcunov

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