Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1275769

Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag

From Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag
Date 2015-11-23 20:30 +0100
Message-ID <qy4Yi-697-9@gated-at.bofh.it> (permalink)
References <qxPZf-4Er-3@gated-at.bofh.it> <qxPZg-4Er-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello Guenter,

On Sun, Nov 22, 2015 at 07:20:59PM -0800, Guenter Roeck wrote:
> diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
> index b535b02b1d7f..f0292d56caf0 100644
> --- a/include/linux/watchdog.h
> +++ b/include/linux/watchdog.h
> @@ -108,6 +108,7 @@ struct watchdog_device {
>  #define WDOG_ALLOW_RELEASE	2	/* Did we receive the magic char ? */
>  #define WDOG_NO_WAY_OUT		3	/* Is 'nowayout' feature set ? */
>  #define WDOG_UNREGISTERED	4	/* Has the device been unregistered */
> +#define WDOG_RUNNING		5	/* True if HW watchdog running */
>  	/* the following variables are for internal use only */
>  	struct mutex lock;
>  	unsigned long last_keepalive;
> @@ -124,6 +125,12 @@ static inline bool watchdog_active(struct watchdog_device *wdd)
>  	return test_bit(WDOG_ACTIVE, &wdd->status);
>  }
>  
> +/* Use the following function to check whether or not the watchdog is running */

I'd like to have this comment more clear to distinguish between device
state and userspace view. Maybe also call the flag WDOG_HW_RUNNING to
make this more clear?

> +static inline bool watchdog_running(struct watchdog_device *wdd)
> +{
> +	return test_bit(WDOG_RUNNING, &wdd->status);
> +}
> +

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/8] watchdog: Add support for keepalives triggered by infrastructure Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
  [PATCH v5 3/8] watchdog: Make set_timeout function optional Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
  [PATCH v5 5/8] watchdog: Simplify update_worker Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
    Re: [PATCH v5 5/8] watchdog: Simplify update_worker Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-24 08:20 +0100
      Re: [PATCH v5 5/8] watchdog: Simplify update_worker Guenter Roeck <linux@roeck-us.net> - 2015-11-24 08:30 +0100
  [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
    Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag Alexander Stein <alexander.stein@systec-electronic.com> - 2015-11-23 17:40 +0100
      Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag Guenter Roeck <linux@roeck-us.net> - 2015-11-23 17:50 +0100
    Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-23 20:30 +0100
      Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag Guenter Roeck <linux@roeck-us.net> - 2015-11-23 22:50 +0100
  [RFT PATCH v5 8/8] watchdog: at91sam9: Convert to use infrastructure triggered keepalives Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
  [PATCH v5 4/8] watchdog: Add support for minimum time between heartbeats Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
  [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in watchdog core Guenter Roeck <linux@roeck-us.net> - 2015-11-23 04:30 +0100
    Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-23 09:00 +0100
      Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Guenter Roeck <linux@roeck-us.net> - 2015-11-23 17:20 +0100
        Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-23 19:30 +0100
          Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Guenter Roeck <linux@roeck-us.net> - 2015-11-23 23:00 +0100
    Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-24 08:20 +0100
      Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Guenter Roeck <linux@roeck-us.net> - 2015-11-24 16:10 +0100
        Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-24 17:20 +0100
          Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Guenter Roeck <linux@roeck-us.net> - 2015-11-24 17:50 +0100
            Re: [PATCH v5 1/8] watchdog: Introduce hardware maximum timeout in  watchdog core Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2015-11-24 22:20 +0100

csiph-web