aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/hpwdt.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 809cbda03d7a..3774c9b8dac9 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -35,6 +35,7 @@
35#include <linux/notifier.h> 35#include <linux/notifier.h>
36#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
37#endif /* CONFIG_HPWDT_NMI_DECODING */ 37#endif /* CONFIG_HPWDT_NMI_DECODING */
38#include <asm/nmi.h>
38 39
39#define HPWDT_VERSION "1.3.0" 40#define HPWDT_VERSION "1.3.0"
40#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) 41#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
@@ -477,15 +478,11 @@ static int hpwdt_time_left(void)
477/* 478/*
478 * NMI Handler 479 * NMI Handler
479 */ 480 */
480static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason, 481static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
481 void *data)
482{ 482{
483 unsigned long rom_pl; 483 unsigned long rom_pl;
484 static int die_nmi_called; 484 static int die_nmi_called;
485 485
486 if (ulReason != DIE_NMIUNKNOWN)
487 goto out;
488
489 if (!hpwdt_nmi_decoding) 486 if (!hpwdt_nmi_decoding)
490 goto out; 487 goto out;
491 488
@@ -508,7 +505,7 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
508 "Management Log for details.\n"); 505 "Management Log for details.\n");
509 506
510out: 507out:
511 return NOTIFY_OK; 508 return NMI_DONE;
512} 509}
513#endif /* CONFIG_HPWDT_NMI_DECODING */ 510#endif /* CONFIG_HPWDT_NMI_DECODING */
514 511
@@ -648,13 +645,6 @@ static struct miscdevice hpwdt_miscdev = {
648 .fops = &hpwdt_fops, 645 .fops = &hpwdt_fops,
649}; 646};
650 647
651#ifdef CONFIG_HPWDT_NMI_DECODING
652static struct notifier_block die_notifier = {
653 .notifier_call = hpwdt_pretimeout,
654 .priority = 0,
655};
656#endif /* CONFIG_HPWDT_NMI_DECODING */
657
658/* 648/*
659 * Init & Exit 649 * Init & Exit
660 */ 650 */
@@ -740,10 +730,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 730 * die notify list to handle a critical NMI. The default is to
741 * be last so other users of the NMI signal can function. 731 * be last so other users of the NMI signal can function.
742 */ 732 */
743 if (priority) 733 retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout,
744 die_notifier.priority = 0x7FFFFFFF; 734 (priority) ? NMI_FLAG_FIRST : 0,
745 735 "hpwdt");
746 retval = register_die_notifier(&die_notifier);
747 if (retval != 0) { 736 if (retval != 0) {
748 dev_warn(&dev->dev, 737 dev_warn(&dev->dev,
749 "Unable to register a die notifier (err=%d).\n", 738 "Unable to register a die notifier (err=%d).\n",
@@ -763,7 +752,7 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
763 752
764static void hpwdt_exit_nmi_decoding(void) 753static void hpwdt_exit_nmi_decoding(void)
765{ 754{
766 unregister_die_notifier(&die_notifier); 755 unregister_nmi_handler(NMI_UNKNOWN, "hpwdt");
767 if (cru_rom_addr) 756 if (cru_rom_addr)
768 iounmap(cru_rom_addr); 757 iounmap(cru_rom_addr);
769} 758}