Skip to content

Commit ee7cbab

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* 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.
2 parents a152db7 + 3ccd3ec commit ee7cbab

File tree

10 files changed

+714
-235
lines changed

10 files changed

+714
-235
lines changed

drivers/watchdog/Kconfig

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,16 @@ config PC87413_WDT
465465

466466
Most people will say N.
467467

468+
config RDC321X_WDT
469+
tristate "RDC R-321x SoC watchdog"
470+
depends on X86_RDC321X
471+
help
472+
This is the driver for the built in hardware watchdog
473+
in the RDC R-321x SoC.
474+
475+
To compile this driver as a module, choose M here: the
476+
module will be called rdc321x_wdt.
477+
468478
config 60XX_WDT
469479
tristate "SBC-60XX Watchdog Timer"
470480
depends on X86
@@ -633,6 +643,16 @@ config SBC_EPX_C3_WATCHDOG
633643

634644
# MIPS Architecture
635645

646+
config RC32434_WDT
647+
tristate "IDT RC32434 SoC Watchdog Timer"
648+
depends on MIKROTIK_RB532
649+
help
650+
Hardware driver for the IDT RC32434 SoC built-in
651+
watchdog timer.
652+
653+
To compile this driver as a module, choose M here: the
654+
module will be called rc32434_wdt.
655+
636656
config INDYDOG
637657
tristate "Indy/I2 Hardware Watchdog"
638658
depends on SGI_HAS_INDYDOG
@@ -692,10 +712,6 @@ config MPC5200_WDT
692712
tristate "MPC5200 Watchdog Timer"
693713
depends on PPC_MPC52xx
694714

695-
config 8xx_WDT
696-
tristate "MPC8xx Watchdog Timer"
697-
depends on 8xx
698-
699715
config 8xxx_WDT
700716
tristate "MPC8xxx Platform Watchdog Timer"
701717
depends on PPC_8xx || PPC_83xx || PPC_86xx

drivers/watchdog/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o
7575
obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
7676
obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
7777
obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
78+
obj-$(CONFIG_RDC321X_WDT) += rdc321x_wdt.o
7879
obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
7980
obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
8081
obj-$(CONFIG_SBC7240_WDT) += sbc7240_wdt.o
@@ -94,6 +95,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
9495
# M68KNOMMU Architecture
9596

9697
# MIPS Architecture
98+
obj-$(CONFIG_RC32434_WDT) += rc32434_wdt.o
9799
obj-$(CONFIG_INDYDOG) += indydog.o
98100
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
99101
obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
@@ -104,7 +106,6 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
104106
# PARISC Architecture
105107

106108
# POWERPC Architecture
107-
obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
108109
obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
109110
obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o
110111
obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o

drivers/watchdog/at91rm9200_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int at91wdt_resume(struct platform_device *pdev)
241241
{
242242
if (at91wdt_busy)
243243
at91_wdt_start();
244-
return 0;
244+
return 0;
245245
}
246246

247247
#else

drivers/watchdog/hpwdt.c

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ static unsigned int reload; /* the computed soft_margin */
116116
static int nowayout = WATCHDOG_NOWAYOUT;
117117
static char expect_release;
118118
static unsigned long hpwdt_is_open;
119+
static unsigned int allow_kdump;
119120

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

222223
if (cmn_regs.u1.ral != 0) {
223224
printk(KERN_WARNING
224-
"hpwdt: Call succeeded but with an error: 0x%x\n",
225-
cmn_regs.u1.ral);
225+
"hpwdt: Call succeeded but with an error: 0x%x\n",
226+
cmn_regs.u1.ral);
226227
} else {
227228
physical_bios_base = cmn_regs.u2.rebx;
228229
physical_bios_offset = cmn_regs.u4.redx;
229230
cru_length = cmn_regs.u3.recx;
230231
cru_physical_address =
231-
physical_bios_base + physical_bios_offset;
232+
physical_bios_base + physical_bios_offset;
232233

233234
/* If the values look OK, then map it in. */
234235
if ((physical_bios_base + physical_bios_offset)) {
235236
cru_rom_addr =
236-
ioremap(cru_physical_address, cru_length);
237+
ioremap(cru_physical_address, cru_length);
237238
if (cru_rom_addr)
238239
retval = 0;
239240
}
@@ -356,7 +357,6 @@ asm(".text \n\t"
356357
"call *%r12 \n\t"
357358
"pushfq \n\t"
358359
"popq %r12 \n\t"
359-
"popfq \n\t"
360360
"movl %eax, (%r9) \n\t"
361361
"movl %ebx, 4(%r9) \n\t"
362362
"movl %ecx, 8(%r9) \n\t"
@@ -390,10 +390,10 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm)
390390
smbios_cru64_ptr = (struct smbios_cru64_info *) dm;
391391
if (smbios_cru64_ptr->signature == CRU_BIOS_SIGNATURE_VALUE) {
392392
cru_physical_address =
393-
smbios_cru64_ptr->physical_address +
394-
smbios_cru64_ptr->double_offset;
393+
smbios_cru64_ptr->physical_address +
394+
smbios_cru64_ptr->double_offset;
395395
cru_rom_addr = ioremap(cru_physical_address,
396-
smbios_cru64_ptr->double_length);
396+
smbios_cru64_ptr->double_length);
397397
}
398398
}
399399
}
@@ -405,41 +405,13 @@ static int __devinit detect_cru_service(void)
405405
dmi_walk(dmi_find_cru);
406406

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

