> On 09/01/2020 6:48 PM Guenter Roeck <linux@xxxxxxxxxxxx> 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