]> git.baikalelectronics.ru Git - uboot.git/commit
xyz-modem: Fix timeout loop waiting with WATCHDOG
authorLokesh Vutla <lokeshvutla@ti.com>
Tue, 8 Jan 2019 13:58:35 +0000 (19:28 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jan 2019 20:28:51 +0000 (15:28 -0500)
commitea8a2b0ef6aafe2771d40567f201bc02ce1ed9ac
treed6a7af3d0af744d465f0fba70c3a22d2b4968541
parentcb682c3d87a3004eac917d60524b444107713c04
xyz-modem: Fix timeout loop waiting with WATCHDOG

Commit a6395737c72a2 ("xyz-modem: Change getc timeout loop waiting")
fixes the loop delay when using a hw watchdog, assuming that watchdog
kicking is taken care of by getc(). But the xyzmodem driver tries to
do a getc only after confirming that a character is available like below:
while (!tstc()) {
till timeout;
}
if (tstc())
*c = getc();

and getc() does a watchdog reset only if it fails to see a character.
In this case, getc() always sees a character and never does a
watchdog reset. So to make sure that watchdog doesn't get reset
while loading the file, do a watchdog reset just before starting the
image loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/xyzModem.c