From: Stefan Roese Date: Mon, 24 Feb 2020 12:48:14 +0100 Subject: [PATCH] watchdog: Handle timer wrap around In-Reply-To: <20200224002033.17860-1-judge.packham@gmail.com> References: <20200224002033.17860-1-judge.packham@gmail.com> Message-ID: <61c174e0-54fa-da2b-7b7d-8a79982dc561@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 24.02.20 01:20, Chris Packham wrote: > On some platforms/architectures the value from get_timer() can wrap. > This is particularly problematic when long-running code needs to measure > a time difference as is the case with watchdog_reset() which tries to > avoid tickling the watchdog too frequently. > > Use time_after() from time.h instead of a plain > comparison to avoid > any issues with the time wrapping on a system that has been sitting in > u-boot for a long time. > > Signed-off-by: Chris Packham Reviewed-by: Stefan Roese Thanks, Stefan