[PATCH] watchdog: pnx4008: readout watchddog state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Readout the enabled state so it is possible to get the pre-userspace
handler working. Also, avoid disabling the watchdog when nowayout is set to
ensure the watchdog continues working and triggers if there is an issue
later in the boot or if userspace fails to start.

Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
---
 drivers/watchdog/pnx4008_wdt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index 8e261799c84e..9e3714e3814c 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -209,7 +209,11 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
 	watchdog_set_nowayout(&pnx4008_wdd, nowayout);
 	watchdog_set_restart_priority(&pnx4008_wdd, 128);
 
-	pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
+	if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB)
+		set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status);
+
+	if (!nowayout)
+		pnx4008_wdt_stop(&pnx4008_wdd);	/* disable for now */
 
 	ret = watchdog_register_device(&pnx4008_wdd);
 	if (ret < 0) {
-- 
2.20.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux