All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog, hpwdt: Remove priority option for NMI callback
@ 2012-03-09 16:37 Don Zickus
  2012-03-09 16:37 ` [PATCH 2/2] x86,nmi: Fix page faults by nmiaction if kmemcheck is enabled Don Zickus
  2012-03-09 16:51 ` [PATCH 1/2] watchdog, hpwdt: Remove priority option for NMI callback Mingarelli, Thomas
  0 siblings, 2 replies; 8+ messages in thread
From: Don Zickus @ 2012-03-09 16:37 UTC (permalink / raw)
  To: x86; +Cc: Peter Zijlstra, LKML, Don Zickus, Thomas Mingarelli,
	Wim Van Sebroeck

The NMI_UNKNOWN bucket only allows for one function to register to it.
The reason for that is because only functions which can not determine
if the NMI belongs to them or not should register and would like to
assume/swallow any NMI they see.

As a result it doesn't make sense to let more than one function like this
register.  In fact, letting a second function fail allows us to know that
more than one function is going to swallow NMIs on the current system.
This is better than silently being ignored.

Therefore hpwdt's priority mechanism doesn't make sense any more.  They
will be always first on the NMI_UNKNOWN queue, if they register.

Removing this parameter cleans up the code and simplifies things for the
next patch which changes how nmis are registered.

Cc: Thomas Mingarelli <thomas.mingarelli@hp.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Don Zickus <dzickus@redhat.com>
---
 drivers/watchdog/hpwdt.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 3c166d3..deee02c8 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -145,7 +145,6 @@ struct cmn_registers {
 
 static unsigned int hpwdt_nmi_decoding;
 static unsigned int allow_kdump;
-static unsigned int priority;		/* hpwdt at end of die_notify list */
 static unsigned int is_icru;
 static DEFINE_SPINLOCK(rom_lock);
 static void *cru_rom_addr;
@@ -730,13 +729,9 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
 	}
 
 	/*
-	 * If the priority is set to 1, then we will be put first on the
-	 * die notify list to handle a critical NMI. The default is to
-	 * be last so other users of the NMI signal can function.
+	 * Only one function can register for NMI_UNKNOWN
 	 */
-	retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout,
-					(priority) ? NMI_FLAG_FIRST : 0,
-					"hpwdt");
+	retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout, 0, "hpwdt");
 	if (retval != 0) {
 		dev_warn(&dev->dev,
 			"Unable to register a die notifier (err=%d).\n",
@@ -747,10 +742,8 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
 
 	dev_info(&dev->dev,
 			"HP Watchdog Timer Driver: NMI decoding initialized"
-			", allow kernel dump: %s (default = 0/OFF)"
-			", priority: %s (default = 0/LAST).\n",
-			(allow_kdump == 0) ? "OFF" : "ON",
-			(priority == 0) ? "LAST" : "FIRST");
+			", allow kernel dump: %s (default = 0/OFF)\n",
+			(allow_kdump == 0) ? "OFF" : "ON");
 	return 0;
 }
 
@@ -888,10 +881,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
 #ifdef CONFIG_HPWDT_NMI_DECODING
 module_param(allow_kdump, int, 0);
 MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs");
-
-module_param(priority, int, 0);
-MODULE_PARM_DESC(priority, "The hpwdt driver handles NMIs first or last"
-		" (default = 0/Last)\n");
 #endif /* !CONFIG_HPWDT_NMI_DECODING */
 
 module_init(hpwdt_init);
-- 
1.7.7.6


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

end of thread, other threads:[~2012-03-12 17:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 16:37 [PATCH 1/2] watchdog, hpwdt: Remove priority option for NMI callback Don Zickus
2012-03-09 16:37 ` [PATCH 2/2] x86,nmi: Fix page faults by nmiaction if kmemcheck is enabled Don Zickus
2012-03-09 16:51 ` [PATCH 1/2] watchdog, hpwdt: Remove priority option for NMI callback Mingarelli, Thomas
2012-03-09 17:17   ` Don Zickus
2012-03-09 17:19     ` Mingarelli, Thomas
2012-03-09 17:28     ` Mingarelli, Thomas
2012-03-09 17:33       ` Peter Zijlstra
2012-03-09 18:14       ` Don Zickus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.