linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] watchdog: renesas_wdt: don't keep timer value during suspend/resume
@ 2018-12-04 12:01 Wolfram Sang
  2018-12-04 12:42 ` Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Wolfram Sang @ 2018-12-04 12:01 UTC (permalink / raw)
  To: linux-watchdog
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Fabrizio Castro, Wolfram Sang

After discussing this mail thread [1] again, we concluded that giving
userspace enough time to prepare is our favourite option. So, do not
keep the time value when suspended but reset it when resuming.

[1] https://patchwork.kernel.org/patch/10252209/

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Fabrizio: can you agree to that? The R-Car BSP team and we (the R-Car upstream
team) would prefer it this way (knowing it is also not perfect).

 drivers/watchdog/renesas_wdt.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index b570962e84f3..9f2307bf727b 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -48,7 +48,6 @@ struct rwdt_priv {
 	void __iomem *base;
 	struct watchdog_device wdev;
 	unsigned long clk_rate;
-	u16 time_left;
 	u8 cks;
 };
 
@@ -263,10 +262,9 @@ static int __maybe_unused rwdt_suspend(struct device *dev)
 {
 	struct rwdt_priv *priv = dev_get_drvdata(dev);
 
-	if (watchdog_active(&priv->wdev)) {
-		priv->time_left = readw(priv->base + RWTCNT);
+	if (watchdog_active(&priv->wdev))
 		rwdt_stop(&priv->wdev);
-	}
+
 	return 0;
 }
 
@@ -274,10 +272,9 @@ static int __maybe_unused rwdt_resume(struct device *dev)
 {
 	struct rwdt_priv *priv = dev_get_drvdata(dev);
 
-	if (watchdog_active(&priv->wdev)) {
+	if (watchdog_active(&priv->wdev))
 		rwdt_start(&priv->wdev);
-		rwdt_write(priv, priv->time_left, RWTCNT);
-	}
+
 	return 0;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-12-10 14:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04 12:01 [RFC] watchdog: renesas_wdt: don't keep timer value during suspend/resume Wolfram Sang
2018-12-04 12:42 ` Geert Uytterhoeven
2018-12-04 12:48 ` Fabrizio Castro
2018-12-04 15:20 ` Guenter Roeck
2018-12-07 21:45   ` Wolfram Sang
2018-12-08 21:38     ` Guenter Roeck
2018-12-09 16:36       ` Wolfram Sang
2018-12-09 18:12         ` Guenter Roeck
2018-12-09 18:40           ` Wolfram Sang
2018-12-10  9:37           ` Fabrizio Castro
2018-12-10 14:23             ` Guenter Roeck
2018-12-10 14:47               ` Fabrizio Castro
2018-12-10 14:47                 ` Fabrizio Castro
2018-12-10  9:40     ` Fabrizio Castro
2018-12-10 14:49 ` Fabrizio Castro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).