2010-02-03 04:44:35     Bug in watchdog-params

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-02-03 04:44:35     Bug in watchdog-params

Thorsten Pohlmann (GERMANY)

Message: 85529   

 

Hi!

 

I encountered a bug in 2009R1-RC6, it seems to exist in every other version.

 

The max. timeout for the hardware watchdog is caluclated the wrong way. If you set the timeout via "watchdogd -w 40" you'll get a ~5 sec timeout.

 

This is a patch that works for me:

 

 

 

regards, TP

 

 

 

--- drivers/watchdog/bfin_wdt.c 2010-02-03 10:28:44.000000000 +0100

+++ drivers/watchdog/bfin_wdt.c 2010-02-03 10:28:44.000000000 +0100

@@ -132,17 +132,18 @@

  */

static int bfin_wdt_set_timeout(unsigned long t)

{

-       u32 cnt;

+       u32 cnt = 0xffffffff;

        unsigned long flags;

 

        stampit();

 

-       cnt = t * get_sclk();

-       if (cnt < get_sclk()) {

+       if(t > (cnt / get_sclk())) {

                printk(KERN_WARNING PFX "timeout value is too large\n");

                return -EINVAL;

        }

 

+       cnt = t * get_sclk();

+

        spin_lock_irqsave(&bfin_wdt_spinlock, flags);

        {

                int run = bfin_wdt_running();

TranslateQuoteReplyEditDelete

 

 

2010-02-03 04:56:10     Re: Bug in watchdog-params

Mike Frysinger (UNITED STATES)

Message: 85531   

 

thanks, i'll fix things up in svn

Attachments

    Outcomes