lkml.org 
[lkml]   [2008]   [May]   [25]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 25 May 2008 11:08:12 +0100
FromAlan Cox <>
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    [from the cache]
©2003-2008