All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 0/3] watchdog: da9063: Fix timeout handling
@ 2018-05-28  6:45 Marco Felsch
  2018-05-28  6:45 ` [PATCH v9 1/3] watchdog: da9063: Fix setting/changing timeout Marco Felsch
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Marco Felsch @ 2018-05-28  6:45 UTC (permalink / raw)
  To: wim, linux, support.opensource; +Cc: linux-watchdog, kernel

The current set_timeout() handling can't change the timeout value if the
watchdog is already running because the watchdog must be
disabled before a new timeout value can be set. This sounds a bit
strange but it is the only way to change the timeout value.

The watchdog also has a second quirk. The timeout value combines the
timeout and the watchdog enable signal. So a value not equal zero
indicates that the watchdog is running. This leads into problems if the
watchdog is disabled and a new timeout value should be set because
during setting the timeout value the watchdog gets enabled. The driver
must check if the watchdog is disabled. In that case the timeout value
must be stored to be available for the later wdt_start() call. If the
watchdog is already running the driver must write the new timeout value
immediately to the watchdog.

There was also a issue during the driver probe sequence. The driver must
set a new timeout reference mark if the watchdog was enabled in a earlier
stage e.g. the bootloader.

Changelog:

v9:
 - Set the default driver timeout during probe() if the watchdog is
   already running.
 - drop renaming _da9063_wdt_set_timeout [v6]

v8:
 - make use of watchdog_active() helper instead of watchdog_hw_running()
 - fix misspellings
 - drop set HW_RUNNING flag during wdt_start() introduced with v6
 - call _da9063_wdt_set_timeout() during probe() directly if watchdog is
   running.
 - da9063_wdt_is_running() returns now the raw timeout regval instead of
   the maped timeout in seconds.
 - fix da9063_wdt_is_running() return value, use unsigned int instead of
   int.

v7:
 - reorder patch stack "Fixes:" patches first.

v6:
 - fix timeout value buffering (don't buffer it twice, use HW_RUNNING
   flag)
 - set HW_RUNNING flag during wdt_start()
 - add watchdog enable check during probe()
 - rename _da9063_wdt_set_timeout -> da9063_wdt_update_timeout

v5:
 - add buffering the timeout if the watchdog is disabled
 - add more comments

v4:
 - Fix patch description

v3:
 - add delay between disable watchdog and write new timeout value during
   timeout update
 - fix comment to be more common

v2:
 - style changes

v1:
 - initial commit

Marco Felsch (3):
  watchdog: da9063: Fix setting/changing timeout
  watchdog: da9063: Fix updating timeout value
  watchdog: da9063: Fix timeout handling during probe

 drivers/watchdog/da9063_wdt.c | 64 ++++++++++++++++++++++++++++++++---
 1 file changed, 60 insertions(+), 4 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-05-28 13:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28  6:45 [PATCH v9 0/3] watchdog: da9063: Fix timeout handling Marco Felsch
2018-05-28  6:45 ` [PATCH v9 1/3] watchdog: da9063: Fix setting/changing timeout Marco Felsch
2018-05-28 13:20   ` Guenter Roeck
2018-05-28  6:45 ` [PATCH v9 2/3] watchdog: da9063: Fix updating timeout value Marco Felsch
2018-05-28 13:21   ` Guenter Roeck
2018-05-28  6:45 ` [PATCH v9 3/3] watchdog: da9063: Fix timeout handling during probe Marco Felsch
2018-05-28 13:21   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.