aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:15 -0400
committerJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:59 -0400
commit07f9479a40cc778bc1462ada11f95b01360ae4ff (patch)
tree0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /drivers/watchdog
parent9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff)
parentcd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff)
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be applied for files that didn't exist on the old branch.
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/Kconfig2
-rw-r--r--drivers/watchdog/Makefile4
-rw-r--r--drivers/watchdog/acquirewdt.c2
-rw-r--r--drivers/watchdog/davinci_wdt.c22
-rw-r--r--drivers/watchdog/max63xx_wdt.c20
-rw-r--r--drivers/watchdog/mpc8xxx_wdt.c2
-rw-r--r--drivers/watchdog/nv_tco.c2
-rw-r--r--drivers/watchdog/pc87413_wdt.c2
-rw-r--r--drivers/watchdog/pnx4008_wdt.c28
-rw-r--r--drivers/watchdog/rdc321x_wdt.c3
-rw-r--r--drivers/watchdog/s3c2410_wdt.c19
-rw-r--r--drivers/watchdog/sbc7240_wdt.c2
-rw-r--r--drivers/watchdog/sch311x_wdt.c2
-rw-r--r--drivers/watchdog/shwdt.c2
-rw-r--r--drivers/watchdog/smsc37b787_wdt.c2
-rw-r--r--drivers/watchdog/softdog.c16
-rw-r--r--drivers/watchdog/sp5100_tco.c16
-rw-r--r--drivers/watchdog/sp805_wdt.c2
18 files changed, 80 insertions, 68 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index b69d71482554..1b0f98bc51b5 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -933,7 +933,7 @@ config PNX833X_WDT
933 depends on SOC_PNX8335 933 depends on SOC_PNX8335
934 help 934 help
935 Hardware driver for the PNX833x's watchdog. This is a 935 Hardware driver for the PNX833x's watchdog. This is a
936 watchdog timer that will reboot the machine after a programable 936 watchdog timer that will reboot the machine after a programmable
937 timer has expired and no process has written to /dev/watchdog during 937 timer has expired and no process has written to /dev/watchdog during
938 that time. 938 that time.
939 939
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index d520bf9c3355..3f8608b922a7 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -4,7 +4,7 @@
4 4
5# Only one watchdog can succeed. We probe the ISA/PCI/USB based 5# Only one watchdog can succeed. We probe the ISA/PCI/USB based
6# watchdog-cards first, then the architecture specific watchdog 6# watchdog-cards first, then the architecture specific watchdog
7# drivers and then the architecture independant "softdog" driver. 7# drivers and then the architecture independent "softdog" driver.
8# This means that if your ISA/PCI/USB card isn't detected that 8# This means that if your ISA/PCI/USB card isn't detected that
9# you can fall back to an architecture specific driver and if 9# you can fall back to an architecture specific driver and if
10# that also fails then you can fall back to the software watchdog 10# that also fails then you can fall back to the software watchdog
@@ -153,7 +153,7 @@ obj-$(CONFIG_WATCHDOG_CP1XXX) += cpwd.o
153# Xen 153# Xen
154obj-$(CONFIG_XEN_WDT) += xen_wdt.o 154obj-$(CONFIG_XEN_WDT) += xen_wdt.o
155 155
156# Architecture Independant 156# Architecture Independent
157obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o 157obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
158obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o 158obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
159obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o 159obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c
index 2ffce4d75443..b6a2b58cbe64 100644
--- a/drivers/watchdog/acquirewdt.c
+++ b/drivers/watchdog/acquirewdt.c
@@ -26,7 +26,7 @@
26 * Theory of Operation: 26 * Theory of Operation:
27 * The Watch-Dog Timer is provided to ensure that standalone 27 * The Watch-Dog Timer is provided to ensure that standalone
28 * Systems can always recover from catastrophic conditions that 28 * Systems can always recover from catastrophic conditions that
29 * caused the CPU to crash. This condition may have occured by 29 * caused the CPU to crash. This condition may have occurred by
30 * external EMI or a software bug. When the CPU stops working 30 * external EMI or a software bug. When the CPU stops working
31 * correctly, hardware on the board will either perform a hardware 31 * correctly, hardware on the board will either perform a hardware
32 * reset (cold boot) or a non-maskable interrupt (NMI) to bring the 32 * reset (cold boot) or a non-maskable interrupt (NMI) to bring the
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
index 596ba604e78d..51b5551b4e3f 100644
--- a/drivers/watchdog/davinci_wdt.c
+++ b/drivers/watchdog/davinci_wdt.c
@@ -202,7 +202,6 @@ static struct miscdevice davinci_wdt_miscdev = {
202static int __devinit davinci_wdt_probe(struct platform_device *pdev) 202static int __devinit davinci_wdt_probe(struct platform_device *pdev)
203{ 203{
204 int ret = 0, size; 204 int ret = 0, size;
205 struct resource *res;
206 struct device *dev = &pdev->dev; 205 struct device *dev = &pdev->dev;
207 206
208 wdt_clk = clk_get(dev, NULL); 207 wdt_clk = clk_get(dev, NULL);
@@ -216,31 +215,31 @@ static int __devinit davinci_wdt_probe(struct platform_device *pdev)
216 215
217 dev_info(dev, "heartbeat %d sec\n", heartbeat); 216 dev_info(dev, "heartbeat %d sec\n", heartbeat);
218 217
219 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 218 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
220 if (res == NULL) { 219 if (wdt_mem == NULL) {
221 dev_err(dev, "failed to get memory region resource\n"); 220 dev_err(dev, "failed to get memory region resource\n");
222 return -ENOENT; 221 return -ENOENT;
223 } 222 }
224 223
225 size = resource_size(res); 224 size = resource_size(wdt_mem);
226 wdt_mem = request_mem_region(res->start, size, pdev->name); 225 if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
227
228 if (wdt_mem == NULL) {
229 dev_err(dev, "failed to get memory region\n"); 226 dev_err(dev, "failed to get memory region\n");
230 return -ENOENT; 227 return -ENOENT;
231 } 228 }
232 229
233 wdt_base = ioremap(res->start, size); 230 wdt_base = ioremap(wdt_mem->start, size);
234 if (!wdt_base) { 231 if (!wdt_base) {
235 dev_err(dev, "failed to map memory region\n"); 232 dev_err(dev, "failed to map memory region\n");
233 release_mem_region(wdt_mem->start, size);
234 wdt_mem = NULL;
236 return -ENOMEM; 235 return -ENOMEM;
237 } 236 }
238 237
239 ret = misc_register(&davinci_wdt_miscdev); 238 ret = misc_register(&davinci_wdt_miscdev);
240 if (ret < 0) { 239 if (ret < 0) {
241 dev_err(dev, "cannot register misc device\n"); 240 dev_err(dev, "cannot register misc device\n");
242 release_resource(wdt_mem); 241 release_mem_region(wdt_mem->start, size);
243 kfree(wdt_mem); 242 wdt_mem = NULL;
244 } else { 243 } else {
245 set_bit(WDT_DEVICE_INITED, &wdt_status); 244 set_bit(WDT_DEVICE_INITED, &wdt_status);
246 } 245 }
@@ -253,8 +252,7 @@ static int __devexit davinci_wdt_remove(struct platform_device *pdev)
253{ 252{
254 misc_deregister(&davinci_wdt_miscdev); 253 misc_deregister(&davinci_wdt_miscdev);
255 if (wdt_mem) { 254 if (wdt_mem) {
256 release_resource(wdt_mem); 255 release_mem_region(wdt_mem->start, resource_size(wdt_mem));
257 kfree(wdt_mem);
258 wdt_mem = NULL; 256 wdt_mem = NULL;
259 } 257 }
260 258
diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c
index 7a82ce5a6337..73ba2fd8e591 100644
--- a/drivers/watchdog/max63xx_wdt.c
+++ b/drivers/watchdog/max63xx_wdt.c
@@ -270,7 +270,6 @@ static int __devinit max63xx_wdt_probe(struct platform_device *pdev)
270{ 270{
271 int ret = 0; 271 int ret = 0;
272 int size; 272 int size;
273 struct resource *res;
274 struct device *dev = &pdev->dev; 273 struct device *dev = &pdev->dev;
275 struct max63xx_timeout *table; 274 struct max63xx_timeout *table;
276 275
@@ -294,21 +293,19 @@ static int __devinit max63xx_wdt_probe(struct platform_device *pdev)
294 293
295 max63xx_pdev = pdev; 294 max63xx_pdev = pdev;
296 295
297 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 296 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
298 if (res == NULL) { 297 if (wdt_mem == NULL) {
299 dev_err(dev, "failed to get memory region resource\n"); 298 dev_err(dev, "failed to get memory region resource\n");
300 return -ENOENT; 299 return -ENOENT;
301 } 300 }
302 301
303 size = resource_size(res); 302 size = resource_size(wdt_mem);
304 wdt_mem = request_mem_region(res->start, size, pdev->name); 303 if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
305
306 if (wdt_mem == NULL) {
307 dev_err(dev, "failed to get memory region\n"); 304 dev_err(dev, "failed to get memory region\n");
308 return -ENOENT; 305 return -ENOENT;
309 } 306 }
310 307
311 wdt_base = ioremap(res->start, size); 308 wdt_base = ioremap(wdt_mem->start, size);
312 if (!wdt_base) { 309 if (!wdt_base) {
313 dev_err(dev, "failed to map memory region\n"); 310 dev_err(dev, "failed to map memory region\n");
314 ret = -ENOMEM; 311 ret = -ENOMEM;
@@ -326,8 +323,8 @@ static int __devinit max63xx_wdt_probe(struct platform_device *pdev)
326out_unmap: 323out_unmap:
327 iounmap(wdt_base); 324 iounmap(wdt_base);
328out_request: 325out_request:
329 release_resource(wdt_mem); 326 release_mem_region(wdt_mem->start, size);
330 kfree(wdt_mem); 327 wdt_mem = NULL;
331 328
332 return ret; 329 return ret;
333} 330}
@@ -336,8 +333,7 @@ static int __devexit max63xx_wdt_remove(struct platform_device *pdev)
336{ 333{
337 misc_deregister(&max63xx_wdt_miscdev); 334 misc_deregister(&max63xx_wdt_miscdev);
338 if (wdt_mem) { 335 if (wdt_mem) {
339 release_resource(wdt_mem); 336 release_mem_region(wdt_mem->start, resource_size(wdt_mem));
340 kfree(wdt_mem);
341 wdt_mem = NULL; 337 wdt_mem = NULL;
342 } 338 }
343 339
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
index 6709d723e017..528bceb220fd 100644
--- a/drivers/watchdog/mpc8xxx_wdt.c
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -195,7 +195,7 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev)
195 195
196 if (!ofdev->dev.of_match) 196 if (!ofdev->dev.of_match)
197 return -EINVAL; 197 return -EINVAL;
198 wdt_type = match->data; 198 wdt_type = ofdev->dev.of_match->data;
199 199
200 if (!freq || freq == -1) 200 if (!freq || freq == -1)
201 return -EINVAL; 201 return -EINVAL;
diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c
index 267377a5a83e..afa78a54711e 100644
--- a/drivers/watchdog/nv_tco.c
+++ b/drivers/watchdog/nv_tco.c
@@ -302,7 +302,7 @@ MODULE_DEVICE_TABLE(pci, tco_pci_tbl);
302 * Init & exit routines 302 * Init & exit routines
303 */ 303 */
304 304
305static unsigned char __init nv_tco_getdevice(void) 305static unsigned char __devinit nv_tco_getdevice(void)
306{ 306{
307 struct pci_dev *dev = NULL; 307 struct pci_dev *dev = NULL;
308 u32 val; 308 u32 val;
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c
index 139d773300c6..b7c139051575 100644
--- a/drivers/watchdog/pc87413_wdt.c
+++ b/drivers/watchdog/pc87413_wdt.c
@@ -49,7 +49,7 @@
49#define WDT_DATA_IO_PORT (WDT_INDEX_IO_PORT+1) 49#define WDT_DATA_IO_PORT (WDT_INDEX_IO_PORT+1)
50#define SWC_LDN 0x04 50#define SWC_LDN 0x04
51#define SIOCFG2 0x22 /* Serial IO register */ 51#define SIOCFG2 0x22 /* Serial IO register */
52#define WDCTL 0x10 /* Watchdog-Timer-Controll-Register */ 52#define WDCTL 0x10 /* Watchdog-Timer-Control-Register */
53#define WDTO 0x11 /* Watchdog timeout register */ 53#define WDTO 0x11 /* Watchdog timeout register */
54#define WDCFG 0x12 /* Watchdog config register */ 54#define WDCFG 0x12 /* Watchdog config register */
55 55
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index c7cf4cbf8ab3..614933225560 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -254,7 +254,6 @@ static struct miscdevice pnx4008_wdt_miscdev = {
254static int __devinit pnx4008_wdt_probe(struct platform_device *pdev) 254static int __devinit pnx4008_wdt_probe(struct platform_device *pdev)
255{ 255{
256 int ret = 0, size; 256 int ret = 0, size;
257 struct resource *res;
258 257
259 if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) 258 if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
260 heartbeat = DEFAULT_HEARTBEAT; 259 heartbeat = DEFAULT_HEARTBEAT;
@@ -262,42 +261,42 @@ static int __devinit pnx4008_wdt_probe(struct platform_device *pdev)
262 printk(KERN_INFO MODULE_NAME 261 printk(KERN_INFO MODULE_NAME
263 "PNX4008 Watchdog Timer: heartbeat %d sec\n", heartbeat); 262 "PNX4008 Watchdog Timer: heartbeat %d sec\n", heartbeat);
264 263
265 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 264 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
266 if (res == NULL) { 265 if (wdt_mem == NULL) {
267 printk(KERN_INFO MODULE_NAME 266 printk(KERN_INFO MODULE_NAME
268 "failed to get memory region resouce\n"); 267 "failed to get memory region resouce\n");
269 return -ENOENT; 268 return -ENOENT;
270 } 269 }
271 270
272 size = resource_size(res); 271 size = resource_size(wdt_mem);
273 wdt_mem = request_mem_region(res->start, size, pdev->name);
274 272
275 if (wdt_mem == NULL) { 273 if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
276 printk(KERN_INFO MODULE_NAME "failed to get memory region\n"); 274 printk(KERN_INFO MODULE_NAME "failed to get memory region\n");
277 return -ENOENT; 275 return -ENOENT;
278 } 276 }
279 wdt_base = (void __iomem *)IO_ADDRESS(res->start); 277 wdt_base = (void __iomem *)IO_ADDRESS(wdt_mem->start);
280 278
281 wdt_clk = clk_get(&pdev->dev, NULL); 279 wdt_clk = clk_get(&pdev->dev, NULL);
282 if (IS_ERR(wdt_clk)) { 280 if (IS_ERR(wdt_clk)) {
283 ret = PTR_ERR(wdt_clk); 281 ret = PTR_ERR(wdt_clk);
284 release_resource(wdt_mem); 282 release_mem_region(wdt_mem->start, size);
285 kfree(wdt_mem); 283 wdt_mem = NULL;
286 goto out; 284 goto out;
287 } 285 }
288 286
289 ret = clk_enable(wdt_clk); 287 ret = clk_enable(wdt_clk);
290 if (ret) { 288 if (ret) {
291 release_resource(wdt_mem); 289 release_mem_region(wdt_mem->start, size);
292 kfree(wdt_mem); 290 wdt_mem = NULL;
291 clk_put(wdt_clk);
293 goto out; 292 goto out;
294 } 293 }
295 294
296 ret = misc_register(&pnx4008_wdt_miscdev); 295 ret = misc_register(&pnx4008_wdt_miscdev);
297 if (ret < 0) { 296 if (ret < 0) {
298 printk(KERN_ERR MODULE_NAME "cannot register misc device\n"); 297 printk(KERN_ERR MODULE_NAME "cannot register misc device\n");
299 release_resource(wdt_mem); 298 release_mem_region(wdt_mem->start, size);
300 kfree(wdt_mem); 299 wdt_mem = NULL;
301 clk_disable(wdt_clk); 300 clk_disable(wdt_clk);
302 clk_put(wdt_clk); 301 clk_put(wdt_clk);
303 } else { 302 } else {
@@ -320,8 +319,7 @@ static int __devexit pnx4008_wdt_remove(struct platform_device *pdev)
320 clk_put(wdt_clk); 319 clk_put(wdt_clk);
321 320
322 if (wdt_mem) { 321 if (wdt_mem) {
323 release_resource(wdt_mem); 322 release_mem_region(wdt_mem->start, resource_size(wdt_mem));
324 kfree(wdt_mem);
325 wdt_mem = NULL; 323 wdt_mem = NULL;
326 } 324 }
327 return 0; 325 return 0;
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c
index 3939e53f5f98..d8e725082fdc 100644
--- a/drivers/watchdog/rdc321x_wdt.c
+++ b/drivers/watchdog/rdc321x_wdt.c
@@ -37,6 +37,7 @@
37#include <linux/io.h> 37#include <linux/io.h>
38#include <linux/uaccess.h> 38#include <linux/uaccess.h>
39#include <linux/mfd/rdc321x.h> 39#include <linux/mfd/rdc321x.h>
40#include <linux/mfd/core.h>
40 41
41#define RDC_WDT_MASK 0x80000000 /* Mask */ 42#define RDC_WDT_MASK 0x80000000 /* Mask */
42#define RDC_WDT_EN 0x00800000 /* Enable bit */ 43#define RDC_WDT_EN 0x00800000 /* Enable bit */
@@ -231,7 +232,7 @@ static int __devinit rdc321x_wdt_probe(struct platform_device *pdev)
231 struct resource *r; 232 struct resource *r;
232 struct rdc321x_wdt_pdata *pdata; 233 struct rdc321x_wdt_pdata *pdata;
233 234
234 pdata = platform_get_drvdata(pdev); 235 pdata = mfd_get_data(pdev);
235 if (!pdata) { 236 if (!pdata) {
236 dev_err(&pdev->dev, "no platform data supplied\n"); 237 dev_err(&pdev->dev, "no platform data supplied\n");
237 return -ENODEV; 238 return -ENODEV;
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 25b39bf35925..f7f5aa00df60 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -402,7 +402,6 @@ static inline void s3c2410wdt_cpufreq_deregister(void)
402 402
403static int __devinit s3c2410wdt_probe(struct platform_device *pdev) 403static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
404{ 404{
405 struct resource *res;
406 struct device *dev; 405 struct device *dev;
407 unsigned int wtcon; 406 unsigned int wtcon;
408 int started = 0; 407 int started = 0;
@@ -416,20 +415,19 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
416 415
417 /* get the memory region for the watchdog timer */ 416 /* get the memory region for the watchdog timer */
418 417
419 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 418 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
420 if (res == NULL) { 419 if (wdt_mem == NULL) {
421 dev_err(dev, "no memory resource specified\n"); 420 dev_err(dev, "no memory resource specified\n");
422 return -ENOENT; 421 return -ENOENT;
423 } 422 }
424 423
425 size = resource_size(res); 424 size = resource_size(wdt_mem);
426 wdt_mem = request_mem_region(res->start, size, pdev->name); 425 if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
427 if (wdt_mem == NULL) {
428 dev_err(dev, "failed to get memory region\n"); 426 dev_err(dev, "failed to get memory region\n");
429 return -EBUSY; 427 return -EBUSY;
430 } 428 }
431 429
432 wdt_base = ioremap(res->start, size); 430 wdt_base = ioremap(wdt_mem->start, size);
433 if (wdt_base == NULL) { 431 if (wdt_base == NULL) {
434 dev_err(dev, "failed to ioremap() region\n"); 432 dev_err(dev, "failed to ioremap() region\n");
435 ret = -EINVAL; 433 ret = -EINVAL;
@@ -524,8 +522,8 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
524 iounmap(wdt_base); 522 iounmap(wdt_base);
525 523
526 err_req: 524 err_req:
527 release_resource(wdt_mem); 525 release_mem_region(wdt_mem->start, size);
528 kfree(wdt_mem); 526 wdt_mem = NULL;
529 527
530 return ret; 528 return ret;
531} 529}
@@ -545,8 +543,7 @@ static int __devexit s3c2410wdt_remove(struct platform_device *dev)
545 543
546 iounmap(wdt_base); 544 iounmap(wdt_base);
547 545
548 release_resource(wdt_mem); 546 release_mem_region(wdt_mem->start, resource_size(wdt_mem));
549 kfree(wdt_mem);
550 wdt_mem = NULL; 547 wdt_mem = NULL;
551 return 0; 548 return 0;
552} 549}
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c
index 67ddeb1c830a..ff11504c376e 100644
--- a/drivers/watchdog/sbc7240_wdt.c
+++ b/drivers/watchdog/sbc7240_wdt.c
@@ -273,7 +273,7 @@ static int __init sbc7240_wdt_init(void)
273 273
274 /* The IO port 0x043 used to disable the watchdog 274 /* The IO port 0x043 used to disable the watchdog
275 * is already claimed by the system timer, so we 275 * is already claimed by the system timer, so we
276 * cant request_region() it ...*/ 276 * can't request_region() it ...*/
277 277
278 if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) { 278 if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) {
279 timeout = SBC7240_TIMEOUT; 279 timeout = SBC7240_TIMEOUT;
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c
index b61ab1c54293..c7cf4b01f58d 100644
--- a/drivers/watchdog/sch311x_wdt.c
+++ b/drivers/watchdog/sch311x_wdt.c
@@ -201,7 +201,7 @@ static void sch311x_wdt_get_status(int *status)
201 spin_lock(&sch311x_wdt_data.io_lock); 201 spin_lock(&sch311x_wdt_data.io_lock);
202 202
203 /* -- Watchdog timer control -- 203 /* -- Watchdog timer control --
204 * Bit 0 Status Bit: 0 = Timer counting, 1 = Timeout occured 204 * Bit 0 Status Bit: 0 = Timer counting, 1 = Timeout occurred
205 * Bit 1 Reserved 205 * Bit 1 Reserved
206 * Bit 2 Force Timeout: 1 = Forces WD timeout event (self-cleaning) 206 * Bit 2 Force Timeout: 1 = Forces WD timeout event (self-cleaning)
207 * Bit 3 P20 Force Timeout enabled: 207 * Bit 3 P20 Force Timeout enabled:
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index 4e3e7eb5919c..db84f2322d1a 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -50,7 +50,7 @@
50 * necssary. 50 * necssary.
51 * 51 *
52 * As a result of this timing problem, the only modes that are particularly 52 * As a result of this timing problem, the only modes that are particularly
53 * feasible are the 4096 and the 2048 divisors, which yeild 5.25 and 2.62ms 53 * feasible are the 4096 and the 2048 divisors, which yield 5.25 and 2.62ms
54 * overflow periods respectively. 54 * overflow periods respectively.
55 * 55 *
56 * Also, since we can't really expect userspace to be responsive enough 56 * Also, since we can't really expect userspace to be responsive enough
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c
index df88cfa05f35..e97b0499bd0d 100644
--- a/drivers/watchdog/smsc37b787_wdt.c
+++ b/drivers/watchdog/smsc37b787_wdt.c
@@ -191,7 +191,7 @@ static inline void wdt_timer_conf(unsigned char conf)
191static inline void wdt_timer_ctrl(unsigned char reg) 191static inline void wdt_timer_ctrl(unsigned char reg)
192{ 192{
193 /* -- Watchdog timer control -- 193 /* -- Watchdog timer control --
194 * Bit 0 Status Bit: 0 = Timer counting, 1 = Timeout occured 194 * Bit 0 Status Bit: 0 = Timer counting, 1 = Timeout occurred
195 * Bit 1 Power LED Toggle: 0 = Disable Toggle, 1 = Toggle at 1 Hz 195 * Bit 1 Power LED Toggle: 0 = Disable Toggle, 1 = Toggle at 1 Hz
196 * Bit 2 Force Timeout: 1 = Forces WD timeout event (self-cleaning) 196 * Bit 2 Force Timeout: 1 = Forces WD timeout event (self-cleaning)
197 * Bit 3 P20 Force Timeout enabled: 197 * Bit 3 P20 Force Timeout enabled:
diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c
index 100b114e3c3c..bf16ffb4d21e 100644
--- a/drivers/watchdog/softdog.c
+++ b/drivers/watchdog/softdog.c
@@ -48,6 +48,7 @@
48#include <linux/init.h> 48#include <linux/init.h>
49#include <linux/jiffies.h> 49#include <linux/jiffies.h>
50#include <linux/uaccess.h> 50#include <linux/uaccess.h>
51#include <linux/kernel.h>
51 52
52#define PFX "SoftDog: " 53#define PFX "SoftDog: "
53 54
@@ -75,6 +76,11 @@ MODULE_PARM_DESC(soft_noboot,
75 "Softdog action, set to 1 to ignore reboots, 0 to reboot " 76 "Softdog action, set to 1 to ignore reboots, 0 to reboot "
76 "(default depends on ONLY_TESTING)"); 77 "(default depends on ONLY_TESTING)");
77 78
79static int soft_panic;
80module_param(soft_panic, int, 0);
81MODULE_PARM_DESC(soft_panic,
82 "Softdog action, set to 1 to panic, 0 to reboot (default=0)");
83
78/* 84/*
79 * Our timer 85 * Our timer
80 */ 86 */
@@ -98,7 +104,10 @@ static void watchdog_fire(unsigned long data)
98 104
99 if (soft_noboot) 105 if (soft_noboot)
100 printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); 106 printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n");
101 else { 107 else if (soft_panic) {
108 printk(KERN_CRIT PFX "Initiating panic.\n");
109 panic("Software Watchdog Timer expired.");
110 } else {
102 printk(KERN_CRIT PFX "Initiating system reboot.\n"); 111 printk(KERN_CRIT PFX "Initiating system reboot.\n");
103 emergency_restart(); 112 emergency_restart();
104 printk(KERN_CRIT PFX "Reboot didn't ?????\n"); 113 printk(KERN_CRIT PFX "Reboot didn't ?????\n");
@@ -267,7 +276,8 @@ static struct notifier_block softdog_notifier = {
267}; 276};
268 277
269static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 " 278static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 "
270 "initialized. soft_noboot=%d soft_margin=%d sec (nowayout= %d)\n"; 279 "initialized. soft_noboot=%d soft_margin=%d sec soft_panic=%d "
280 "(nowayout= %d)\n";
271 281
272static int __init watchdog_init(void) 282static int __init watchdog_init(void)
273{ 283{
@@ -298,7 +308,7 @@ static int __init watchdog_init(void)
298 return ret; 308 return ret;
299 } 309 }
300 310
301 printk(banner, soft_noboot, soft_margin, nowayout); 311 printk(banner, soft_noboot, soft_margin, soft_panic, nowayout);
302 312
303 return 0; 313 return 0;
304} 314}
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
index 1bc493848ed4..87e0527669d8 100644
--- a/drivers/watchdog/sp5100_tco.c
+++ b/drivers/watchdog/sp5100_tco.c
@@ -42,6 +42,7 @@
42#define PFX TCO_MODULE_NAME ": " 42#define PFX TCO_MODULE_NAME ": "
43 43
44/* internal variables */ 44/* internal variables */
45static u32 tcobase_phys;
45static void __iomem *tcobase; 46static void __iomem *tcobase;
46static unsigned int pm_iobase; 47static unsigned int pm_iobase;
47static DEFINE_SPINLOCK(tco_lock); /* Guards the hardware */ 48static DEFINE_SPINLOCK(tco_lock); /* Guards the hardware */
@@ -305,10 +306,18 @@ static unsigned char __devinit sp5100_tco_setupdevice(void)
305 /* Low three bits of BASE0 are reserved. */ 306 /* Low three bits of BASE0 are reserved. */
306 val = val << 8 | (inb(SP5100_IO_PM_DATA_REG) & 0xf8); 307 val = val << 8 | (inb(SP5100_IO_PM_DATA_REG) & 0xf8);
307 308
309 if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE,
310 "SP5100 TCO")) {
311 printk(KERN_ERR PFX "mmio address 0x%04x already in use\n",
312 val);
313 goto unreg_region;
314 }
315 tcobase_phys = val;
316
308 tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); 317 tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE);
309 if (tcobase == 0) { 318 if (tcobase == 0) {
310 printk(KERN_ERR PFX "failed to get tcobase address\n"); 319 printk(KERN_ERR PFX "failed to get tcobase address\n");
311 goto unreg_region; 320 goto unreg_mem_region;
312 } 321 }
313 322
314 /* Enable watchdog decode bit */ 323 /* Enable watchdog decode bit */
@@ -346,7 +355,8 @@ static unsigned char __devinit sp5100_tco_setupdevice(void)
346 /* Done */ 355 /* Done */
347 return 1; 356 return 1;
348 357
349 iounmap(tcobase); 358unreg_mem_region:
359 release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
350unreg_region: 360unreg_region:
351 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); 361 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE);
352exit: 362exit:
@@ -401,6 +411,7 @@ static int __devinit sp5100_tco_init(struct platform_device *dev)
401 411
402exit: 412exit:
403 iounmap(tcobase); 413 iounmap(tcobase);
414 release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
404 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); 415 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE);
405 return ret; 416 return ret;
406} 417}
@@ -414,6 +425,7 @@ static void __devexit sp5100_tco_cleanup(void)
414 /* Deregister */ 425 /* Deregister */
415 misc_deregister(&sp5100_tco_miscdev); 426 misc_deregister(&sp5100_tco_miscdev);
416 iounmap(tcobase); 427 iounmap(tcobase);
428 release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
417 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); 429 release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE);
418} 430}
419 431
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 0a0efe713bc8..0d80e08b6439 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -90,7 +90,7 @@ static void wdt_setload(unsigned int timeout)
90 /* 90 /*
91 * sp805 runs counter with given value twice, after the end of first 91 * sp805 runs counter with given value twice, after the end of first
92 * counter it gives an interrupt and then starts counter again. If 92 * counter it gives an interrupt and then starts counter again. If
93 * interrupt already occured then it resets the system. This is why 93 * interrupt already occurred then it resets the system. This is why
94 * load is half of what should be required. 94 * load is half of what should be required.
95 */ 95 */
96 load = div_u64(rate, 2) * timeout - 1; 96 load = div_u64(rate, 2) * timeout - 1;