All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Robin Gong <b38343@freescale.com>
Cc: Wim Van Sebroeck <wim@iguana.be>, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v2 1/2] watchdog: add pretimeout support to the core
Date: Sat, 25 Jun 2016 19:30:06 -0700	[thread overview]
Message-ID: <576F3E2E.7060606@roeck-us.net> (raw)
In-Reply-To: <1466902865-14354-2-git-send-email-vladimir_zapolskiy@mentor.com>

On 06/25/2016 06:01 PM, Vladimir Zapolskiy wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> Since the watchdog framework centrializes the IOCTL interfaces of device
> drivers now, SETPRETIMEOUT and GETPRETIMEOUT need to be added in the
> common code.
>
> Signed-off-by: Robin Gong <b38343@freescale.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> [vzapolskiy: added conditional pretimeout sysfs attribute visibility]
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
> ---

[ ... ]

> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -307,10 +307,14 @@ static int watchdog_set_timeout(struct watchdog_device *wdd,
>   	if (watchdog_timeout_invalid(wdd, timeout))
>   		return -EINVAL;
>
> -	if (wdd->ops->set_timeout)
> +	if (wdd->ops->set_timeout) {
>   		err = wdd->ops->set_timeout(wdd, timeout);
> -	else
> +	} else {
>   		wdd->timeout = timeout;
> +		/* Disable pretimeout if it doesn't fit the new timeout */
> +		if (wdd->pretimeout > wdd->timeout)

Nitpick: If we consider pretimeout == timeout to be invalid, we should reject it here
as well. So this should be >=.

Otherwise lgtm, so feel free to add

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

to the next version. I'd suggest to wait a bit to give Wolfram time to provide input,
though.

Thanks,
Guenter


  reply	other threads:[~2016-06-26  2:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-26  1:01 [PATCH v2 0/2] watchdog: add get/set peretimeout UAPI and internals Vladimir Zapolskiy
2016-06-26  1:01 ` [PATCH v2 1/2] watchdog: add pretimeout support to the core Vladimir Zapolskiy
2016-06-26  2:30   ` Guenter Roeck [this message]
2016-06-27  9:37     ` Wolfram Sang
2016-06-27 13:32       ` Guenter Roeck
2016-06-27 15:33         ` Wolfram Sang
2016-06-27 20:14           ` Guenter Roeck
2016-06-26  1:01 ` [PATCH v2 2/2] fs: compat_ioctl: add pretimeout functions for watchdogs Vladimir Zapolskiy
2016-06-26  2:30   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576F3E2E.7060606@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=b38343@freescale.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=vladimir_zapolskiy@mentor.com \
    --cc=wim@iguana.be \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.