From: Lokesh Vutla Date: Tue, 19 Sep 2017 08:22:03 +0530 Subject: [U-Boot] [PATCH v2] xyz-modem: Fix timeout loop waiting with WATCHDOG Message-ID: <20170919025203.29705-1-lokeshvutla@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Commit 2c77c0d6524eb ("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 watchdog kicking in getc happens only when a request for retry is occurred. This request might not happen all the time. So, kick the watchdog before loop waiting, instead of relying on other functions. Signed-off-by: Lokesh Vutla --- This fixes UART boot on AM335x-evm. Changes since v1: - Updated commit meesage. common/xyzModem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/xyzModem.c b/common/xyzModem.c index a0c5dfeece..8c4679473f 100644 --- a/common/xyzModem.c +++ b/common/xyzModem.c @@ -26,6 +26,7 @@ #include #include #include +#include /* Assumption - run xyzModem protocol over the console port */ @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c) { ulong now = get_timer(0); + WATCHDOG_RESET(); while (!tstc ()) { if (get_timer(now) > xyzModem_CHAR_TIMEOUT) -- 2.14.1