[PATCH] watchdog: imxwd: Do not suspend in lpm on i.MX27

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

 



The i.MX watchdog has two different configurable behaviours for low
power modes.  The watchdog can either be suspended during low power
modes or kept running.
The useful behaviour is normally to disable it during low power modes to
be able to suspend the system without having the watchdog resetting the
system. This setting was introduced in the Kernel back in 2014 [1] and
in barebox back in 2021 [2].
On i.MX27 however this setting has the effect that the watchdog is
suspended during normal cpu_do_idle(), so on an idle system it takes
very long time until the watchdog triggers. This renders this setting
useless, so disable it on i.MX27. This seems to be fixed on SoCs newer
than i.MX35.

[1] 1a9c5efa576ec ("watchdog: imx2_wdt: disable watchdog timer during low power mode")
[2] c3787a81f26bb ("watchdog: imxwd: suspend watchdog timer in low power mode")

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/watchdog/imxwd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 8f4de5a994..616248af38 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -33,6 +33,7 @@ struct imx_wd {
 	struct restart_handler restart_warm;
 	bool ext_reset;
 	bool bigendian;
+	bool suspend_in_lpm;
 };
 
 #define to_imx_wd(h) container_of(h, struct imx_wd, wd)
@@ -127,7 +128,8 @@ static int imx21_watchdog_set_timeout(struct imx_wd *priv, unsigned timeout)
 		val |= IMX21_WDOG_WCR_WDT;
 
 	/* Suspend timer in low power mode */
-	val |= IMX21_WDOG_WCR_WDZST;
+	if (priv->suspend_in_lpm)
+		val |= IMX21_WDOG_WCR_WDZST;
 
 	/*
 	 * set time and some write once bits first prior enabling the
@@ -273,6 +275,7 @@ static int imx_wd_probe(struct device *dev)
 
 	priv->ext_reset = of_property_read_bool(dev->of_node,
 						"fsl,ext-reset-output");
+	priv->suspend_in_lpm = !of_machine_is_compatible("fsl,imx27");
 
 	if (IS_ENABLED(CONFIG_WATCHDOG_IMX)) {
 		if (priv->ops->is_running) {
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux