Linux Watchdog driver development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-watchdog@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Subject: Re: [RFC] watchdog: renesas_wdt: don't keep timer value during suspend/resume
Date: Sun, 9 Dec 2018 17:36:32 +0100	[thread overview]
Message-ID: <20181209163632.GB1673@kunai> (raw)
In-Reply-To: <eb86c5d7-ab13-df05-0d0f-9dad811a6a98@roeck-us.net>

Hi Guenter,

> > I can relate to the policy argument, though. Regardless of this patch, I
> > wonder if we can make it configurable from userspace. A draft:
> > 
> > #define	WDIOF_RESUME_OPTS	0x0800
> > 
> > #define	WDIOS_RESUME_KEEP	0x0008
> > #define	WDIOS_RESUME_RESET	0x0010
> > 
> > and then in watchdog_ioctl() under WDIOC_SETOPTIONS:
> > 
> > 	if (!(wdd->info->options & WDIOF_RESUME_OPTS))
> > 		err = -EOPNOTSUPP;
> > 		goto break;
> > 
> > 	if (val & WDIOS_RESUME_KEEP)
> > 		wdd->status |= WDOG_KEEP_TIMER_WHEN_RESUME;
> > 
> > 	if (val & WDIOS_RESUME_RESET)
> > 		wdd->status ~= ~WDOG_KEEP_TIMER_WHEN_RESUME;
> > 
> > So, drivers with WDIOF_RESUME_OPTS could act on the
> > WDOG_KEEP_TIMER_WHEN_RESUME flag.
> > 
> > Opinions?
> > 
> 
> Not entirely sure I understand the use case.

Well, as I mentioned before, I can understand the "isn't this policy?"
question from Fabrizio. Would be good to hear his opinion on this.

> Having said that, if we were to add this option, I think only a single
> flag would be needed - WDIOF_RESUME_KEEP. All we need to do is declare
> that a ping on resume shall be the default. Anything else would result
> in undefined per-driver default behavior.

I would very much love that. To be honest, I thought we already are in
the undefined per-driver behaviour; this is why I added two flags, to
not cause regressions. Declaring a default would be a great first step
IMHO, and then we can build the WDIOF_RESUME_KEEP option on top of it,
if needed. But for clarity, the first step seems to be a good idea in
any case, I'd say.

Thanks,

   Wolfram

  reply	other threads:[~2018-12-09 16:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 12:01 [RFC] watchdog: renesas_wdt: don't keep timer value during suspend/resume Wolfram Sang
2018-12-04 12:42 ` Geert Uytterhoeven
2018-12-04 12:48 ` Fabrizio Castro
2018-12-04 15:20 ` Guenter Roeck
2018-12-07 21:45   ` Wolfram Sang
2018-12-08 21:38     ` Guenter Roeck
2018-12-09 16:36       ` Wolfram Sang [this message]
2018-12-09 18:12         ` Guenter Roeck
2018-12-09 18:40           ` Wolfram Sang
2018-12-10  9:37           ` Fabrizio Castro
2018-12-10 14:23             ` Guenter Roeck
2018-12-10 14:47               ` Fabrizio Castro
2018-12-10 14:47                 ` Fabrizio Castro
2018-12-10  9:40     ` Fabrizio Castro
2018-12-10 14:49 ` Fabrizio Castro

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=20181209163632.GB1673@kunai \
    --to=wsa@the-dreams.de \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox