aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 22:25:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 22:25:14 -0400
commit5ec29e3149d800e6db83c1b6ff441daf319cbbe2 (patch)
treeb23ecaff7078590215e91b2b6aa4c90c2d923e10 /drivers/watchdog
parentabd209b7083b2f3a2a19e522f688e7569f284e5d (diff)
parent6ff968cca1dfebd4b6fcade87c11658dbfc96932 (diff)
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core locking updates from Ingo Molnar: "This update: - extends and simplifies x86 NMI callback handling code to enhance and fix the HP hw-watchdog driver - simplifies the x86 NMI callback handling code to fix a kmemcheck bug. - enhances the hung-task debugger" * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/nmi: Fix the type of the nmiaction.flags field x86/nmi: Fix page faults by nmiaction if kmemcheck is enabled x86/nmi: Add new NMI queues to deal with IO_CHK and SERR watchdog, hpwdt: Remove priority option for NMI callback hung task debugging: Inject NMI when hung and going to panic
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/hpwdt.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 9f13b897fd64..23885f2d56a0 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -147,7 +147,6 @@ struct cmn_registers {
147 147
148static unsigned int hpwdt_nmi_decoding; 148static unsigned int hpwdt_nmi_decoding;
149static unsigned int allow_kdump; 149static unsigned int allow_kdump;
150static unsigned int priority; /* hpwdt at end of die_notify list */
151static unsigned int is_icru; 150static unsigned int is_icru;
152static DEFINE_SPINLOCK(rom_lock); 151static DEFINE_SPINLOCK(rom_lock);
153static void *cru_rom_addr; 152static void *cru_rom_addr;
@@ -723,28 +722,35 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
723 } 722 }
724 723
725 /* 724 /*
726 * If the priority is set to 1, then we will be put first on the 725 * Only one function can register for NMI_UNKNOWN
727 * die notify list to handle a critical NMI. The default is to
728 * be last so other users of the NMI signal can function.
729 */ 726 */
730 retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout, 727 retval = register_nmi_handler(NMI_UNKNOWN, hpwdt_pretimeout, 0, "hpwdt");
731 (priority) ? NMI_FLAG_FIRST : 0, 728 if (retval)
732 "hpwdt"); 729 goto error;
733 if (retval != 0) { 730 retval = register_nmi_handler(NMI_SERR, hpwdt_pretimeout, 0, "hpwdt");
734 dev_warn(&dev->dev, 731 if (retval)
735 "Unable to register a die notifier (err=%d).\n", 732 goto error1;
736 retval); 733 retval = register_nmi_handler(NMI_IO_CHECK, hpwdt_pretimeout, 0, "hpwdt");
737 if (cru_rom_addr) 734 if (retval)
738 iounmap(cru_rom_addr); 735 goto error2;
739 }
740 736
741 dev_info(&dev->dev, 737 dev_info(&dev->dev,
742 "HP Watchdog Timer Driver: NMI decoding initialized" 738 "HP Watchdog Timer Driver: NMI decoding initialized"
743 ", allow kernel dump: %s (default = 0/OFF)" 739 ", allow kernel dump: %s (default = 0/OFF)\n",
744 ", priority: %s (default = 0/LAST).\n", 740 (allow_kdump == 0) ? "OFF" : "ON");
745 (allow_kdump == 0) ? "OFF" : "ON",
746 (priority == 0) ? "LAST" : "FIRST");
747 return 0; 741 return 0;
742
743error2:
744 unregister_nmi_handler(NMI_SERR, "hpwdt");
745error1:
746 unregister_nmi_handler(NMI_UNKNOWN, "hpwdt");
747error:
748 dev_warn(&dev->dev,
749 "Unable to register a die notifier (err=%d).\n",
750 retval);
751 if (cru_rom_addr)
752 iounmap(cru_rom_addr);
753 return retval;
748} 754}
749 755
750static void hpwdt_exit_nmi_decoding(void) 756static void hpwdt_exit_nmi_decoding(void)
@@ -881,10 +887,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
881#ifdef CONFIG_HPWDT_NMI_DECODING 887#ifdef CONFIG_HPWDT_NMI_DECODING
882module_param(allow_kdump, int, 0); 888module_param(allow_kdump, int, 0);
883MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs"); 889MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs");
884
885module_param(priority, int, 0);
886MODULE_PARM_DESC(priority, "The hpwdt driver handles NMIs first or last"
887 " (default = 0/Last)\n");
888#endif /* !CONFIG_HPWDT_NMI_DECODING */ 890#endif /* !CONFIG_HPWDT_NMI_DECODING */
889 891
890module_init(hpwdt_init); 892module_init(hpwdt_init);