Re: [PATCH v2 2/3] watchdog: sama5d4: Fix setting timeout when watchdog is disabled

From: Guenter Roeck
Date: Sun Feb 19 2017 - 23:46:27 EST

On 02/19/2017 03:52 PM, Alexandre Belloni wrote:
On 19/02/2017 at 08:57:35 -0800, Guenter Roeck wrote:
That means if the watchdog is running, the timeout would not be updated.
It should be updated no matter if it is running or not.

No, it is enabling the watchdog, then changing WDV and WDD and finally
disabling the watchdog if necessary. So, WDV and WDD are always changed.

You are correct. Sorry for the noise.

Seems odd that the watchdog must be _running_ to change the timeout.
Usually, if there is a restriction, it is the opposite. I hope this
doesn't cause race conditions, where the watchdog fires immediately
after being enabled due to a low timeout.

While it is difficult to reproduce, I can confirm it races and sometimes
reset the SoC without any good reason. It doesn't matter whether it is
disabled or not

Outch :-(.

I've raised the issue at Atmel last Thursday so I don't have any answer

Please keep us in the loop.