Skip to contentSkip to conversation

intel-mid_wdt: make sure watchdog is not running at startup

PATCH In review Andy Shevchenko 2 participants 5 messages Nov 18, 2016 – Nov 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel-mid_wdt: make sure watchdog is not running at startup

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

---
 drivers/watchdog/intel-mid_wdt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/watchdog/intel-mid_wdt.c +3 -0
index db36d12..ff099a3 100644
@@ -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");
Signature · 1 line
2.10.2
maintainer
#1 lore raw
Quoted 14 lines · Andy Shevchenko

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

---
 drivers/watchdog/intel-mid_wdt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/watchdog/intel-mid_wdt.c +0 -0
index db36d12..ff099a3 100644

drivers/watchdog/intel-mid_wdt.c static int mid_wdt_probe(struct platform_device *pdev) · line 159

Quoted 9 lines
drivers/watchdog/intel-mid_wdt.c +3 -0
@@ -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

#2 lore raw
Quoted 3 lines · Guenter Roeck
Quoted 2 lines · Andy Shevchenko

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

Quoted 9 lines
Quoted 4 lines
drivers/watchdog/intel-mid_wdt.c +3 -0
+	/* 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.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

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

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

Quoted 19 lines
---
 drivers/watchdog/intel-mid_wdt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/watchdog/intel-mid_wdt.c +3 -0
index db36d12..ff099a3 100644
@@ -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");
#4 lore raw
Quoted 7 lines · Guenter Roeck
Quoted 4 lines · Andy Shevchenko

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

Thanks!

Quoted 4 lines

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.

Quoted 27 lines

Guenter

Quoted 22 lines

---
 drivers/watchdog/intel-mid_wdt.c | 3 +++

 1 file changed, 3 insertions(+)
drivers/watchdog/intel-mid_wdt.c +3 -0
index db36d12..ff099a3 100644
@@ -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");

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy