lkml.org 
[lkml]   [2008]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2008-05-25 12:25    [W:0.047 / U:21.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site