watchdog: meson: keep running if already active
authorPhilippe Boos <pboos@baylibre.com>
Mon, 1 Aug 2022 09:21:50 +0000 (11:21 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 2 Oct 2022 10:55:41 +0000 (12:55 +0200)
commit6adbfbab0f039bb89edb9d3ad0d9ac8a18efa6db
tree1a130697eaeda47e8d87acc61bf7122ec9ccdabc
parentb24620608dc2b54cb9df511e3d2c789f99497538
watchdog: meson: keep running if already active

If the watchdog is already running (e.g.: started by bootloader) then
the kernel driver should keep the watchdog active but the amlogic driver
turns it off.

Let the driver fix the clock rate if already active because we do not
know the previous timebase value. To avoid unintentional resetting we
temporarily set it to its maximum value.

Then keep the enable bit if is was previously active.

Signed-off-by: Philippe Boos <pboos@baylibre.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220801092150.4449-1-pboos@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/meson_gxbb_wdt.c