Skip to contentSkip to conversation

watchdog: imx2_wdt: Add power management support.

PATCH Guenter Roeck 2 participants 2 messages Sep 22, 2014 – Sep 23, 2014 Watchdog device drivers

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw
Quoted 18 lines · Xiubo Li

Add power management operations(suspend and resume) as part of dev_pm_ops for IMX2 watchdog driver.

---
 drivers/watchdog/imx2_wdt.c | 47 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
drivers/watchdog/imx2_wdt.c +2 -0
index 68c3d37..941c36f 100644
@@ -295,6 +295,52 @@ static void imx2_wdt_shutdown(struct platform_device *pdev)
 	}
 }
 
+#ifdef CONFIG_PM_SLEEP
+/* Disable watchdog if it is active during suspend */

drivers/watchdog/imx2_wdt.c static void imx2_wdt_shutdown(struct platform_device *pdev) · line 309

Quoted 10 lines
drivers/watchdog/imx2_wdt.c +10 -0
+static int imx2_wdt_suspend(struct device *dev)
+{
+	struct watchdog_device *wdog = dev_get_drvdata(dev);
+	struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
+
+	imx2_wdt_set_timeout(wdog, IMX2_WDT_MAX_TIME);
+	imx2_wdt_ping(wdog);
+
+	/* Watchdog has been stopped but IP block is still running */
+	if (!watchdog_active(&wdog) && imx2_wdt_is_running(wdev))

Turns out this has a bug.

s/&wdog/wdog/

Please resubmit.

Thanks,
Guenter

#1 lore raw
Quoted 36 lines

Subject: Re: [PATCH] watchdog: imx2_wdt: Add power management support.

Quoted 6 lines · Xiubo Li

Add power management operations(suspend and resume) as part of dev_pm_ops for IMX2 watchdog driver.

---
 drivers/watchdog/imx2_wdt.c | 47

+++++++++++++++++++++++++++++++++++++++++++++

drivers/watchdog/imx2_wdt.c static void imx2_wdt_shutdown(struct platform_device

Quoted 7 lines
 1 file changed, 47 insertions(+)
drivers/watchdog/imx2_wdt.c +0 -0
index 68c3d37..941c36f 100644
@@ -295,6 +295,52 @@ static void imx2_wdt_shutdown(struct platform_device

*pdev)

Quoted 5 lines
drivers/watchdog/imx2_wdt.c +2 -0
 	}
 }
 
+#ifdef CONFIG_PM_SLEEP
+/* Disable watchdog if it is active during suspend */

drivers/watchdog/imx2_wdt.c static void imx2_wdt_shutdown(struct platform_device · line 309

Quoted 10 lines
drivers/watchdog/imx2_wdt.c +10 -0
+static int imx2_wdt_suspend(struct device *dev)
+{
+	struct watchdog_device *wdog = dev_get_drvdata(dev);
+	struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
+
+	imx2_wdt_set_timeout(wdog, IMX2_WDT_MAX_TIME);
+	imx2_wdt_ping(wdog);
+
+	/* Watchdog has been stopped but IP block is still running */
+	if (!watchdog_active(&wdog) && imx2_wdt_is_running(wdev))

Turns out this has a bug.

Quoted 4 lines

s/&wdog/wdog/

Please resubmit.

Found lost one commit about fixing this and other comments.

Thanks,

BRs

Quoted 6 lines

Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html