Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pull first set of watchdog updates from Wim Van Sebroeck:
 "This pull contains:

   - The removal of ixp2000_wdt
   - The addition of ie6xx_wdt
   - Some documentation fixes
   - Small fixes and improvements

  (Note: Part 2 will contain generic watchdog core changes + conversion
  of some more drivers)"

* git://www.linux-watchdog.org/linux-watchdog:
  Documentation/watchdog: Fix the file descriptor leak when no cmdline arg given
  Documentation/watchdog: close the fd when cmdline arg given
  Documentation/watchdog: Fix a small typo
  watchdog: s3c2410_wdt: Set timeout to actually achieved timeout
  watchdog: wm831x: Convert to gpio_request_one()
  watchdog: via_wdt: depends on PCI
  watchdog: ie6xx_wdt needs io.h
  watchdog: ie6xx_wdt.c: fix printk format warning
  watchdog: Add watchdog driver for Intel Atom E6XX
  watchdog: it87_wdt: Add support for IT8728F watchdog.
  watchdog: i6300esb: don't depend on X86
  watchdog: Use module_pci_driver
  watchdog: sch311x_wdt.c: Remove RESGEN
  watchdog: s3c2410-wdt: Use of_match_ptr().
  watchdog: Device tree support for pnx4008-wdt
  watchdog: ar7_wdt.c: use devm_request_and_ioremap
  watchdog: remove ixp2000 driver
  watchdog: sp5100_tco.c: quiet sparse noise about using plain integer was NULL pointer
  • Loading branch information
Linus Torvalds committed May 23, 2012
2 parents 59d0952 + cad19fa commit 0b87da6
Show file tree
Hide file tree
Showing 19 changed files with 447 additions and 396 deletions.
13 changes: 13 additions & 0 deletions Documentation/devicetree/bindings/watchdog/pnx4008-wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* NXP PNX watchdog timer

Required properties:
- compatible: must be "nxp,pnx4008-wdt"
- reg: physical base address of the controller and length of memory mapped
region.

Example:

watchdog@4003C000 {
compatible = "nxp,pnx4008-wdt";
reg = <0x4003C000 0x1000>;
};
20 changes: 17 additions & 3 deletions Documentation/watchdog/src/watchdog-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/watchdog.h>
Expand All @@ -29,6 +30,14 @@ static void keep_alive(void)
* The main program. Run the program with "-d" to disable the card,
* or "-e" to enable the card.
*/

void term(int sig)
{
close(fd);
fprintf(stderr, "Stopping watchdog ticks...\n");
exit(0);
}

int main(int argc, char *argv[])
{
int flags;
Expand All @@ -47,26 +56,31 @@ int main(int argc, char *argv[])
ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card disabled.\n");
fflush(stderr);
exit(0);
goto end;
} else if (!strncasecmp(argv[1], "-e", 2)) {
flags = WDIOS_ENABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
fprintf(stderr, "Watchdog card enabled.\n");
fflush(stderr);
exit(0);
goto end;
} else {
fprintf(stderr, "-d to disable, -e to enable.\n");
fprintf(stderr, "run by itself to tick the card.\n");
fflush(stderr);
exit(0);
goto end;
}
} else {
fprintf(stderr, "Watchdog Ticking Away!\n");
fflush(stderr);
}

signal(SIGINT, term);

while(1) {
keep_alive();
sleep(1);
}
end:
close(fd);
return 0;
}
2 changes: 1 addition & 1 deletion Documentation/watchdog/watchdog-kernel-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ It contains following fields:
* bootstatus: status of the device after booting (reported with watchdog
WDIOF_* status bits).
* driver_data: a pointer to the drivers private data of a watchdog device.
This data should only be accessed via the watchdog_set_drvadata and
This data should only be accessed via the watchdog_set_drvdata and
watchdog_get_drvdata routines.
* status: this field contains a number of status bits that give extra
information about the status of the device (Like: is the watchdog timer
Expand Down
35 changes: 21 additions & 14 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ config 977_WATCHDOG

Not sure? It's safe to say N.

config IXP2000_WATCHDOG
tristate "IXP2000 Watchdog"
depends on ARCH_IXP2000
help
Say Y here if to include support for the watchdog timer
in the Intel IXP2000(2400, 2800, 2850) network processors.
This driver can be built as a module by choosing M. The module
will be called ixp2000_wdt.

Say N if you are unsure.

config IXP4XX_WATCHDOG
tristate "IXP4xx Watchdog"
depends on ARCH_IXP4XX
Expand Down Expand Up @@ -543,14 +532,27 @@ config WAFER_WDT

config I6300ESB_WDT
tristate "Intel 6300ESB Timer/Watchdog"
depends on X86 && PCI
depends on PCI
---help---
Hardware driver for the watchdog timer built into the Intel
6300ESB controller hub.

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

config IE6XX_WDT
tristate "Intel Atom E6xx Watchdog"
depends on X86 && PCI
select WATCHDOG_CORE
select MFD_CORE
select LPC_SCH
---help---
Hardware driver for the watchdog timer built into the Intel
Atom E6XX (TunnelCreek) processor.

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

config INTEL_SCU_WATCHDOG
bool "Intel SCU Watchdog for Mobile Platforms"
depends on X86_MRST
Expand Down Expand Up @@ -607,7 +609,12 @@ config IT87_WDT
depends on X86 && EXPERIMENTAL
---help---
This is the driver for the hardware watchdog on the ITE IT8702,
IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 Super I/O chips.
IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 and IT8728
Super I/O chips.

If the driver does not work, then make sure that the game port in
the BIOS is enabled.

This watchdog simply watches your kernel to make sure it doesn't
freeze, and if it does, it reboots your computer after a certain
amount of time.
Expand Down Expand Up @@ -780,7 +787,7 @@ config SMSC37B787_WDT

config VIA_WDT
tristate "VIA Watchdog Timer"
depends on X86
depends on X86 && PCI
select WATCHDOG_CORE
---help---
This is the driver for the hardware watchdog timer on VIA
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
obj-$(CONFIG_TWL4030_WATCHDOG) += twl4030_wdt.o
obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
obj-$(CONFIG_977_WATCHDOG) += wdt977.o
obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
Expand Down Expand Up @@ -81,6 +80,7 @@ obj-$(CONFIG_IB700_WDT) += ib700wdt.o
obj-$(CONFIG_IBMASR) += ibmasr.o
obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o
obj-$(CONFIG_IE6XX_WDT) += ie6xx_wdt.o
obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o
ifeq ($(CONFIG_ITCO_VENDOR_SUPPORT),y)
obj-$(CONFIG_ITCO_WDT) += iTCO_vendor_support.o
Expand Down
33 changes: 10 additions & 23 deletions drivers/watchdog/ar7_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,29 +282,19 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev)
platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
if (!ar7_regs_wdt) {
pr_err("could not get registers resource\n");
rc = -ENODEV;
goto out;
}

if (!request_mem_region(ar7_regs_wdt->start,
resource_size(ar7_regs_wdt), LONGNAME)) {
pr_warn("watchdog I/O region busy\n");
rc = -EBUSY;
goto out;
return -ENODEV;
}

ar7_wdt = ioremap(ar7_regs_wdt->start, resource_size(ar7_regs_wdt));
ar7_wdt = devm_request_and_ioremap(&pdev->dev, ar7_regs_wdt);
if (!ar7_wdt) {
pr_err("could not ioremap registers\n");
rc = -ENXIO;
goto out_mem_region;
return -ENXIO;
}

vbus_clk = clk_get(NULL, "vbus");
if (IS_ERR(vbus_clk)) {
pr_err("could not get vbus clock\n");
rc = PTR_ERR(vbus_clk);
goto out_mem_region;
return PTR_ERR(vbus_clk);
}

ar7_wdt_disable_wdt();
Expand All @@ -314,24 +304,21 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev)
rc = misc_register(&ar7_wdt_miscdev);
if (rc) {
pr_err("unable to register misc device\n");
goto out_alloc;
goto out;
}
goto out;
return 0;

out_alloc:
iounmap(ar7_wdt);
out_mem_region:
release_mem_region(ar7_regs_wdt->start, resource_size(ar7_regs_wdt));
out:
clk_put(vbus_clk);
vbus_clk = NULL;
return rc;
}

static int __devexit ar7_wdt_remove(struct platform_device *pdev)
{
misc_deregister(&ar7_wdt_miscdev);
iounmap(ar7_wdt);
release_mem_region(ar7_regs_wdt->start, resource_size(ar7_regs_wdt));

clk_put(vbus_clk);
vbus_clk = NULL;
return 0;
}

Expand Down
13 changes: 1 addition & 12 deletions drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,16 +861,6 @@ static struct pci_driver hpwdt_driver = {
.remove = __devexit_p(hpwdt_exit),
};

static void __exit hpwdt_cleanup(void)
{
pci_unregister_driver(&hpwdt_driver);
}

static int __init hpwdt_init(void)
{
return pci_register_driver(&hpwdt_driver);
}

MODULE_AUTHOR("Tom Mingarelli");
MODULE_DESCRIPTION("hp watchdog driver");
MODULE_LICENSE("GPL");
Expand All @@ -889,5 +879,4 @@ module_param(allow_kdump, int, 0);
MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs");
#endif /* !CONFIG_HPWDT_NMI_DECODING */

module_init(hpwdt_init);
module_exit(hpwdt_cleanup);
module_pci_driver(hpwdt_driver);
14 changes: 1 addition & 13 deletions drivers/watchdog/i6300esb.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,19 +492,7 @@ static struct pci_driver esb_driver = {
.shutdown = esb_shutdown,
};

static int __init watchdog_init(void)
{
return pci_register_driver(&esb_driver);
}

static void __exit watchdog_cleanup(void)
{
pci_unregister_driver(&esb_driver);
pr_info("Watchdog Module Unloaded\n");
}

module_init(watchdog_init);
module_exit(watchdog_cleanup);
module_pci_driver(esb_driver);

MODULE_AUTHOR("Ross Biro and David Härdeman");
MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets");
Expand Down
Loading

0 comments on commit 0b87da6

Please sign in to comment.