]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
watchdog: da9063: Fix updating timeout value
authorMarco Felsch <m.felsch@pengutronix.de>
Mon, 28 May 2018 06:45:45 +0000 (08:45 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:31 +0000 (14:20 +0100)
commit2914be71808c61119214c82ccff228362f81b808
treef1cc02181515f6774e64d9d5ab0ec3fca151d769
parent026f51266d389c33d01a634d5c611bcc39a448bc
watchdog: da9063: Fix updating timeout value

BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit 44ee54aabfdb3b35866ed909bde3ab01e9679385 ]

The DA9063 watchdog has only one register field to store the timeout value
and to enable the watchdog. The watchdog gets enabled if the value is
not zero. There is no issue if the watchdog is already running but it
leads into problems if the watchdog is disabled.

If the watchdog is disabled and only the timeout value should be prepared
the watchdog gets enabled too. Add a check to get the current watchdog
state and update the watchdog timeout value on hw-side only if the
watchdog is already active.

Fixes: 5e9c16e37608 ("watchdog: Add DA9063 PMIC watchdog driver.")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/watchdog/da9063_wdt.c