* [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode
@ 2014-01-13 11:58 Anson Huang
2014-01-13 12:23 ` Shawn Guo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Anson Huang @ 2014-01-13 11:58 UTC (permalink / raw)
To: wim, shawn.guo; +Cc: linux-watchdog
We should set watchdog timer to be disabled in low power mode,
as there is no service running in background, otherwise, system
will reset unexpected.
Signed-off-by: Anson Huang <b20788@freescale.com>
---
drivers/watchdog/imx2_wdt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index b4786bc..dd51d95 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -2,6 +2,7 @@
* Watchdog driver for IMX2 and later processors
*
* Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de>
+ * Copyright (C) 2014 Freescale Semiconductor, Inc.
*
* some parts adapted by similar drivers from Darius Augulis and Vladimir
* Zapolskiy, additional improvements by Wim Van Sebroeck.
@@ -40,6 +41,7 @@
#define IMX2_WDT_WCR_WT (0xFF << 8) /* -> Watchdog Timeout Field */
#define IMX2_WDT_WCR_WRE (1 << 3) /* -> WDOG Reset Enable */
#define IMX2_WDT_WCR_WDE (1 << 2) /* -> Watchdog Enable */
+#define IMX2_WDT_WCR_WDZST (1 << 0) /* -> Watchdog timer Suspend */
#define IMX2_WDT_WSR 0x02 /* Service Register */
#define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */
@@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void)
{
u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
+ /* Suspend timer in low power mode, write once-only */
+ val |= IMX2_WDT_WCR_WDZST;
/* Strip the old watchdog Time-Out value */
val &= ~IMX2_WDT_WCR_WT;
/* Generate reset if WDOG times out */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode
2014-01-13 11:58 [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode Anson Huang
@ 2014-01-13 12:23 ` Shawn Guo
2014-01-13 14:49 ` Guenter Roeck
2014-01-13 19:21 ` Wim Van Sebroeck
2 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2014-01-13 12:23 UTC (permalink / raw)
To: Anson Huang; +Cc: wim, linux-watchdog
On Mon, Jan 13, 2014 at 07:58:34PM +0800, Anson Huang wrote:
> We should set watchdog timer to be disabled in low power mode,
> as there is no service running in background, otherwise, system
> will reset unexpected.
>
> Signed-off-by: Anson Huang <b20788@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/watchdog/imx2_wdt.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
> index b4786bc..dd51d95 100644
> --- a/drivers/watchdog/imx2_wdt.c
> +++ b/drivers/watchdog/imx2_wdt.c
> @@ -2,6 +2,7 @@
> * Watchdog driver for IMX2 and later processors
> *
> * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de>
> + * Copyright (C) 2014 Freescale Semiconductor, Inc.
> *
> * some parts adapted by similar drivers from Darius Augulis and Vladimir
> * Zapolskiy, additional improvements by Wim Van Sebroeck.
> @@ -40,6 +41,7 @@
> #define IMX2_WDT_WCR_WT (0xFF << 8) /* -> Watchdog Timeout Field */
> #define IMX2_WDT_WCR_WRE (1 << 3) /* -> WDOG Reset Enable */
> #define IMX2_WDT_WCR_WDE (1 << 2) /* -> Watchdog Enable */
> +#define IMX2_WDT_WCR_WDZST (1 << 0) /* -> Watchdog timer Suspend */
>
> #define IMX2_WDT_WSR 0x02 /* Service Register */
> #define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */
> @@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void)
> {
> u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
>
> + /* Suspend timer in low power mode, write once-only */
> + val |= IMX2_WDT_WCR_WDZST;
> /* Strip the old watchdog Time-Out value */
> val &= ~IMX2_WDT_WCR_WT;
> /* Generate reset if WDOG times out */
> --
> 1.7.9.5
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode
2014-01-13 11:58 [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode Anson Huang
2014-01-13 12:23 ` Shawn Guo
@ 2014-01-13 14:49 ` Guenter Roeck
2014-01-13 19:21 ` Wim Van Sebroeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2014-01-13 14:49 UTC (permalink / raw)
To: Anson Huang, wim, shawn.guo; +Cc: linux-watchdog
On 01/13/2014 03:58 AM, Anson Huang wrote:
> We should set watchdog timer to be disabled in low power mode,
> as there is no service running in background, otherwise, system
> will reset unexpected.
>
> Signed-off-by: Anson Huang <b20788@freescale.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/imx2_wdt.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
> index b4786bc..dd51d95 100644
> --- a/drivers/watchdog/imx2_wdt.c
> +++ b/drivers/watchdog/imx2_wdt.c
> @@ -2,6 +2,7 @@
> * Watchdog driver for IMX2 and later processors
> *
> * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de>
> + * Copyright (C) 2014 Freescale Semiconductor, Inc.
> *
> * some parts adapted by similar drivers from Darius Augulis and Vladimir
> * Zapolskiy, additional improvements by Wim Van Sebroeck.
> @@ -40,6 +41,7 @@
> #define IMX2_WDT_WCR_WT (0xFF << 8) /* -> Watchdog Timeout Field */
> #define IMX2_WDT_WCR_WRE (1 << 3) /* -> WDOG Reset Enable */
> #define IMX2_WDT_WCR_WDE (1 << 2) /* -> Watchdog Enable */
> +#define IMX2_WDT_WCR_WDZST (1 << 0) /* -> Watchdog timer Suspend */
>
> #define IMX2_WDT_WSR 0x02 /* Service Register */
> #define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */
> @@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void)
> {
> u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
>
> + /* Suspend timer in low power mode, write once-only */
> + val |= IMX2_WDT_WCR_WDZST;
> /* Strip the old watchdog Time-Out value */
> val &= ~IMX2_WDT_WCR_WT;
> /* Generate reset if WDOG times out */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode
2014-01-13 11:58 [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode Anson Huang
2014-01-13 12:23 ` Shawn Guo
2014-01-13 14:49 ` Guenter Roeck
@ 2014-01-13 19:21 ` Wim Van Sebroeck
2 siblings, 0 replies; 4+ messages in thread
From: Wim Van Sebroeck @ 2014-01-13 19:21 UTC (permalink / raw)
To: Anson Huang; +Cc: shawn.guo, linux-watchdog
Hi Anson,
> We should set watchdog timer to be disabled in low power mode,
> as there is no service running in background, otherwise, system
> will reset unexpected.
>
> Signed-off-by: Anson Huang <b20788@freescale.com>
Added to linux-watchdog-next.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-13 19:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 11:58 [PATCH] watchdog: imx2_wdt: disable watchdog timer during low power mode Anson Huang
2014-01-13 12:23 ` Shawn Guo
2014-01-13 14:49 ` Guenter Roeck
2014-01-13 19:21 ` Wim Van Sebroeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.