Skip to content
Commit 6d8eae9a authored by Chris Packham's avatar Chris Packham Committed by Stefan Roese
Browse files

watchdog: Handle timer wrap around



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: default avatarChris Packham <judge.packham@gmail.com>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
parent ed666fb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment