Thread (7 messages) 7 messages, 4 authors, 2018-02-12

RE: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler

From: Fabrizio Castro <hidden>
Date: 2018-02-12 10:33:47
Also in: linux-arm-kernel, linux-clk, linux-renesas-soc, linux-watchdog

Possibly related (same subject, not in this thread)

Hello Wolfram,

thank you for your feedback!
Subject: Re: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler

quoted
+static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
+void *data)
+{
+struct rwdt_priv *priv = watchdog_get_drvdata(wdev);
+
+pm_runtime_get_sync(wdev->parent);
+
+rwdt_write(priv, 0x00, RWTCSRB);
+rwdt_write(priv, 0x00, RWTCSRA);
+rwdt_write(priv, 0xffff, RWTCNT);
+
+while (readb_relaxed(priv->base + RWTCSRA) & RWTCSRA_WRFLG)
+cpu_relax();
+
+rwdt_write(priv, 0x80, RWTCSRA);
+return 0;
+}
I used to have this simpler version (back then for the UP case):

+rwdt_start(wdev);
+rwdt_write(priv, 0xffff, RWTCNT);
+return 0;

It should still work probably...
It should still work, but it would be slower, I would stick with the version I have submitted if you don't mind.

Thanks,
Fabrizio





Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help