Re: [WATCHDOG] v2.6.26-rc3 patches

From: Alan Cox
Date: Sun May 25 2008 - 06:23:18 EST


> +
> +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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/