Linux Watchdog driver development
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] watchdog/coh901327: convert to use watchdog core
Date: Wed, 7 Mar 2012 17:42:40 +0100	[thread overview]
Message-ID: <20120307164240.GA1130@pengutronix.de> (raw)
In-Reply-To: <1331131929-22383-1-git-send-email-linus.walleij@stericsson.com>

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

Hi Linus,

> -static long coh901327_ioctl(struct file *file, unsigned int cmd,
> +static long coh901327_ioctl(struct watchdog_device *wdt_dev, unsigned int cmd,
>  			    unsigned long arg)
>  {
>  	int ret = -ENOTTY;
>  	u16 val;
> -	int time;
> -	int new_options;
>  	union {
>  		struct watchdog_info __user *ident;
>  		int __user *i;
>  	} uarg;

'uarg' is nice name for the union ;) You probably don't need that anymore.
If we keep the ioctl, that is, because...

...

>  	case WDIOC_GETTIMELEFT:
>  		clk_enable(clk);
>  		/* Read repeatedly until the value is stable! */

I was wondering if it pays to put this IOCTL to watchdog_dev and add another
callback to watchdog_ops? I'd think so. Wim, Linus, what do you think? We don't
save much (yet?), but since this is part of the kernel-API it might be nice to
have the common part centralized, even if it is mainly put_user (which might be
nice, too, since most users of GETTIMELEFT cast the result to various types).

> +static struct watchdog_device coh901327_wdt = {
> +	.info = &coh901327_ident,
> +	.ops = &coh901327_ops,
> +	/*
> +	 * Max margin is 327 since the 10ms
> +	 * timeout register is max
> +	 * 0x7FFF = 327670ms ~= 327s.
> +	 */

I'd drop that comment, but well...

> +	.min_timeout = 0,
> +	.max_timeout = 327,

Thanks!

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-03-07 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 14:52 [PATCH] watchdog/coh901327: convert to use watchdog core Linus Walleij
2012-03-07 16:42 ` Wolfram Sang [this message]
2012-03-08  6:16   ` Linus Walleij
2012-03-15 21:27     ` Wim Van Sebroeck
2012-03-16  3:47       ` Viresh Kumar
2012-03-16  8:15       ` Linus Walleij
2012-03-22 14:49         ` Wim Van Sebroeck
2012-03-22 18:09           ` Linus Walleij

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=20120307164240.GA1130@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox