All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Janusz Użycki" <j.uzycki@elproma.com.pl>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org, Wim Van Sebroeck <wim@iguana.be>
Subject: Re: watchdog's pm support preffered implementation
Date: Tue, 23 Sep 2014 14:07:14 +0200	[thread overview]
Message-ID: <54216272.5000404@elproma.com.pl> (raw)
In-Reply-To: <20140919162115.GE30723@roeck-us.net>


W dniu 2014-09-19 18:21, Guenter Roeck pisze:
> On Fri, Sep 19, 2014 at 11:46:11AM +0200, Janusz Użycki wrote:
>> W dniu 2014-09-19 05:11, Guenter Roeck pisze:
>>>>> +
>>>>> +       /* Is keep-on/ping timer suspended before?
>>>>> +        * or additional driver-specific flag must be added
>>>>> +        *  to block watchdog ping in the timer?
>>>>> +        * or disable WATCHDOG_KEEP_ON before wdt_stop
>>>>> +        *  and restore it in resume? */
>>> You'll have to answer those questions.
>> I guess you don't know if timers are stopped before susnder of other
>> drivers?
>>
> My development methology is on a "need to know" basis. No, I don't know,
> since I never needed to. If I am in a situation like this I look at other
> drivers and how they solved the problem.

My methodology is also "need to know" but there was possibility that 
somebody knows an answer.
Other watchdog drivers hadn't such situation. Ping timer was always used 
for hardware which never stops.
I analized and found simple solution: suspend/resume helper.
You can find it in patches I sent yesterday. Please about comments.
Do you happen to work how to use the ping timer instead of timer in 
device-specific driver? I can't it on the moment.

> On a side note, I would never assume that there is a race condition unless
> I can prove that there is one.
>

I am careful here:
https://www.kernel.org/doc/Documentation/stable_kernel_rules.txt
"No theoretical race condition issues"

>>>>> +               return wdt_stop(wdd);
>>>>> +       }
>>>>> +       /* should we use pm_runtime like omap_wdt.c does? */
>>> Isn't that what you do here ?
>> I meant pm_runtime_put/get_sync() etc.
>> Maybe it is connected to my question above about timers.
>>
> Another need-to-know question.
> Best would be to check how other drivers use the functions.

I learnt: pm_runtime is rather extention to classic resume/suspend.

>
>>>>> +
>>>>> +       return 0;
>>>>> +}
>>>>> +
>>>>> +static int __maybe_unused stmp3xxx_wdt_resume(struct device *dev)
>>> Does the __maybe_unused really apply ?
>> What do you preffer: __maybe_unused or ifdef CONFIG_PM_SLEEP?
>> I guess the first one because SIMPLE_DEV_PM_OPS/SET_SYSTEM_SLEEP_PM_OPS
>> just uses CONFIG_PM_SLEEP.
>>
> None of the above ;-). Keep the __maybe_unused; at least that means
> that the code is compiled even if CONFIG_PM_SLEEP is undefined.
sure

Janusz

      reply	other threads:[~2014-09-23 12:07 UTC|newest]

Thread overview: 23+ 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-04 16:05   ` watchdog: WatchDog Timer Driver Core: ping a hardware watchdog in kernel's space [proposal] Janusz Użycki
2014-09-04 16:24     ` Janusz Użycki
2014-09-04 17:23       ` Fwd: " Janusz Użycki
2014-09-05  6:47         ` Janusz Użycki
2014-09-07 17:18   ` watchdog: WatchDog Timer Driver Core: ping a hardware watchdog in kernel's space 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
2014-09-19 16:21                     ` watchdog's pm support preffered implementation Guenter Roeck
2014-09-23 12:07                       ` Janusz Użycki [this message]

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=54216272.5000404@elproma.com.pl \
    --to=j.uzycki@elproma.com.pl \
    --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 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.