Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pull watchdog updates from Wim Van Sebroeck:
 - Removal of the Documentation/watchdog/00-INDEX file
 - Fix boot status reporting for imx2_wdt
 - clean-up sp805_wdt, pnx4008_wdt and mpcore_wdt
 - convert printk in watchdog drivers to pr_ functions
 - change nowayout module parameter to bool for every watchdog device
 - conversion of jz4740_wdt, pnx4008_wdt, max63xx_wdt, softdog,
   ep93xx_wdt, coh901327 and txx9wdt to new watchdog API
 - Add support for the WDIOC_GETTIMELEFT ioctl call to the new watchdog
   API
 - Change the new watchdog API so that the driver updates the timeout
   value
 - two fixes for the xen_wdt driver

Fix up conflicts in ep93xx driver due to the same patches being merged
through separate branches.

* git://www.linux-watchdog.org/linux-watchdog: (33 commits)
  watchdog: txx9wdt: fix timeout
  watchdog: Convert txx9wdt driver to watchdog framework
  watchdog: coh901327_wdt.c: fix timeout
  watchdog: coh901327: convert to use watchdog core
  watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core
  watchdog: ep93xx_wdt: timeout is an unsigned int value.
  watchdog: ep93xx_wdt: Fix timeout after conversion to watchdog core
  watchdog: Convert ep93xx driver to watchdog core
  watchdog: sp805: Use devm routines
  watchdog: sp805: replace readl/writel with lighter _relaxed variants
  watchdog: sp805: Fix documentation style comment
  watchdog: mpcore_wdt: Allow platform_get_irq() to fail
  watchdog: mpcore_wdt: Use devm routines
  watchdog: mpcore_wdt: Rename dev to pdev for pointing to struct platform_device
  watchdog: xen: don't clear is_active when xen_wdt_stop() failed
  watchdog: xen: don't unconditionally enable the watchdog during resume
  watchdog: fix compiler error for missing parenthesis
  watchdog: ep93xx_wdt.c: fix platform probe
  watchdog: ep93xx: Convert the watchdog driver into a platform device.
  watchdog: fix set_timeout operations
  ...
  • Loading branch information
Linus Torvalds committed Mar 28, 2012
2 parents 89e5d6f + b92c803 commit 750f770
Show file tree
Hide file tree
Showing 109 changed files with 1,786 additions and 2,840 deletions.
19 changes: 0 additions & 19 deletions Documentation/watchdog/00-INDEX

This file was deleted.

4 changes: 4 additions & 0 deletions Documentation/watchdog/convert_drivers_to_kernel_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Here is a overview of the functions and probably needed actions:
WDIOC_GETTIMEOUT:
No preparations needed

WDIOC_GETTIMELEFT:
It needs get_timeleft() callback to be defined. Otherwise it
will return EOPNOTSUPP

Other IOCTLs can be served using the ioctl-callback. Note that this is mainly
intended for porting old drivers; new drivers should not invent private IOCTLs.
Private IOCTLs are processed first. When the callback returns with
Expand Down
11 changes: 7 additions & 4 deletions Documentation/watchdog/watchdog-kernel-api.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The Linux WatchDog Timer Driver Core kernel API.
===============================================
Last reviewed: 29-Nov-2011
Last reviewed: 16-Mar-2012

Wim Van Sebroeck <wim@iguana.be>

Expand Down Expand Up @@ -77,6 +77,7 @@ struct watchdog_ops {
int (*ping)(struct watchdog_device *);
unsigned int (*status)(struct watchdog_device *);
int (*set_timeout)(struct watchdog_device *, unsigned int);
unsigned int (*get_timeleft)(struct watchdog_device *);
long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
};

Expand Down Expand Up @@ -117,11 +118,13 @@ they are supported. These optional routines/operations are:
status of the device is reported with watchdog WDIOF_* status flags/bits.
* set_timeout: this routine checks and changes the timeout of the watchdog
timer device. It returns 0 on success, -EINVAL for "parameter out of range"
and -EIO for "could not write value to the watchdog". On success the timeout
value of the watchdog_device will be changed to the value that was just used
to re-program the watchdog timer device.
and -EIO for "could not write value to the watchdog". On success this
routine should set the timeout value of the watchdog_device to the
achieved timeout value (which may be different from the requested one
because the watchdog does not necessarily has a 1 second resolution).
(Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the
watchdog's info structure).
* get_timeleft: this routines returns the time that's left before a reset.
* ioctl: if this routine is present then it will be called first before we do
our own internal ioctl call handling. This routine should return -ENOIOCTLCMD
if a command is not supported. The parameters that are passed to the ioctl
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/ipmi/ipmi_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
#endif

static DEFINE_MUTEX(ipmi_watchdog_mutex);
static int nowayout = WATCHDOG_NOWAYOUT;
static bool nowayout = WATCHDOG_NOWAYOUT;

static ipmi_user_t watchdog_user;
static int watchdog_ifnum;
Expand Down Expand Up @@ -320,7 +320,7 @@ module_param(start_now, int, 0444);
MODULE_PARM_DESC(start_now, "Set to 1 to start the watchdog as"
"soon as the driver is loaded.");

module_param(nowayout, int, 0644);
module_param(nowayout, bool, 0644);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
"(default=CONFIG_WATCHDOG_NOWAYOUT)");

Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/fschmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
static const unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };

/* Insmod parameters */
static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/w83793.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ MODULE_PARM_DESC(timeout,
"Watchdog timeout in minutes. 2<= timeout <=255 (default="
__MODULE_STRING(WATCHDOG_TIMEOUT) ")");

static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/mei/wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ static int mei_wd_ops_set_timeout(struct watchdog_device *wd_dev, unsigned int t
mutex_lock(&dev->device_lock);

dev->wd_timeout = timeout;
wd_dev->timeout = timeout;
mei_wd_set_start_timeout(dev, dev->wd_timeout);

mutex_unlock(&dev->device_lock);
Expand Down
8 changes: 8 additions & 0 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ comment "Watchdog Device Drivers"

config SOFT_WATCHDOG
tristate "Software watchdog"
select WATCHDOG_CORE
help
A software monitoring watchdog. This will fail to reboot your system
from some situations that the hardware watchdog will recover
Expand All @@ -74,6 +75,7 @@ config WM831X_WATCHDOG
config WM8350_WATCHDOG
tristate "WM8350 watchdog"
depends on MFD_WM8350
select WATCHDOG_CORE
help
Support for the watchdog in the WM8350 AudioPlus PMIC. When
the watchdog triggers the system will be reset.
Expand Down Expand Up @@ -217,6 +219,7 @@ config MPCORE_WATCHDOG
config EP93XX_WATCHDOG
tristate "EP93xx Watchdog"
depends on ARCH_EP93XX
select WATCHDOG_CORE
help
Say Y here if to include support for the watchdog timer
embedded in the Cirrus Logic EP93xx family of devices.
Expand All @@ -234,6 +237,7 @@ config OMAP_WATCHDOG
config PNX4008_WATCHDOG
tristate "PNX4008 and LPC32XX Watchdog"
depends on ARCH_PNX4008 || ARCH_LPC32XX
select WATCHDOG_CORE
help
Say Y here if to include support for the watchdog timer
in the PNX4008 or LPC32XX processor.
Expand Down Expand Up @@ -283,6 +287,7 @@ config COH901327_WATCHDOG
bool "ST-Ericsson COH 901 327 watchdog"
depends on ARCH_U300
default y if MACH_U300
select WATCHDOG_CORE
help
Say Y here to include Watchdog timer support for the
watchdog embedded into the ST-Ericsson U300 series platforms.
Expand Down Expand Up @@ -328,6 +333,7 @@ config TS72XX_WATCHDOG
config MAX63XX_WATCHDOG
tristate "Max63xx watchdog"
depends on ARM && HAS_IOMEM
select WATCHDOG_CORE
help
Support for memory mapped max63{69,70,71,72,73,74} watchdog timer.

Expand Down Expand Up @@ -955,6 +961,7 @@ config INDYDOG
config JZ4740_WDT
tristate "Ingenic jz4740 SoC hardware watchdog"
depends on MACH_JZ4740
select WATCHDOG_CORE
help
Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.

Expand Down Expand Up @@ -996,6 +1003,7 @@ config AR7_WDT
config TXX9_WDT
tristate "Toshiba TXx9 Watchdog Timer"
depends on CPU_TX39XX || CPU_TX49XX
select WATCHDOG_CORE
help
Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs.

Expand Down
28 changes: 12 additions & 16 deletions drivers/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* Includes, defines, variables, module parameters, ...
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

/* Includes */
#include <linux/module.h> /* For module specific items */
#include <linux/moduleparam.h> /* For new moduleparam's */
Expand All @@ -70,7 +72,6 @@

/* Module information */
#define DRV_NAME "acquirewdt"
#define PFX DRV_NAME ": "
#define WATCHDOG_NAME "Acquire WDT"
/* There is no way to see what the correct time-out period is */
#define WATCHDOG_HEARTBEAT 0
Expand All @@ -92,8 +93,8 @@ static int wdt_start = 0x443;
module_param(wdt_start, int, 0);
MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)");

static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
Expand Down Expand Up @@ -208,8 +209,7 @@ static int acq_close(struct inode *inode, struct file *file)
if (expect_close == 42) {
acq_stop();
} else {
printk(KERN_CRIT PFX
"Unexpected close, not stopping watchdog!\n");
pr_crit("Unexpected close, not stopping watchdog!\n");
acq_keepalive();
}
clear_bit(0, &acq_is_open);
Expand Down Expand Up @@ -246,27 +246,24 @@ static int __devinit acq_probe(struct platform_device *dev)

if (wdt_stop != wdt_start) {
if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX
"I/O address 0x%04x already in use\n", wdt_stop);
pr_err("I/O address 0x%04x already in use\n", wdt_stop);
ret = -EIO;
goto out;
}
}

if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
wdt_start);
pr_err("I/O address 0x%04x already in use\n", wdt_start);
ret = -EIO;
goto unreg_stop;
}
ret = misc_register(&acq_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
goto unreg_regions;
}
printk(KERN_INFO PFX "initialized. (nowayout=%d)\n", nowayout);
pr_info("initialized. (nowayout=%d)\n", nowayout);

return 0;
unreg_regions:
Expand Down Expand Up @@ -308,8 +305,7 @@ static int __init acq_init(void)
{
int err;

printk(KERN_INFO
"WDT driver for Acquire single board computer initialising.\n");
pr_info("WDT driver for Acquire single board computer initialising\n");

err = platform_driver_register(&acquirewdt_driver);
if (err)
Expand All @@ -332,7 +328,7 @@ static void __exit acq_exit(void)
{
platform_device_unregister(acq_platform_device);
platform_driver_unregister(&acquirewdt_driver);
printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
pr_info("Watchdog Module Unloaded\n");
}

module_init(acq_init);
Expand Down
34 changes: 14 additions & 20 deletions drivers/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* add wdt_start and wdt_stop as parameters.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
Expand All @@ -43,7 +45,6 @@
#include <asm/system.h>

#define DRV_NAME "advantechwdt"
#define PFX DRV_NAME ": "
#define WATCHDOG_NAME "Advantech WDT"
#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */

Expand Down Expand Up @@ -77,8 +78,8 @@ MODULE_PARM_DESC(timeout,
"Watchdog timeout in seconds. 1<= timeout <=63, default="
__MODULE_STRING(WATCHDOG_TIMEOUT) ".");

static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
Expand Down Expand Up @@ -207,8 +208,7 @@ static int advwdt_close(struct inode *inode, struct file *file)
if (adv_expect_close == 42) {
advwdt_disable();
} else {
printk(KERN_CRIT PFX
"Unexpected close, not stopping watchdog!\n");
pr_crit("Unexpected close, not stopping watchdog!\n");
advwdt_ping();
}
clear_bit(0, &advwdt_is_open);
Expand Down Expand Up @@ -245,18 +245,15 @@ static int __devinit advwdt_probe(struct platform_device *dev)

if (wdt_stop != wdt_start) {
if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX
"I/O address 0x%04x already in use\n",
wdt_stop);
pr_err("I/O address 0x%04x already in use\n",
wdt_stop);
ret = -EIO;
goto out;
}
}

if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
printk(KERN_ERR PFX
"I/O address 0x%04x already in use\n",
wdt_start);
pr_err("I/O address 0x%04x already in use\n", wdt_start);
ret = -EIO;
goto unreg_stop;
}
Expand All @@ -265,18 +262,16 @@ static int __devinit advwdt_probe(struct platform_device *dev)
* if not reset to the default */
if (advwdt_set_heartbeat(timeout)) {
advwdt_set_heartbeat(WATCHDOG_TIMEOUT);
printk(KERN_INFO PFX
"timeout value must be 1<=x<=63, using %d\n", timeout);
pr_info("timeout value must be 1<=x<=63, using %d\n", timeout);
}

ret = misc_register(&advwdt_miscdev);
if (ret != 0) {
printk(KERN_ERR PFX
"cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
pr_err("cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
goto unreg_regions;
}
printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
pr_info("initialized. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);
out:
return ret;
Expand Down Expand Up @@ -318,8 +313,7 @@ static int __init advwdt_init(void)
{
int err;

printk(KERN_INFO
"WDT driver for Advantech single board computer initialising.\n");
pr_info("WDT driver for Advantech single board computer initialising\n");

err = platform_driver_register(&advwdt_driver);
if (err)
Expand All @@ -343,7 +337,7 @@ static void __exit advwdt_exit(void)
{
platform_device_unregister(advwdt_platform_device);
platform_driver_unregister(&advwdt_driver);
printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
pr_info("Watchdog Module Unloaded\n");
}

module_init(advwdt_init);
Expand Down
Loading

0 comments on commit 750f770

Please sign in to comment.