Messages in this thread | | | Date | Sun, 25 May 2008 11:08:12 +0100 | From | Alan Cox <> | Subject | Re: [WATCHDOG] v2.6.26-rc3 patches |
| |
> + > +static void geodewdt_ping(void) > +{ > + /* Stop the counter */ > + geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, 0); > + > + /* Reset the counter */ > + geode_mfgpt_write(wdt_timer, MFGPT_REG_COUNTER, 0); > + > + /* Enable the counter */ > + geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN); > +} > + > +static void geodewdt_disable(void) > +{ > + geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, 0); > + geode_mfgpt_write(wdt_timer, MFGPT_REG_COUNTER, 0); > +} > + > +static int geodewdt_set_heartbeat(int val) > +{ > + if (val < 1 || val > GEODEWDT_MAX_SECONDS) > + return -EINVAL; > + > + geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, 0); > + geode_mfgpt_write(wdt_timer, MFGPT_REG_CMP2, val * GEODEWDT_HZ); > + geode_mfgpt_write(wdt_timer, MFGPT_REG_COUNTER, 0); > + geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN); > + > + timeout = val; > + return 0; > +} > +
There is no locking in geodewdt - so all those routines can end up being run together. Not sure it is a problem just noting it while reviewing.
| |