From 281c25903f17c7b5c063c686760f28e5e370e58c Mon Sep 17 00:00:00 2001 From: Anithra P Janakiraman Date: Mon, 28 Mar 2011 14:29:19 -0700 Subject: [PATCH] --- yaml --- r: 243382 b: refs/heads/master c: 7fff4beb311dfab4f18ff2cd64f78ec89296a39a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/watchdog/softdog.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 7ffb78fc7ee5..b2d44e6427a4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 708d42472fba9a661a85ce12006c87ba3172a37e +refs/heads/master: 7fff4beb311dfab4f18ff2cd64f78ec89296a39a diff --git a/trunk/drivers/watchdog/softdog.c b/trunk/drivers/watchdog/softdog.c index 100b114e3c3c..bf16ffb4d21e 100644 --- a/trunk/drivers/watchdog/softdog.c +++ b/trunk/drivers/watchdog/softdog.c @@ -48,6 +48,7 @@ #include #include #include +#include #define PFX "SoftDog: " @@ -75,6 +76,11 @@ MODULE_PARM_DESC(soft_noboot, "Softdog action, set to 1 to ignore reboots, 0 to reboot " "(default depends on ONLY_TESTING)"); +static int soft_panic; +module_param(soft_panic, int, 0); +MODULE_PARM_DESC(soft_panic, + "Softdog action, set to 1 to panic, 0 to reboot (default=0)"); + /* * Our timer */ @@ -98,7 +104,10 @@ static void watchdog_fire(unsigned long data) if (soft_noboot) printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); - else { + else if (soft_panic) { + printk(KERN_CRIT PFX "Initiating panic.\n"); + panic("Software Watchdog Timer expired."); + } else { printk(KERN_CRIT PFX "Initiating system reboot.\n"); emergency_restart(); printk(KERN_CRIT PFX "Reboot didn't ?????\n"); @@ -267,7 +276,8 @@ static struct notifier_block softdog_notifier = { }; static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 " - "initialized. soft_noboot=%d soft_margin=%d sec (nowayout= %d)\n"; + "initialized. soft_noboot=%d soft_margin=%d sec soft_panic=%d " + "(nowayout= %d)\n"; static int __init watchdog_init(void) { @@ -298,7 +308,7 @@ static int __init watchdog_init(void) return ret; } - printk(banner, soft_noboot, soft_margin, nowayout); + printk(banner, soft_noboot, soft_margin, soft_panic, nowayout); return 0; }