linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup
@ 2016-11-18 14:50 Andy Shevchenko
  2016-11-18 15:50 ` Guenter Roeck
  2016-11-19 15:55 ` Guenter Roeck
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Shevchenko @ 2016-11-18 14:50 UTC (permalink / raw)
  To: Wim Van Sebroeck, linux-watchdog, Guenter Roeck, mika.westerberg
  Cc: Andy Shevchenko

Make sure that the watchdog is not running after loading
and before it is started by opening /dev/watchdog.

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

diff --git a/drivers/watchdog/intel-mid_wdt.c b/drivers/watchdog/intel-mid_wdt.c
index db36d12..ff099a3 100644
--- a/drivers/watchdog/intel-mid_wdt.c
+++ b/drivers/watchdog/intel-mid_wdt.c
@@ -151,6 +151,9 @@ static int mid_wdt_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	/* Make sure the watchdog is not running */
+	wdt_stop(wdt_dev);
+
 	ret = watchdog_register_device(wdt_dev);
 	if (ret) {
 		dev_err(&pdev->dev, "error registering watchdog device\n");
-- 
2.10.2


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

* Re: [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup
  2016-11-18 14:50 [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup Andy Shevchenko
@ 2016-11-18 15:50 ` Guenter Roeck
  2016-11-18 17:36   ` Andy Shevchenko
  2016-11-19 15:55 ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2016-11-18 15:50 UTC (permalink / raw)
  To: Andy Shevchenko, Wim Van Sebroeck, linux-watchdog,
	mika.westerberg

On 11/18/2016 06:50 AM, Andy Shevchenko wrote:
> Make sure that the watchdog is not running after loading
> and before it is started by opening /dev/watchdog.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/watchdog/intel-mid_wdt.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/watchdog/intel-mid_wdt.c b/drivers/watchdog/intel-mid_wdt.c
> index db36d12..ff099a3 100644
> --- a/drivers/watchdog/intel-mid_wdt.c
> +++ b/drivers/watchdog/intel-mid_wdt.c
> @@ -151,6 +151,9 @@ static int mid_wdt_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>
> +	/* Make sure the watchdog is not running */
> +	wdt_stop(wdt_dev);
> +
>  	ret = watchdog_register_device(wdt_dev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "error registering watchdog device\n");
>

This leaves the system exposed. Why not just tell the core if the watchdog
is running and let it handle the ping until the device is opened ?
Is it not possible to detect if the watchdog is running ?

Guenter


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

* Re: [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup
  2016-11-18 15:50 ` Guenter Roeck
@ 2016-11-18 17:36   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2016-11-18 17:36 UTC (permalink / raw)
  To: Guenter Roeck, Wim Van Sebroeck, linux-watchdog, mika.westerberg

On Fri, 2016-11-18 at 07:50 -0800, Guenter Roeck wrote:
> On 11/18/2016 06:50 AM, Andy Shevchenko wrote:
> > Make sure that the watchdog is not running after loading
> > and before it is started by opening /dev/watchdog.

@@ -151,6 +151,9 @@ static int mid_wdt_probe(struct platform_device

> > +	/* Make sure the watchdog is not running */
> > +	wdt_stop(wdt_dev);
> > +
> >  	ret = watchdog_register_device(wdt_dev);

> This leaves the system exposed. Why not just tell the core if the
> watchdog
> is running and let it handle the ping until the device is opened ?
> Is it not possible to detect if the watchdog is running ?

It would be nice to have, but...

Just checked all documents I have access to. They even didn't describe a
content of watchdog IPC command!

So, we may just assume it's enabled by firmware until it is proven not
to. 

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

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

* Re: [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup
  2016-11-18 14:50 [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup Andy Shevchenko
  2016-11-18 15:50 ` Guenter Roeck
@ 2016-11-19 15:55 ` Guenter Roeck
  2016-11-19 16:10   ` Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2016-11-19 15:55 UTC (permalink / raw)
  To: Andy Shevchenko, Wim Van Sebroeck, linux-watchdog,
	mika.westerberg

On 11/18/2016 06:50 AM, Andy Shevchenko wrote:
> Make sure that the watchdog is not running after loading
> and before it is started by opening /dev/watchdog.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

I don't really like turning off the watchdog, but I guess it is the only
remedy we have if it doesn't tell us if it is running.

Guenter

> ---
>  drivers/watchdog/intel-mid_wdt.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/watchdog/intel-mid_wdt.c b/drivers/watchdog/intel-mid_wdt.c
> index db36d12..ff099a3 100644
> --- a/drivers/watchdog/intel-mid_wdt.c
> +++ b/drivers/watchdog/intel-mid_wdt.c
> @@ -151,6 +151,9 @@ static int mid_wdt_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>
> +	/* Make sure the watchdog is not running */
> +	wdt_stop(wdt_dev);
> +
>  	ret = watchdog_register_device(wdt_dev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "error registering watchdog device\n");
>


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

* Re: [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup
  2016-11-19 15:55 ` Guenter Roeck
@ 2016-11-19 16:10   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2016-11-19 16:10 UTC (permalink / raw)
  To: Guenter Roeck, Wim Van Sebroeck, linux-watchdog, mika.westerberg

On Sat, 2016-11-19 at 07:55 -0800, Guenter Roeck wrote:
> On 11/18/2016 06:50 AM, Andy Shevchenko wrote:
> > Make sure that the watchdog is not running after loading
> > and before it is started by opening /dev/watchdog.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Thanks!

> 
> I don't really like turning off the watchdog, but I guess it is the
> only
> remedy we have if it doesn't tell us if it is running.

That is my understanding based on current documentation and driver
implementation we have.

> 
> Guenter
> 
> > ---
> >  drivers/watchdog/intel-mid_wdt.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/watchdog/intel-mid_wdt.c
> > b/drivers/watchdog/intel-mid_wdt.c
> > index db36d12..ff099a3 100644
> > --- a/drivers/watchdog/intel-mid_wdt.c
> > +++ b/drivers/watchdog/intel-mid_wdt.c
> > @@ -151,6 +151,9 @@ static int mid_wdt_probe(struct platform_device
> > *pdev)
> >  		return ret;
> >  	}
> > 
> > +	/* Make sure the watchdog is not running */
> > +	wdt_stop(wdt_dev);
> > +
> >  	ret = watchdog_register_device(wdt_dev);
> >  	if (ret) {
> >  		dev_err(&pdev->dev, "error registering watchdog
> > device\n");
> > 
> 
> 

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

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

end of thread, other threads:[~2016-11-19 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-18 14:50 [PATCH v1 1/1] intel-mid_wdt: make sure watchdog is not running at startup Andy Shevchenko
2016-11-18 15:50 ` Guenter Roeck
2016-11-18 17:36   ` Andy Shevchenko
2016-11-19 15:55 ` Guenter Roeck
2016-11-19 16:10   ` Andy Shevchenko

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).