linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulrich Hecht <uli@fpond.eu>
To: Guenter Roeck <linux@roeck-us.net>,
	Ulrich Hecht <uli+renesas@fpond.eu>,
	linux-renesas-soc@vger.kernel.org
Cc: wsa@the-dreams.de, geert@linux-m68k.org,
	linux-i2c@vger.kernel.org, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH] watchdog: da9063: wake up parent ahead of reboot
Date: Mon, 7 Sep 2020 23:19:59 +0200 (CEST)	[thread overview]
Message-ID: <919936154.542022.1599513599331@webmail.strato.com> (raw)
In-Reply-To: <a89b6ee3-4b69-422c-4a48-d105ff8807ed@roeck-us.net>


> On 09/01/2020 6:48 PM Guenter Roeck <linux@roeck-us.net> wrote:
> 
>  
> On 9/1/20 9:17 AM, Ulrich Hecht wrote:
> > This patch ensures our parent is awake before a reboot takes place. This
> > prevents situations in which the I2C host has been suspended and cannot
> > be safely woken up anymore when it needs to talk to us.
> > 
> 
> Why not call pm_runtime_get_sync() in da9063_wdt_restart() ?

It's no longer safe to do so at that point because the restart handler runs in atomic context. The unpleasant details can be found at https://www.spinics.net/lists/linux-i2c/msg46367.html

> What
> guarantees that the local notifier is called before the watchdog core's
> restart notifier ?

It would seem to me that a reboot notifier that triggers after the restart notifier (which, if successfully handled, does not return) would be rather pointless.

> And what is the point of using the watchdog core's
> reboot handler if it is bypassed anyway ?

I don't think it's bypassed, it should be possible to register several reboot notifiers per device.

It would also be possible to do this stuff in the core's reboot handler, but I have chosen not to do so because the core seems to avoid dealing with PM, which I assume is a design decision. Also, it would affect all other drivers with a restart handler, with (to me) unforeseeable effects. What do you think?

> Also, why is it not necessary to call pm functions when the watchdog is
> started, when it is stopped, and during suspend/resume ?

These cases are handled automatically, AFAIK.

CU
Uli

      reply	other threads:[~2020-09-07 21:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 16:17 [PATCH] watchdog: da9063: wake up parent ahead of reboot Ulrich Hecht
2020-09-01 16:48 ` Guenter Roeck
2020-09-07 21:19   ` Ulrich Hecht [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=919936154.542022.1599513599331@webmail.strato.com \
    --to=uli@fpond.eu \
    --cc=geert@linux-m68k.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=uli+renesas@fpond.eu \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).