[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20298828.cYNPnTRxWX@wuerfel>
Date: Tue, 24 Jun 2014 11:27:45 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linux-arm-kernel@...ts.infradead.org
Cc: Guenter Roeck <linux@...ck-us.net>,
Wim Van Sebroeck <wim@...ana.be>,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
linux-watchdog@...r.kernel.org, dbaryshkov@...il.com,
linux-kernel@...r.kernel.org, linux-sunxi@...glegroups.com,
dwmw2@...radead.org
Subject: Re: [PATCH v2 1/6] wdt: sunxi: Move restart code to the watchdog driver
On Monday 23 June 2014 14:47:48 Guenter Roeck wrote:
> > To continue the discussion: I would like to add an excerpt from drivers/watchdog/alim7101_wdt.c
> > /*
> > * Notifier for system down
> > */
> >
> > static int wdt_notify_sys(struct notifier_block *this,
> > unsigned long code, void *unused)
> > {
> > if (code == SYS_DOWN || code == SYS_HALT)
> > wdt_turnoff();
> >
> > if (code == SYS_RESTART) {
> > /*
> > * Cobalt devices have no way of rebooting themselves other
> > * than getting the watchdog to pull reset, so we restart the
> > * watchdog on reboot with no heartbeat
> > */
> > wdt_change(WDT_ENABLE);
> > pr_info("Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second\n");
> > }
> > return NOTIFY_DONE;
> > }
> >
> > For some systems the watchdog is the only way to reboot... So where we should put it, is not trivial neither...
> >
>
> Agreed. The above definitely doesn't look like a good solution to me.
>
Right, at the very least, it should be a separate notifier: the existing
reboot_notifier is meant for things that need to happen /before/ reboot,
so adding something in there to actually trigger the reboot is by definition
racy against the other notifiers that may or may not get called after
this one.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists