Linux Watchdog driver development
 help / color / mirror / Atom feed
From: "Janusz Użycki" <j.uzycki@elproma.com.pl>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-watchdog@vger.kernel.org, Wim Van Sebroeck <wim@iguana.be>,
	linux-kernel@vger.kernel.org
Subject: Re: timers vs drivers suspend race
Date: Fri, 19 Sep 2014 15:44:09 +0200	[thread overview]
Message-ID: <541C3329.3010409@elproma.com.pl> (raw)
In-Reply-To: <541C122D.10305@elproma.com.pl>

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


W dniu 2014-09-19 13:23, Janusz Użycki pisze:
> Hi.
>
> I have a doubt about suspending of timers.
> I found the patch (not included to linux-next):
> https://lkml.org/lkml/2014/7/21/493
> but it concerns timers only.
>
> I'm adding PM to the watchdog driver (below).
> The driver is capable to stop the watchdog.
> However I implemented "keep-on" feature to ping
> active watchdog if userland doesn't do it.
> For the feature I used a timer.
> Now, on wdt_suspend() call I don't know
> if timers are suspended before the watchdog driver or
> there is no guarantee (race): wdt_suspend() calls wdt_stop()
> and after timer's callback will ping watchdog and reenable it.
>
> I found also:
> https://lkml.org/lkml/2007/10/25/9
> Here del_timer_sync() is called and it solves
> the problem.
> In my case the timer is serviced in watchdog_dev,
> not in the specific-driver.
> I can add a flag in the specific-driver
> to block watchdog's ping before wdt_stop()
> or export new function to suspend/resume
> watchdog_dev's timer from the specific-driver.
>
> Could you advice is it necessary?

Does changing SIMPLE_DEV_PM_OPS to SET_LATE_SYSTEM_SLEEP_PM_OPS
solve the race problem with timer?

best regards
Janusz



[-- Attachment #2: Type: text/html, Size: 2141 bytes --]

  reply	other threads:[~2014-09-19 13:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <S1751381AbaIDOwq/20140904145246Z+988@vger.kernel.org>
2014-09-04 15:47 ` watchdog: WatchDog Timer Driver Core: ping a hardware watchdog in kernel's space Janusz Użycki
2014-09-07 17:18   ` Guenter Roeck
2014-09-08  1:14     ` watchdog: watchdog_dev: WATCHDOG_KEEP_ON feature Janusz Użycki
2014-09-08  1:18       ` Janusz Użycki
2014-09-08  3:24         ` Guenter Roeck
2014-09-08  3:16       ` Guenter Roeck
2014-09-08 12:14         ` Janusz Użycki
2014-09-10 17:24           ` Janusz Użycki
2014-09-11 10:47             ` Janusz Użycki
2014-09-17 11:09         ` Janusz Użycki
2014-09-18 11:07           ` watchdog's pm support preffered implementation Janusz Użycki
2014-09-18 21:40             ` Janusz Użycki
2014-09-18 22:02               ` Janusz Użycki
2014-09-19  3:11                 ` Guenter Roeck
2014-09-19  9:46                   ` Janusz Użycki
2014-09-19 11:23                     ` timers vs drivers suspend race Janusz Użycki
2014-09-19 13:44                       ` Janusz Użycki [this message]
2014-09-19 16:21                     ` watchdog's pm support preffered implementation Guenter Roeck
2014-09-23 12:07                       ` Janusz Użycki

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=541C3329.3010409@elproma.com.pl \
    --to=j.uzycki@elproma.com.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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