OSDN Git Service

watchdog: dw: RMW the control register
authorBrian Norris <briannorris@chromium.org>
Sat, 10 Mar 2018 03:46:06 +0000 (19:46 -0800)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Tue, 13 Mar 2018 18:14:18 +0000 (19:14 +0100)
commita81abbb412341e9e3b2d42ed7d310cf71fbb84a8
treedca9a3bf66e5a895a66b08848a5ffd584d993090
parent3c578cd4bc52b6e65d65be1abad9a8aa489ec207
watchdog: dw: RMW the control register

RK3399 has rst_pulse_length in CONTROL_REG[4:2], determining the length
of pulse to issue for system reset. We shouldn't clobber this value,
because that might make the system reset ineffective. On RK3399, we're
seeing that a value of 000b (meaning 2 cycles) yields an unreliable
(partial?) reset, and so we only fully reset after the watchdog fires a
second time. If we retain the system default (010b, or 8 clock cycles),
then the watchdog reset is much more reliable.

Read-modify-write retains the system value and improves reset
reliability.

It seems we were intentionally clobbering the response mode previously,
to ensure we performed a system reset (we don't support an interrupt
notification), so retain that explicitly.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/dw_wdt.c