diff options
Diffstat (limited to 'zaptel.c')
-rwxr-xr-x | zaptel.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -5563,9 +5563,11 @@ static void watchdog_check(unsigned long ignored) { int x; long flags; + static int wdcheck=0; + local_irq_save(flags); for (x=0;x<maxspans;x++) { - if (spans[x]) { + if (spans[x] && (spans[x]->flags & ZT_FLAG_RUNNING)) { if (spans[x]->watchcounter == ZT_WATCHDOG_INIT) { /* Whoops, dead card */ if ((spans[x]->watchstate == ZT_WATCHSTATE_OK) || @@ -5580,7 +5582,8 @@ static void watchdog_check(unsigned long ignored) } } } else { - if (spans[x]->watchstate != ZT_WATCHSTATE_OK) + if ((spans[x]->watchstate != ZT_WATCHSTATE_OK) && + (spans[x]->watchstate != ZT_WATCHSTATE_UNKNOWN)) printk("Span %s is alive!\n", spans[x]->name); spans[x]->watchstate = ZT_WATCHSTATE_OK; } @@ -5588,7 +5591,11 @@ static void watchdog_check(unsigned long ignored) } } local_irq_restore(flags); - mod_timer(&watchdogtimer, jiffies + 1); + if (!wdcheck) { + printk("Zaptel watchdog on duty!\n"); + wdcheck=1; + } + mod_timer(&watchdogtimer, jiffies + 2); } static int __init watchdog_init(void) @@ -5598,11 +5605,11 @@ static int __init watchdog_init(void) watchdogtimer.data =0; watchdogtimer.function = watchdog_check; /* Run every couple of jiffy or so */ - mod_timer(&watchdogtimer, jiffies + 1); + mod_timer(&watchdogtimer, jiffies + 2); return 0; } -static void watchdog_cleanup(void) +static void __exit watchdog_cleanup(void) { del_timer(&watchdogtimer); } |