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(-)
This commit is contained in:
parent
086f3ec187
commit
cce78da766
|
@ -39,7 +39,7 @@
|
||||||
#endif /* CONFIG_HPWDT_NMI_DECODING */
|
#endif /* CONFIG_HPWDT_NMI_DECODING */
|
||||||
#include <asm/nmi.h>
|
#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 SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
|
||||||
#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000)
|
#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000)
|
||||||
#define HPWDT_MAX_TIMER TICKS_TO_SECS(65535)
|
#define HPWDT_MAX_TIMER TICKS_TO_SECS(65535)
|
||||||
|
@ -148,6 +148,7 @@ struct cmn_registers {
|
||||||
static unsigned int hpwdt_nmi_decoding;
|
static unsigned int hpwdt_nmi_decoding;
|
||||||
static unsigned int allow_kdump = 1;
|
static unsigned int allow_kdump = 1;
|
||||||
static unsigned int is_icru;
|
static unsigned int is_icru;
|
||||||
|
static unsigned int is_uefi;
|
||||||
static DEFINE_SPINLOCK(rom_lock);
|
static DEFINE_SPINLOCK(rom_lock);
|
||||||
static void *cru_rom_addr;
|
static void *cru_rom_addr;
|
||||||
static struct cmn_registers cmn_regs;
|
static struct cmn_registers cmn_regs;
|
||||||
|
@ -484,7 +485,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
spin_lock_irqsave(&rom_lock, rom_pl);
|
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);
|
asminline_call(&cmn_regs, cru_rom_addr);
|
||||||
die_nmi_called = 1;
|
die_nmi_called = 1;
|
||||||
spin_unlock_irqrestore(&rom_lock, rom_pl);
|
spin_unlock_irqrestore(&rom_lock, rom_pl);
|
||||||
|
@ -492,7 +493,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
|
||||||
if (allow_kdump)
|
if (allow_kdump)
|
||||||
hpwdt_stop();
|
hpwdt_stop();
|
||||||
|
|
||||||
if (!is_icru) {
|
if (!is_icru && !is_uefi) {
|
||||||
if (cmn_regs.u1.ral == 0) {
|
if (cmn_regs.u1.ral == 0) {
|
||||||
panic("An NMI occurred, "
|
panic("An NMI occurred, "
|
||||||
"but unable to determine source.\n");
|
"but unable to determine source.\n");
|
||||||
|
@ -679,6 +680,8 @@ static void dmi_find_icru(const struct dmi_header *dm, void *dummy)
|
||||||
smbios_proliant_ptr = (struct smbios_proliant_info *) dm;
|
smbios_proliant_ptr = (struct smbios_proliant_info *) dm;
|
||||||
if (smbios_proliant_ptr->misc_features & 0x01)
|
if (smbios_proliant_ptr->misc_features & 0x01)
|
||||||
is_icru = 1;
|
is_icru = 1;
|
||||||
|
if (smbios_proliant_ptr->misc_features & 0x408)
|
||||||
|
is_uefi = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,7 +700,7 @@ static int hpwdt_init_nmi_decoding(struct pci_dev *dev)
|
||||||
* the old cru detect code.
|
* the old cru detect code.
|
||||||
*/
|
*/
|
||||||
dmi_walk(dmi_find_icru, NULL);
|
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.
|
* We need to map the ROM to get the CRU service.
|
||||||
|
|
Loading…
Reference in a new issue