All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running
@ 2017-03-10 16:51 Andy Shevchenko
  2017-03-10 17:05 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2017-03-10 16:51 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog; +Cc: Andy Shevchenko

Firmware followed by bootloader leaves watchdog running.

Keep it running in the driver.

User will not need any additional options to reboot in case of panic
during boot.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/watchdog/intel-mid_wdt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/intel-mid_wdt.c b/drivers/watchdog/intel-mid_wdt.c
index 45e4d02221b5..f2c66689f42c 100644
--- a/drivers/watchdog/intel-mid_wdt.c
+++ b/drivers/watchdog/intel-mid_wdt.c
@@ -147,8 +147,16 @@ static int mid_wdt_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	/* Make sure the watchdog is not running */
-	wdt_stop(wdt_dev);
+	/*
+	 * Make sure the watchdog is serviced.
+	 *
+	 * The firmware followed by U-Boot leaves the watchdog running
+	 * with the default threshold 60 seconds. Our default timeout is
+	 * 90 seconds, but internal worker divides it by two, which is
+	 * 45 seconds and should be enough (less by 15 seconds than
+	 * threshold).
+	 */
+	set_bit(WDOG_HW_RUNNING, &wdt_dev->status);
 
 	ret = devm_watchdog_register_device(&pdev->dev, wdt_dev);
 	if (ret) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running
  2017-03-10 16:51 [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running Andy Shevchenko
@ 2017-03-10 17:05 ` Andy Shevchenko
  2017-03-10 17:16   ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2017-03-10 17:05 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog

On Fri, 2017-03-10 at 18:51 +0200, Andy Shevchenko wrote:
> Firmware followed by bootloader leaves watchdog running.
> 
> Keep it running in the driver.
> 
> User will not need any additional options to reboot in case of panic
> during boot.

> -	/* Make sure the watchdog is not running */
> -	wdt_stop(wdt_dev);
> +	/*
> +	 * Make sure the watchdog is serviced.
> +	 *
> +	 * The firmware followed by U-Boot leaves the watchdog
> running
> +	 * with the default threshold 60 seconds. Our default timeout
> is
> +	 * 90 seconds, but internal worker divides it by two, which
> is
> +	 * 45 seconds and should be enough (less by 15 seconds than
> +	 * threshold).
> +	 */
> +	set_bit(WDOG_HW_RUNNING, &wdt_dev->status);

Giving one more thought here perhaps more robust will be to start
watchdog unconditionally here?

In that case it will be no matter how it's configured in firmware and/or
boot loader.

>  
>  	ret = devm_watchdog_register_device(&pdev->dev, wdt_dev);
>  	if (ret) {

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running
  2017-03-10 17:05 ` Andy Shevchenko
@ 2017-03-10 17:16   ` Guenter Roeck
  2017-03-10 17:26     ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2017-03-10 17:16 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Wim Van Sebroeck, linux-watchdog

On Fri, Mar 10, 2017 at 07:05:49PM +0200, Andy Shevchenko wrote:
> On Fri, 2017-03-10 at 18:51 +0200, Andy Shevchenko wrote:
> > Firmware followed by bootloader leaves watchdog running.
> > 
> > Keep it running in the driver.
> > 
> > User will not need any additional options to reboot in case of panic
> > during boot.
> 
> > -	/* Make sure the watchdog is not running */
> > -	wdt_stop(wdt_dev);
> > +	/*
> > +	 * Make sure the watchdog is serviced.
> > +	 *
> > +	 * The firmware followed by U-Boot leaves the watchdog
> > running
> > +	 * with the default threshold 60 seconds. Our default timeout
> > is
> > +	 * 90 seconds, but internal worker divides it by two, which
> > is
> > +	 * 45 seconds and should be enough (less by 15 seconds than
> > +	 * threshold).
> > +	 */
> > +	set_bit(WDOG_HW_RUNNING, &wdt_dev->status);
> 
> Giving one more thought here perhaps more robust will be to start
> watchdog unconditionally here?
> 
Yes, that would be another option, and it sounds like a good idea.
Let me know if you want to do that.

Thanks,
Guenter

> In that case it will be no matter how it's configured in firmware and/or
> boot loader.
> 
> >  
> >  	ret = devm_watchdog_register_device(&pdev->dev, wdt_dev);
> >  	if (ret) {
> 
> -- 
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Intel Finland Oy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running
  2017-03-10 17:16   ` Guenter Roeck
@ 2017-03-10 17:26     ` Andy Shevchenko
  2017-03-10 17:35       ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2017-03-10 17:26 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Wim Van Sebroeck, linux-watchdog

On Fri, 2017-03-10 at 09:16 -0800, Guenter Roeck wrote:
> On Fri, Mar 10, 2017 at 07:05:49PM +0200, Andy Shevchenko wrote:
> > On Fri, 2017-03-10 at 18:51 +0200, Andy Shevchenko wrote:

> > > +	/*
> > > +	 * Make sure the watchdog is serviced.
> > > +	 *
> > > +	 * The firmware followed by U-Boot leaves the watchdog
> > > running
> > > +	 * with the default threshold 60 seconds. Our default
> > > timeout
> > > is
> > > +	 * 90 seconds, but internal worker divides it by two,
> > > which
> > > is
> > > +	 * 45 seconds and should be enough (less by 15 seconds
> > > than
> > > +	 * threshold).
> > > +	 */
> > > +	set_bit(WDOG_HW_RUNNING, &wdt_dev->status);
> > 
> > Giving one more thought here perhaps more robust will be to start
> > watchdog unconditionally here?
> 
> Yes, that would be another option, and it sounds like a good idea.
> Let me know if you want to do that.

Yes, I prefer it over the rest of solutions.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running
  2017-03-10 17:26     ` Andy Shevchenko
@ 2017-03-10 17:35       ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2017-03-10 17:35 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Wim Van Sebroeck, linux-watchdog

On Fri, Mar 10, 2017 at 07:26:57PM +0200, Andy Shevchenko wrote:
> On Fri, 2017-03-10 at 09:16 -0800, Guenter Roeck wrote:
> > On Fri, Mar 10, 2017 at 07:05:49PM +0200, Andy Shevchenko wrote:
> > > On Fri, 2017-03-10 at 18:51 +0200, Andy Shevchenko wrote:
> 
> > > > +	/*
> > > > +	 * Make sure the watchdog is serviced.
> > > > +	 *
> > > > +	 * The firmware followed by U-Boot leaves the watchdog
> > > > running
> > > > +	 * with the default threshold 60 seconds. Our default
> > > > timeout
> > > > is
> > > > +	 * 90 seconds, but internal worker divides it by two,
> > > > which
> > > > is
> > > > +	 * 45 seconds and should be enough (less by 15 seconds
> > > > than
> > > > +	 * threshold).
> > > > +	 */
> > > > +	set_bit(WDOG_HW_RUNNING, &wdt_dev->status);
> > > 
> > > Giving one more thought here perhaps more robust will be to start
> > > watchdog unconditionally here?
> > 
> > Yes, that would be another option, and it sounds like a good idea.
> > Let me know if you want to do that.
> 
> Yes, I prefer it over the rest of solutions.
> 
Ok, I'll wait for v3 of the patch.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-10 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10 16:51 [PATCH v2] watchdog: intel-mid_wdt: Keep watchdog running Andy Shevchenko
2017-03-10 17:05 ` Andy Shevchenko
2017-03-10 17:16   ` Guenter Roeck
2017-03-10 17:26     ` Andy Shevchenko
2017-03-10 17:35       ` Guenter Roeck

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.