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


Groups > linux.kernel > #1345476

Re: [v7, RESEND] watchdog: Add watchdog timer support for the WinSystems EBC-C384

From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject Re: [v7, RESEND] watchdog: Add watchdog timer support for the WinSystems EBC-C384
Date 2016-02-29 05:50 +0100
Message-ID <r7nWp-5to-1@gated-at.bofh.it> (permalink)
References <r7nD5-5hw-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi William,

On Sun, Feb 28, 2016 at 11:29:10PM -0500, William Breathitt Gray wrote:
> The WinSystems EBC-C384 has an onboard watchdog timer. The timeout range
> supported by the watchdog timer is 1 second to 255 minutes. Timeouts
> under 256 seconds have a 1 second granularity, while the rest have a 1
> minute granularity.
> 
> This driver adds watchdog timer support for this onboard watchdog timer.
> The timeout may be configured via the timeout module parameter.
> 
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  MAINTAINERS                     |   6 ++
>  drivers/watchdog/Kconfig        |   9 ++
>  drivers/watchdog/Makefile       |   1 +
>  drivers/watchdog/ebc-c384_wdt.c | 188 ++++++++++++++++++++++++++++++++++++++++
> 
[ ... ]

> +
> +static int ebc_c384_wdt_set_timeout(struct watchdog_device *wdev, unsigned t)
> +{
> +	/* resolution is in minutes for timeouts greater than 255 seconds */
> +	if (t > 255) {
> +		/* round second resolution up to minute granularity */
> +		wdev->timeout = DIV_ROUND_UP(t, 60) * 60;

Good catch.

Turns out there is a much better macro for this:
		wdev->timeout = roundup(t, 60);

Guenter

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


Thread

[PATCH v7 RESEND] watchdog: Add watchdog timer support for the  WinSystems EBC-C384 William Breathitt Gray <vilhelm.gray@gmail.com> - 2016-02-29 05:30 +0100
  Re: [v7, RESEND] watchdog: Add watchdog timer support for the  WinSystems EBC-C384 Guenter Roeck <linux@roeck-us.net> - 2016-02-29 05:50 +0100

csiph-web