diff options
author | Don Zickus <dzickus@redhat.com> | 2011-09-30 15:06:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-10-10 00:56:57 -0400 |
commit | 9c48f1c629ecfa114850c03f875c6691003214de (patch) | |
tree | 5e454da487c90fc8399ce366aa2437597c9ff5e5 /drivers/watchdog | |
parent | c9126b2ee8adb9235941cedbf558d39a9e65642d (diff) |
x86, nmi: Wire up NMI handlers to new routines
Just convert all the files that have an nmi handler to the new routines.
Most of it is straight forward conversion. A couple of places needed some
tweaking like kgdb which separates the debug notifier from the nmi handler
and mce removes a call to notify_die.
[Thanks to Ying for finding out the history behind that mce call
https://lkml.org/lkml/2010/5/27/114
And Boris responding that he would like to remove that call because of it
https://lkml.org/lkml/2011/9/21/163]
The things that get converted are the registeration/unregistration routines
and the nmi handler itself has its args changed along with code removal
to check which list it is on (most are on one NMI list except for kgdb
which has both an NMI routine and an NMI Unknown routine).
Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Corey Minyard <minyard@acm.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Corey Minyard <minyard@acm.org>
Cc: Jack Steiner <steiner@sgi.com>
Link: http://lkml.kernel.org/r/1317409584-23662-4-git-send-email-dzickus@redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/hpwdt.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 809cbda03d7a..7e7feac05221 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -477,15 +477,11 @@ static int hpwdt_time_left(void) | |||
477 | /* | 477 | /* |
478 | * NMI Handler | 478 | * NMI Handler |
479 | */ | 479 | */ |
480 | static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason, | 480 | static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs) |
481 | void *data) | ||
482 | { | 481 | { |
483 | unsigned long rom_pl; | 482 | unsigned long rom_pl; |
484 | static int die_nmi_called; | 483 | static int die_nmi_called; |
485 | 484 | ||
486 | if (ulReason != DIE_NMIUNKNOWN) | ||
487 | goto out; | ||
488 | |||
489 | if (!hpwdt_nmi_decoding) | 485 | if (!hpwdt_nmi_decoding) |
490 | goto out; | 486 | goto out; |
491 | 487 | ||
@@ -508,7 +504,7 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason, | |||
508 | "Management Log for details.\n"); | 504 | "Management Log for details.\n"); |
509 | 505 | ||
510 | out: | 506 | out: |
511 | return NOTIFY_OK; | 507 | return NMI_DONE; |
512 | } | 508 | } |
513 | #endif /* CONFIG_HPWDT_NMI_DECODING */ | 509 | #endif /* CONFIG_HPWDT_NMI_DECODING */ |
514 | 510 | ||
@@ -648,13 +644,6 @@ static struct miscdevice hpwdt_miscdev = { | |||
648 | .fops = &hpwdt_fops, | 644 | .fops = &hpwdt_fops, |
649 | }; | 645 | }; |
650 | 646 | ||
651 | #ifdef CONFIG_HPWDT_NMI_DECODING | ||
652 | static struct notifier_block die_notifier = { | ||
653 | .notifier_call = hpwdt_pretimeout, | ||
654 | .priority = 0, | ||
655 | }; | ||
656 | #endif /* CONFIG_HPWDT_NMI_DECODING */ | ||
657 | |||
658 | /* | 647 | /* |
659 | * Init & Exit | 648 | * Init & Exit |
660 | */ | 649 | */ |
@@ -740,10 +729,9 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev) | |||
740 | * die notify list to handle a critical NMI. The default is to | 729 | * die notify list to handle a critical NMI. The default is to |
741 | * be last so other users of the NMI signal can function. | 730 | * be last so other users of the NMI signal can function. |
742 | */ | 731 | */ |
743 | if (priority) | 732 | retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout, |
744 | die_notifier.priority = 0x7FFFFFFF; | 733 | (priority) ? NMI_FLAG_FIRST : 0, |
745 | 734 | "hpwdt"); | |
746 | retval = register_die_notifier(&die_notifier); | ||
747 | if (retval != 0) { | 735 | if (retval != 0) { |
748 | dev_warn(&dev->dev, | 736 | dev_warn(&dev->dev, |
749 | "Unable to register a die notifier (err=%d).\n", | 737 | "Unable to register a die notifier (err=%d).\n", |
@@ -763,7 +751,7 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev) | |||
763 | 751 | ||
764 | static void hpwdt_exit_nmi_decoding(void) | 752 | static void hpwdt_exit_nmi_decoding(void) |
765 | { | 753 | { |
766 | unregister_die_notifier(&die_notifier); | 754 | unregister_nmi_handler(NMI_UNKNOWN, "hpwdt"); |
767 | if (cru_rom_addr) | 755 | if (cru_rom_addr) |
768 | iounmap(cru_rom_addr); | 756 | iounmap(cru_rom_addr); |
769 | } | 757 | } |