Skip to content

Commit

Permalink
watchdog: hpwdt: Add check for UEFI bits
Browse files Browse the repository at this point in the history
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(-)
  • Loading branch information
Mingarelli, Thomas authored and Wim Van Sebroeck committed Jul 11, 2013
1 parent 086f3ec commit cce78da
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#endif /* CONFIG_HPWDT_NMI_DECODING */
#include <asm/nmi.h>

#define HPWDT_VERSION "1.3.1"
#define HPWDT_VERSION "1.3.2"
#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000)
#define HPWDT_MAX_TIMER TICKS_TO_SECS(65535)
Expand Down Expand Up @@ -148,6 +148,7 @@ struct cmn_registers {
static unsigned int hpwdt_nmi_decoding;
static unsigned int allow_kdump = 1;
static unsigned int is_icru;
static unsigned int is_uefi;
static DEFINE_SPINLOCK(rom_lock);
static void *cru_rom_addr;
static struct cmn_registers cmn_regs;
Expand Down Expand Up @@ -484,15 +485,15 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
goto out;

spin_lock_irqsave(&rom_lock, rom_pl);
if (!die_nmi_called && !is_icru)
if (!die_nmi_called && !is_icru && !is_uefi)
asminline_call(&cmn_regs, cru_rom_addr);
die_nmi_called = 1;
spin_unlock_irqrestore(&rom_lock, rom_pl);

if (allow_kdump)
hpwdt_stop();

if (!is_icru) {
if (!is_icru && !is_uefi) {
if (cmn_regs.u1.ral == 0) {
panic("An NMI occurred, "
"but unable to determine source.\n");
Expand Down Expand Up @@ -679,6 +680,8 @@ static void dmi_find_icru(const struct dmi_header *dm, void *dummy)
smbios_proliant_ptr = (struct smbios_proliant_info *) dm;
if (smbios_proliant_ptr->misc_features & 0x01)
is_icru = 1;
if (smbios_proliant_ptr->misc_features & 0x408)
is_uefi = 1;
}
}

Expand All @@ -697,7 +700,7 @@ static int hpwdt_init_nmi_decoding(struct pci_dev *dev)
* the old cru detect code.
*/
dmi_walk(dmi_find_icru, NULL);
if (!is_icru) {
if (!is_icru && !is_uefi) {

/*
* We need to map the ROM to get the CRU service.
Expand Down

0 comments on commit cce78da

Please sign in to comment.