summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/hpwdt.c
diff options
context:
space:
mode:
authorMingarelli, Thomas <Thomas.Mingarelli@hp.com>2013-07-09 19:04:55 -0400
committerWim Van Sebroeck <wim@iguana.be>2013-07-11 16:20:06 -0400
commitcce78da76601b64305c050f602767bf58cebcf5d (patch)
treeb531a1e3991b501338b45e59e7e0a1ab10cd41e8 /drivers/watchdog/hpwdt.c
parent086f3ec187a18e29f8f36ebd4ae9eb8d48d9fd03 (diff)
watchdog: hpwdt: Add check for UEFI bits
This patch is being created to use the UEFI bits in the type 219 SMBIOS record in order to decide whether or not to execute BIOS code. This is a better solution than to depend on the iCRU bit since not all future servers will use iCRU. Signed-off-by: Thomas Mingarelli <thomas.mingarelli@hp.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> ---- drivers/watchdog/hpwdt.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
Diffstat (limited to 'drivers/watchdog/hpwdt.c')
-rw-r--r--drivers/watchdog/hpwdt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 11796b9b864e..de7e4f497222 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -39,7 +39,7 @@
39#endif /* CONFIG_HPWDT_NMI_DECODING */ 39#endif /* CONFIG_HPWDT_NMI_DECODING */
40#include <asm/nmi.h> 40#include <asm/nmi.h>
41 41
42#define HPWDT_VERSION "1.3.1" 42#define HPWDT_VERSION "1.3.2"
43#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) 43#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
44#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000) 44#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000)
45#define HPWDT_MAX_TIMER TICKS_TO_SECS(65535) 45#define HPWDT_MAX_TIMER TICKS_TO_SECS(65535)
@@ -148,6 +148,7 @@ struct cmn_registers {
148static unsigned int hpwdt_nmi_decoding; 148static unsigned int hpwdt_nmi_decoding;
149static unsigned int allow_kdump = 1; 149static unsigned int allow_kdump = 1;
150static unsigned int is_icru; 150static unsigned int is_icru;
151static unsigned int is_uefi;
151static DEFINE_SPINLOCK(rom_lock); 152static DEFINE_SPINLOCK(rom_lock);
152static void *cru_rom_addr; 153static void *cru_rom_addr;
153static struct cmn_registers cmn_regs; 154static struct cmn_registers cmn_regs;
@@ -484,7 +485,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
484 goto out; 485 goto out;
485 486
486 spin_lock_irqsave(&rom_lock, rom_pl); 487 spin_lock_irqsave(&rom_lock, rom_pl);
487 if (!die_nmi_called && !is_icru) 488 if (!die_nmi_called && !is_icru && !is_uefi)
488 asminline_call(&cmn_regs, cru_rom_addr); 489 asminline_call(&cmn_regs, cru_rom_addr);
489 die_nmi_called = 1; 490 die_nmi_called = 1;
490 spin_unlock_irqrestore(&rom_lock, rom_pl); 491 spin_unlock_irqrestore(&rom_lock, rom_pl);
@@ -492,7 +493,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
492 if (allow_kdump) 493 if (allow_kdump)
493 hpwdt_stop(); 494 hpwdt_stop();
494 495
495 if (!is_icru) { 496 if (!is_icru && !is_uefi) {
496 if (cmn_regs.u1.ral == 0) { 497 if (cmn_regs.u1.ral == 0) {
497 panic("An NMI occurred, " 498 panic("An NMI occurred, "
498 "but unable to determine source.\n"); 499 "but unable to determine source.\n");
@@ -679,6 +680,8 @@ static void dmi_find_icru(const struct dmi_header *dm, void *dummy)
679 smbios_proliant_ptr = (struct smbios_proliant_info *) dm; 680 smbios_proliant_ptr = (struct smbios_proliant_info *) dm;
680 if (smbios_proliant_ptr->misc_features & 0x01) 681 if (smbios_proliant_ptr->misc_features & 0x01)
681 is_icru = 1; 682 is_icru = 1;
683 if (smbios_proliant_ptr->misc_features & 0x408)
684 is_uefi = 1;
682 } 685 }
683} 686}
684 687
@@ -697,7 +700,7 @@ static int hpwdt_init_nmi_decoding(struct pci_dev *dev)
697 * the old cru detect code. 700 * the old cru detect code.
698 */ 701 */
699 dmi_walk(dmi_find_icru, NULL); 702 dmi_walk(dmi_find_icru, NULL);
700 if (!is_icru) { 703 if (!is_icru && !is_uefi) {
701 704
702 /* 705 /*
703 * We need to map the ROM to get the CRU service. 706 * We need to map the ROM to get the CRU service.