411411
/* ------------------------------------------------------------------------- */
412412

413413
#endif
414414

415-
/*
416-
* NMI Handler
417-
*/
418-
static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
419-
void *data)
420-
{
421-
unsigned long rom_pl;
422-
static int die_nmi_called;
423-
424-
if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
425-
return NOTIFY_OK;
426-
427-
spin_lock_irqsave(&rom_lock, rom_pl);
428-
if (!die_nmi_called)
429-
asminline_call(&cmn_regs, cru_rom_addr);
430-
die_nmi_called = 1;
431-
spin_unlock_irqrestore(&rom_lock, rom_pl);
432-
if (cmn_regs.u1.ral == 0) {
433-
printk(KERN_WARNING "hpwdt: An NMI occurred, "
434-
"but unable to determine source.\n");
435-
} else {
436-
panic("An NMI occurred, please see the Integrated "
437-
"Management Log for details.\n");
438-
}
439-
440-
return NOTIFY_STOP;
441-
}
442-
443415
/*
444416
* Watchdog operations
445417
*/
@@ -483,6 +455,36 @@ static int hpwdt_change_timer(int new_margin)
483455
return 0;
484456
}
485457

458+
/*
459+
* NMI Handler
460+
*/
461+
static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
462+
void *data)
463+
{
464+
unsigned long rom_pl;
465+
static int die_nmi_called;
466+
467+
if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
468+
return NOTIFY_OK;
469+
470+
spin_lock_irqsave(&rom_lock, rom_pl);
471+
if (!die_nmi_called)
472+
asminline_call(&cmn_regs, cru_rom_addr);
473+
die_nmi_called = 1;
474+
spin_unlock_irqrestore(&rom_lock, rom_pl);
475+
if (cmn_regs.u1.ral == 0) {
476+
printk(KERN_WARNING "hpwdt: An NMI occurred, "
477+
"but unable to determine source.\n");
478+
} else {
479+
if (allow_kdump)
480+
hpwdt_stop();
481+
panic("An NMI occurred, please see the Integrated "
482+
"Management Log for details.\n");
483+
}
484+
485+
return NOTIFY_STOP;
486+
}
487+
486488
/*
487489
* /dev/watchdog handling
488490
*/
@@ -625,17 +627,18 @@ static struct notifier_block die_notifier = {
625627
*/
626628

627629
static int __devinit hpwdt_init_one(struct pci_dev *dev,
628-
const struct pci_device_id *ent)
630+
const struct pci_device_id *ent)
629631
{
630632
int retval;
631633

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

@@ -669,7 +672,7 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,
669672
retval = detect_cru_service();
670673
if (retval < 0) {
671674
dev_warn(&dev->dev,
672-
"Unable to detect the %d Bit CRU Service.\n",
675+
"Unable to detect the %d Bit CRU Service.\n",
673676
HPWDT_ARCH);
674677
goto error_get_cru;
675678
}
@@ -684,7 +687,7 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,
684687
retval = register_die_notifier(&die_notifier);
685688
if (retval != 0) {
686689
dev_warn(&dev->dev,
687-
"Unable to register a die notifier (err=%d).\n",
690+
"Unable to register a die notifier (err=%d).\n",
688691
retval);
689692
goto error_die_notifier;
690693
}
@@ -699,8 +702,9 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,
699702

700703
printk(KERN_INFO
701704
"hp Watchdog Timer Driver: 1.00"
702-
", timer margin: %d seconds( nowayout=%d).\n",
703-
soft_margin, nowayout);
705+
", timer margin: %d seconds (nowayout=%d)"
706+
", allow kernel dump: %s (default = 0/OFF).\n",
707+
soft_margin, nowayout, (allow_kdump == 0) ? "OFF" : "ON");
704708

705709
return 0;
706710

@@ -755,6 +759,9 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
755759
module_param(soft_margin, int, 0);
756760
MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds");
757761

762+
module_param(allow_kdump, int, 0);
763+
MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs");
764+
758765
module_param(nowayout, int, 0);
759766
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
760767
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

0 commit comments

Comments
 (0)