Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-wat…
Browse files Browse the repository at this point in the history
…chdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] removed unused #include <version.h>
  [WATCHDOG] at91rm9200_wdt.c: fix misleading indentation
  [WATCHDOG] mpc8xxx_wdt: fix modular build
  [WATCHDOG] hpwdt.c kdebug support
  [WATCHDOG] Add support for the IDT RC32434 watchdog
  [WATCHDOG] Add support for the built-int RDC R-321x SoC watchdog
  [WATHDOG] delete unused driver mpc8xx_wdt.c
  [WATCHDOG] Fix s3c2410_wdt driver coding style issues
  [WATCHDOG] Clean out header of s3c2410_wdt driver.
  [WATCHDOG] Fix NULL usage in s3c2410_wdt driver.
  • Loading branch information
torvalds committed Aug 27, 2008
2 parents a152db7 + 3ccd3ec commit ee7cbab
Show file tree
Hide file tree
Showing 10 changed files with 714 additions and 235 deletions.
24 changes: 20 additions & 4 deletions drivers/watchdog/Kconfig
Expand Up @@ -465,6 +465,16 @@ config PC87413_WDT

Most people will say N.

config RDC321X_WDT
tristate "RDC R-321x SoC watchdog"
depends on X86_RDC321X
help
This is the driver for the built in hardware watchdog
in the RDC R-321x SoC.

To compile this driver as a module, choose M here: the
module will be called rdc321x_wdt.

config 60XX_WDT
tristate "SBC-60XX Watchdog Timer"
depends on X86
Expand Down Expand Up @@ -633,6 +643,16 @@ config SBC_EPX_C3_WATCHDOG

# MIPS Architecture

config RC32434_WDT
tristate "IDT RC32434 SoC Watchdog Timer"
depends on MIKROTIK_RB532
help
Hardware driver for the IDT RC32434 SoC built-in
watchdog timer.

To compile this driver as a module, choose M here: the
module will be called rc32434_wdt.

config INDYDOG
tristate "Indy/I2 Hardware Watchdog"
depends on SGI_HAS_INDYDOG
Expand Down Expand Up @@ -692,10 +712,6 @@ config MPC5200_WDT
tristate "MPC5200 Watchdog Timer"
depends on PPC_MPC52xx

config 8xx_WDT
tristate "MPC8xx Watchdog Timer"
depends on 8xx

config 8xxx_WDT
tristate "MPC8xxx Platform Watchdog Timer"
depends on PPC_8xx || PPC_83xx || PPC_86xx
Expand Down
3 changes: 2 additions & 1 deletion drivers/watchdog/Makefile
Expand Up @@ -75,6 +75,7 @@ obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o
obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
obj-$(CONFIG_RDC321X_WDT) += rdc321x_wdt.o
obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
obj-$(CONFIG_SBC7240_WDT) += sbc7240_wdt.o
Expand All @@ -94,6 +95,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
# M68KNOMMU Architecture

# MIPS Architecture
obj-$(CONFIG_RC32434_WDT) += rc32434_wdt.o
obj-$(CONFIG_INDYDOG) += indydog.o
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
Expand All @@ -104,7 +106,6 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
# PARISC Architecture

# POWERPC Architecture
obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o
obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/at91rm9200_wdt.c
Expand Up @@ -241,7 +241,7 @@ static int at91wdt_resume(struct platform_device *pdev)
{
if (at91wdt_busy)
at91_wdt_start();
return 0;
return 0;
}

#else
Expand Down
93 changes: 50 additions & 43 deletions drivers/watchdog/hpwdt.c
Expand Up @@ -116,6 +116,7 @@ static unsigned int reload; /* the computed soft_margin */
static int nowayout = WATCHDOG_NOWAYOUT;
static char expect_release;
static unsigned long hpwdt_is_open;
static unsigned int allow_kdump;

static void __iomem *pci_mem_addr; /* the PCI-memory address */
static unsigned long __iomem *hpwdt_timer_reg;
Expand Down Expand Up @@ -221,19 +222,19 @@ static int __devinit cru_detect(unsigned long map_entry,

if (cmn_regs.u1.ral != 0) {
printk(KERN_WARNING
"hpwdt: Call succeeded but with an error: 0x%x\n",
cmn_regs.u1.ral);
"hpwdt: Call succeeded but with an error: 0x%x\n",
cmn_regs.u1.ral);
} else {
physical_bios_base = cmn_regs.u2.rebx;
physical_bios_offset = cmn_regs.u4.redx;
cru_length = cmn_regs.u3.recx;
cru_physical_address =
physical_bios_base + physical_bios_offset;
physical_bios_base + physical_bios_offset;

/* If the values look OK, then map it in. */
if ((physical_bios_base + physical_bios_offset)) {
cru_rom_addr =
ioremap(cru_physical_address, cru_length);
ioremap(cru_physical_address, cru_length);
if (cru_rom_addr)
retval = 0;
}
Expand Down Expand Up @@ -356,7 +357,6 @@ asm(".text \n\t"
"call *%r12 \n\t"
"pushfq \n\t"
"popq %r12 \n\t"
"popfq \n\t"
"movl %eax, (%r9) \n\t"
"movl %ebx, 4(%r9) \n\t"
"movl %ecx, 8(%r9) \n\t"
Expand Down Expand Up @@ -390,10 +390,10 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm)
smbios_cru64_ptr = (struct smbios_cru64_info *) dm;
if (smbios_cru64_ptr->signature == CRU_BIOS_SIGNATURE_VALUE) {
cru_physical_address =
smbios_cru64_ptr->physical_address +
smbios_cru64_ptr->double_offset;
smbios_cru64_ptr->physical_address +
smbios_cru64_ptr->double_offset;
cru_rom_addr = ioremap(cru_physical_address,
smbios_cru64_ptr->double_length);
smbios_cru64_ptr->double_length);
}
}
}
Expand All @@ -405,41 +405,13 @@ static int __devinit detect_cru_service(void)
dmi_walk(dmi_find_cru);

/* if cru_rom_addr has been set then we found a CRU service */
return ((cru_rom_addr != NULL) ? 0: -ENODEV);
return ((cru_rom_addr != NULL) ? 0 : -ENODEV);
}

/* ------------------------------------------------------------------------- */

#endif

/*
* NMI Handler
*/
static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
void *data)
{
unsigned long rom_pl;
static int die_nmi_called;

if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
return NOTIFY_OK;

spin_lock_irqsave(&rom_lock, rom_pl);
if (!die_nmi_called)
asminline_call(&cmn_regs, cru_rom_addr);
die_nmi_called = 1;
spin_unlock_irqrestore(&rom_lock, rom_pl);
if (cmn_regs.u1.ral == 0) {
printk(KERN_WARNING "hpwdt: An NMI occurred, "
"but unable to determine source.\n");
} else {
panic("An NMI occurred, please see the Integrated "
"Management Log for details.\n");
}

return NOTIFY_STOP;
}

/*
* Watchdog operations
*/
Expand Down Expand Up @@ -483,6 +455,36 @@ static int hpwdt_change_timer(int new_margin)
return 0;
}

/*
* NMI Handler
*/
static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
void *data)
{
unsigned long rom_pl;
static int die_nmi_called;

if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
return NOTIFY_OK;

spin_lock_irqsave(&rom_lock, rom_pl);
if (!die_nmi_called)
asminline_call(&cmn_regs, cru_rom_addr);
die_nmi_called = 1;
spin_unlock_irqrestore(&rom_lock, rom_pl);
if (cmn_regs.u1.ral == 0) {
printk(KERN_WARNING "hpwdt: An NMI occurred, "
"but unable to determine source.\n");
} else {
if (allow_kdump)
hpwdt_stop();
panic("An NMI occurred, please see the Integrated "
"Management Log for details.\n");
}

return NOTIFY_STOP;
}

/*
* /dev/watchdog handling
*/
Expand Down Expand Up @@ -625,17 +627,18 @@ static struct notifier_block die_notifier = {
*/

static int __devinit hpwdt_init_one(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *ent)
{
int retval;

/*
* First let's find out if we are on an iLO2 server. We will
* not run on a legacy ASM box.
* So we only support the G5 ProLiant servers and higher.
*/
if (dev->subsystem_vendor != PCI_VENDOR_ID_HP) {
dev_warn(&dev->dev,
"This server does not have an iLO2 ASIC.\n");
"This server does not have an iLO2 ASIC.\n");
return -ENODEV;
}

Expand Down Expand Up @@ -669,7 +672,7 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,
retval = detect_cru_service();
if (retval < 0) {
dev_warn(&dev->dev,
"Unable to detect the %d Bit CRU Service.\n",
"Unable to detect the %d Bit CRU Service.\n",
HPWDT_ARCH);
goto error_get_cru;
}
Expand All @@ -684,7 +687,7 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,
retval = register_die_notifier(&die_notifier);
if (retval != 0) {
dev_warn(&dev->dev,
"Unable to register a die notifier (err=%d).\n",
"Unable to register a die notifier (err=%d).\n",
retval);
goto error_die_notifier;
}
Expand All @@ -699,8 +702,9 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,

printk(KERN_INFO
"hp Watchdog Timer Driver: 1.00"
", timer margin: %d seconds( nowayout=%d).\n",
soft_margin, nowayout);
", timer margin: %d seconds (nowayout=%d)"
", allow kernel dump: %s (default = 0/OFF).\n",
soft_margin, nowayout, (allow_kdump == 0) ? "OFF" : "ON");

return 0;

Expand Down Expand Up @@ -755,6 +759,9 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
module_param(soft_margin, int, 0);
MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds");

module_param(allow_kdump, int, 0);
MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs");

module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
Expand Down

0 comments on commit ee7cbab

Please sign in to comment.