public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Don Zickus <dzickus@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	torvalds@linux-foundation.org, peterz@infradead.org,
	wim@iguana.be, thomas.mingarelli@hp.com,
	akpm@linux-foundation.org, tglx@linutronix.de,
	dzickus@redhat.com
Subject: [tip:core/locking] watchdog, hpwdt: Remove priority option for NMI callback
Date: Wed, 25 Apr 2012 06:54:10 -0700	[thread overview]
Message-ID: <tip-09ee10143658cd021d879ead61ead72a196302b6@git.kernel.org> (raw)
In-Reply-To: <1333051877-15755-2-git-send-email-dzickus@redhat.com>

Commit-ID:  09ee10143658cd021d879ead61ead72a196302b6
Gitweb:     http://git.kernel.org/tip/09ee10143658cd021d879ead61ead72a196302b6
Author:     Don Zickus <dzickus@redhat.com>
AuthorDate: Thu, 29 Mar 2012 16:11:15 -0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 25 Apr 2012 12:43:33 +0200

watchdog, hpwdt: Remove priority option for NMI callback

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.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Thomas Mingarelli <thomas.mingarelli@hp.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1333051877-15755-2-git-send-email-dzickus@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 cbc7cee..4000b80 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -147,7 +147,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;
@@ -723,13 +722,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",
@@ -740,10 +735,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;
 }
 
@@ -881,10 +874,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);

  reply	other threads:[~2012-04-25 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29 20:11 [PATCH 0/3] x86, nmi: Fixes Don Zickus
2012-03-29 20:11 ` [PATCH 1/3] watchdog, hpwdt: Remove priority option for NMI callback Don Zickus
2012-04-25 13:54   ` tip-bot for Don Zickus [this message]
2012-04-26  7:13     ` [tip:core/locking] " Wim Van Sebroeck
2012-04-26 12:26       ` Don Zickus
2012-04-26 13:47         ` Mingarelli, Thomas
2012-04-26 13:53           ` Wim Van Sebroeck
2012-03-29 20:11 ` [PATCH 2/3] x86, nmi: Add new NMI queues to deal with IO_CHK and SERR Don Zickus
2012-04-25 13:55   ` [tip:core/locking] x86/nmi: " tip-bot for Don Zickus
2012-03-29 20:11 ` [PATCH 3/3] x86,nmi: Fix page faults by nmiaction if kmemcheck is enabled Don Zickus
2012-04-25 13:55   ` [tip:core/locking] x86/nmi: " tip-bot for Li Zhong
2012-04-20 16:17 ` [PATCH 0/3] x86, nmi: Fixes Seiji Aguchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-09ee10143658cd021d879ead61ead72a196302b6@git.kernel.org \
    --to=dzickus@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.mingarelli@hp.com \
    --cc=torvalds@linux-foundation.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox