watchdog: booke_wdt: Disable the watchdog prior to setting a new timeout value in order to avoid the following situation
PATCH 1/1 watchdog: booke_wdt: Disable the watchdog prior to setting a new timeout value in order to avoid the following situation
A watchdog timer exception also occurs if the selected time base bit transitions from 0 to 1 due to an mtspr that writes a 1 to the bit when its previous value was 0.
--- drivers/watchdog/booke_wdt.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/watchdog/booke_wdt.c +6 -0
@@ -186,9 +186,15 @@ static int booke_wdt_stop(struct watchdog_device *wdog)static int booke_wdt_set_timeout (struct watchdog_device *wdt_dev,unsigned int timeout) { +if (watchdog_active (wdt_dev)) +on_each_cpu (__booke_wdt_disable,NULL ,0 ); + wdt_dev->timeout = timeout;booke_wdt_set (wdt_dev); +if (watchdog_active (wdt_dev)) +on_each_cpu (__booke_wdt_enable, wdt_dev,0 ); +return 0 ; }
Signature · 1 line
2.9.3
Guenter Roeck
maintainerQuoted 3 lines · Xiaofeng Wei
A watchdog timer exception also occurs if the selected time base bit transitions from 0 to 1 due to an mtspr that writes a 1 to the bit when its previous value was 0.
Please drop "in order to ..." from the subject line. Every patch hopefully does that.
Quoted 10 lines
Signed-off-by Xiaofeng Wei <[email protected]>--- drivers/watchdog/booke_wdt.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/watchdog/booke_wdt.c +0
-0
drivers/watchdog/booke_wdt.c static int booke_wdt_stop(struct watchdog_device *wdog) · line 191
Quoted 6 lines
drivers/watchdog/booke_wdt.c +3
-0@@ -186,9 +186,15 @@ static int booke_wdt_stop(struct watchdog_device *wdog)static int booke_wdt_set_timeout (struct watchdog_device *wdt_dev,unsigned int timeout) { +if (watchdog_active (wdt_dev)) +on_each_cpu (__booke_wdt_disable,NULL ,0 ); +
Thios would only be necessary if the timeout actually changes. Also, does the problem apply to _all_ chips supported by this driver or only to a subset ?
Guenter
Quoted 12 lines
drivers/watchdog/booke_wdt.c +3
-0wdt_dev->timeout = timeout;booke_wdt_set (wdt_dev); +if (watchdog_active (wdt_dev)) +on_each_cpu (__booke_wdt_enable, wdt_dev,0 ); +return 0 ; }Signature · 1 line
2.9.3