[{"id":1769605,"web_url":"http://patchwork.ozlabs.org/comment/1769605/","msgid":"<20170916134312.GD4560@bill-the-cat>","list_archive_url":null,"date":"2017-09-16T13:43:12","subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Sat, Sep 16, 2017 at 05:14:31PM +0530, Lokesh Vutla wrote:\n> Commit 2c77c0d6524eb (\"xyz-modem: Change getc timeout loop waiting\")\n> fixes the loop delay when using a hw watchdog. But assuming that Watchdog\n> kicking is taken care of by getc(). This is not true in case of DM_SERIAL.\n> So, kick the watchdog before loop waiting, instead of relying on other\n> functions.\n> \n> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>\n> ---\n> - This fixes UART boot on AM335x-evm.\n> \n>  common/xyzModem.c | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/common/xyzModem.c b/common/xyzModem.c\n> index a0c5dfeece..8c4679473f 100644\n> --- a/common/xyzModem.c\n> +++ b/common/xyzModem.c\n> @@ -26,6 +26,7 @@\n>  #include <xyzModem.h>\n>  #include <stdarg.h>\n>  #include <crc.h>\n> +#include <watchdog.h>\n>  \n>  /* Assumption - run xyzModem protocol over the console port */\n>  \n> @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)\n>  {\n>  \n>    ulong now = get_timer(0);\n> +  WATCHDOG_RESET();\n>    while (!tstc ())\n>      {\n>        if (get_timer(now) > xyzModem_CHAR_TIMEOUT)\n\nMy worry is that other places also assume watchdog petted by getc().\nSimon, is there a reason DM_SERIAL isn't doing what was done before?\nThanks!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"KNNWbLSM\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvYPp2tljz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 23:43:26 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 27C69C21E84; Sat, 16 Sep 2017 13:43:20 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 57459C21C58;\n\tSat, 16 Sep 2017 13:43:18 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 2554EC21C58; Sat, 16 Sep 2017 13:43:17 +0000 (UTC)","from mail-yw0-f169.google.com (mail-yw0-f169.google.com\n\t[209.85.161.169])\n\tby lists.denx.de (Postfix) with ESMTPS id 6225BC21C26\n\tfor <u-boot@lists.denx.de>; Sat, 16 Sep 2017 13:43:16 +0000 (UTC)","by mail-yw0-f169.google.com with SMTP id r85so2876638ywg.1\n\tfor <u-boot@lists.denx.de>; Sat, 16 Sep 2017 06:43:16 -0700 (PDT)","from bill-the-cat (cpe-65-184-142-68.ec.res.rr.com.\n\t[65.184.142.68]) by smtp.gmail.com with ESMTPSA id\n\tj6sm1240553ywg.44.2017.09.16.06.43.13\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tSat, 16 Sep 2017 06:43:14 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=fof2dug7n7+Gml2wv7gohUIducVFmo9lv2w3oP3R5X8=;\n\tb=KNNWbLSMEisoeyx51hn8/s48L1VzAjJEz7qqKB8TVwfRnbAUN63EJPT7ihH67LEoZN\n\tfVkav4Z8oHhLvc9Uht7uxXeokKKD1MEMEuCd07RD5DQ4LEc/gJ8oc7fRc81Luw+mP3uJ\n\tLczhjKOGkk4Rgbhp284F64hU7QM7TG7271ZUc=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=fof2dug7n7+Gml2wv7gohUIducVFmo9lv2w3oP3R5X8=;\n\tb=Nl03FxbiYUEZCTtz5VmIk+8/DNNHPMSNTy393o56fDO2MEBl6Tl1OVG83phFtkv4jn\n\tuhmr5zZVCv3FkyeLh4vcAkZn/blZ+zfpw+p1KYPEmUwz8z7N2yzlXkmLm2pCykUqJYli\n\txNFJbwbujpPtZNZ8x52dzErhVHlWoLjBG6Q68qllEuf47UfR8oiEjBXEvSX7xUhdoKM0\n\tFyzgs3/SZQnV8zeBTeh3ZBpw5/TrGCUlNWdjERlQ7rrQxv/rQQ4T4/PXUOzIqGGnaEyv\n\tmonSIpqqFg8X8hSS0L7ESEWMqlckyD01WSDH+IsVyndyMFvT09pspNbLoyofBVZeapdj\n\t9ujw==","X-Gm-Message-State":"AHPjjUiMy6oVCPgohquA7v/Jrs/Aw/zE9Wtghn+fyLwU52GMnCLlkZ3P\n\tYzh0acYUVdtbfFQp","X-Google-Smtp-Source":"ADKCNb563vEkbwbYgOZrhsFGwK9CwPofVoNLwyl8jFJpc2nDySJa2wwbGv+XScU7txb2ARfrxfAalA==","X-Received":"by 10.37.42.19 with SMTP id q19mr17243609ybq.240.1505569394937; \n\tSat, 16 Sep 2017 06:43:14 -0700 (PDT)","Date":"Sat, 16 Sep 2017 09:43:12 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Lokesh Vutla <lokeshvutla@ti.com>, Simon Glass <sjg@chromium.org>","Message-ID":"<20170916134312.GD4560@bill-the-cat>","References":"<20170916114431.23412-1-lokeshvutla@ti.com>","MIME-Version":"1.0","In-Reply-To":"<20170916114431.23412-1-lokeshvutla@ti.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"Tero Kristo <t-kristo@ti.com>, u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============4572204149795169433==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1769616,"web_url":"http://patchwork.ozlabs.org/comment/1769616/","msgid":"<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>","list_archive_url":null,"date":"2017-09-16T16:13:56","subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi,\n\nOn 16 September 2017 at 07:43, Tom Rini <trini@konsulko.com> wrote:\n> On Sat, Sep 16, 2017 at 05:14:31PM +0530, Lokesh Vutla wrote:\n>> Commit 2c77c0d6524eb (\"xyz-modem: Change getc timeout loop waiting\")\n>> fixes the loop delay when using a hw watchdog. But assuming that Watchdog\n>> kicking is taken care of by getc(). This is not true in case of DM_SERIAL.\n>> So, kick the watchdog before loop waiting, instead of relying on other\n>> functions.\n>>\n>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>\n>> ---\n>> - This fixes UART boot on AM335x-evm.\n>>\n>>  common/xyzModem.c | 2 ++\n>>  1 file changed, 2 insertions(+)\n>>\n>> diff --git a/common/xyzModem.c b/common/xyzModem.c\n>> index a0c5dfeece..8c4679473f 100644\n>> --- a/common/xyzModem.c\n>> +++ b/common/xyzModem.c\n>> @@ -26,6 +26,7 @@\n>>  #include <xyzModem.h>\n>>  #include <stdarg.h>\n>>  #include <crc.h>\n>> +#include <watchdog.h>\n>>\n>>  /* Assumption - run xyzModem protocol over the console port */\n>>\n>> @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)\n>>  {\n>>\n>>    ulong now = get_timer(0);\n>> +  WATCHDOG_RESET();\n>>    while (!tstc ())\n>>      {\n>>        if (get_timer(now) > xyzModem_CHAR_TIMEOUT)\n>\n> My worry is that other places also assume watchdog petted by getc().\n> Simon, is there a reason DM_SERIAL isn't doing what was done before?\n> Thanks!\n\nThis should really be fixed at source. Is the problems in\n_serial_tstc()? The watchdog is reset with _serial_getc().\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"FdtxPPXr\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"bSiNBPXn\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvcm72x5kz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 02:14:30 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 2982CC21DE7; Sat, 16 Sep 2017 16:14:24 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 90D97C21C58;\n\tSat, 16 Sep 2017 16:14:21 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 2353AC21C58; Sat, 16 Sep 2017 16:14:19 +0000 (UTC)","from mail-qk0-f178.google.com (mail-qk0-f178.google.com\n\t[209.85.220.178])\n\tby lists.denx.de (Postfix) with ESMTPS id 1EB46C21C4A\n\tfor <u-boot@lists.denx.de>; Sat, 16 Sep 2017 16:14:19 +0000 (UTC)","by mail-qk0-f178.google.com with SMTP id u67so4325412qkg.6\n\tfor <u-boot@lists.denx.de>; Sat, 16 Sep 2017 09:14:19 -0700 (PDT)","by 10.200.37.200 with HTTP; Sat, 16 Sep 2017 09:13:56 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=lcRs0MG+IPDvdh55UYkmJZSj8MwxNV0cil2+o1pHUow=;\n\tb=FdtxPPXrCaZwp3irB0ILxfaA8wRnknQAk96Dy0XFD512JQ8SL8Phh+hBqsd8GOnFwX\n\t3NcMjgq81xX0x2x7wEvkoIRRzWXitWMs8lrv1hxK3sPcdCgb8ekaWWfRIeq+5Jcbmg/q\n\tEhjb4nbIyfgjgAuq8FhGyqT/98ETaNt+CLDmPO0xtWYHcQYnNFWkxjXSuJOG3varBxTY\n\tvZ5CcK6HeU9/9LOGpP7j7qfokhmV6Wxf4VWVvYLAcoOMGZ3ZvQcZZkW8wISbmzP5GEB1\n\tuNV/GPwm0FyJY1GovCCMMzVyYtuKXk3DwanpIhRJmzOw/JnBlp3u6vxCcOYH42mSm9QU\n\tjobQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=lcRs0MG+IPDvdh55UYkmJZSj8MwxNV0cil2+o1pHUow=;\n\tb=bSiNBPXnRPnXt/9g0p24YfvsKgII1wa3MZTkFB75HA0Dng17FNWIfAiJJEzOJKIK8E\n\tu65hceW6gS8SPzxNUvpOE7tvkbUs97D8SzbGW7sqnfROKRPqmRIw8/Ng1y32XwipnrYm\n\t/yY6Q46WEDwg7mb6vDxN7P6smpISfHZioELqM="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=lcRs0MG+IPDvdh55UYkmJZSj8MwxNV0cil2+o1pHUow=;\n\tb=VT/DEkFHCQpy9fGsxBlsCIy3L+bK5kZ8BHNg23O8tGIyKsglSBJdN5ibxrKyp7YhuY\n\tQXZsfJszfU3yB8KaMBWSXwcGNwXLC8k5MSh2zjmkuKQmoT1EkXJJKT1/thlnMwxGuOO9\n\tnlXLK/hopUPw5gpYiU6LB867O7guH6X9Y13qMxgd+eRsvy7CEjCB5KHsomreLGCTOQx9\n\tazHX/0OXfRZiIA9zgZpHDjQji5ZNxkvh5DZD944SeIkEHcwwOveGYSW4lUqKMrKABwW1\n\tkT9S+vZ/vc/M7IvtscgIoLU3OT36aZS5fxLjnp+dwqbcv3aYs5nCw3FXi4YZ/2lgm+JW\n\tmlRg==","X-Gm-Message-State":"AHPjjUi9upIVmar37of8cs7NsQiIePz04Q8ai5Y/ywzzKKFNWcWWvD2J\n\tsQncRiToqe7AqMPvooB4uZ6g3yxJIBuQVVWjPXY/Mg==","X-Google-Smtp-Source":"AOwi7QDc03/2ToN4WvO6rNmQ0faAIWoXSb733nh1X/OTj90FgGAuzDQhxerAXoRSXUfG1WleSnF0qWrn2/PvJllcODY=","X-Received":"by 10.55.122.130 with SMTP id\n\tv124mr13411491qkc.209.1505578457538; \n\tSat, 16 Sep 2017 09:14:17 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170916134312.GD4560@bill-the-cat>","References":"<20170916114431.23412-1-lokeshvutla@ti.com>\n\t<20170916134312.GD4560@bill-the-cat>","From":"Simon Glass <sjg@chromium.org>","Date":"Sat, 16 Sep 2017 10:13:56 -0600","X-Google-Sender-Auth":"VFERuBN0AlaLjO6BUDhPACRw754","Message-ID":"<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>","To":"Tom Rini <trini@konsulko.com>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>, Tero Kristo <t-kristo@ti.com>","Subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1769666,"web_url":"http://patchwork.ozlabs.org/comment/1769666/","msgid":"<afb2cde0-a698-e1a0-401f-bb8dd5fbe139@ti.com>","list_archive_url":null,"date":"2017-09-17T05:12:03","subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","submitter":{"id":14145,"url":"http://patchwork.ozlabs.org/api/people/14145/","name":"Lokesh Vutla","email":"lokeshvutla@ti.com"},"content":"Simon,\n\nOn 9/16/2017 9:43 PM, Simon Glass wrote:\n> Hi,\n> \n> On 16 September 2017 at 07:43, Tom Rini <trini@konsulko.com> wrote:\n>> On Sat, Sep 16, 2017 at 05:14:31PM +0530, Lokesh Vutla wrote:\n>>> Commit 2c77c0d6524eb (\"xyz-modem: Change getc timeout loop waiting\")\n>>> fixes the loop delay when using a hw watchdog. But assuming that Watchdog\n>>> kicking is taken care of by getc(). This is not true in case of DM_SERIAL.\n>>> So, kick the watchdog before loop waiting, instead of relying on other\n>>> functions.\n>>>\n>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>\n>>> ---\n>>> - This fixes UART boot on AM335x-evm.\n>>>\n>>>  common/xyzModem.c | 2 ++\n>>>  1 file changed, 2 insertions(+)\n>>>\n>>> diff --git a/common/xyzModem.c b/common/xyzModem.c\n>>> index a0c5dfeece..8c4679473f 100644\n>>> --- a/common/xyzModem.c\n>>> +++ b/common/xyzModem.c\n>>> @@ -26,6 +26,7 @@\n>>>  #include <xyzModem.h>\n>>>  #include <stdarg.h>\n>>>  #include <crc.h>\n>>> +#include <watchdog.h>\n>>>\n>>>  /* Assumption - run xyzModem protocol over the console port */\n>>>\n>>> @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)\n>>>  {\n>>>\n>>>    ulong now = get_timer(0);\n>>> +  WATCHDOG_RESET();\n>>>    while (!tstc ())\n>>>      {\n>>>        if (get_timer(now) > xyzModem_CHAR_TIMEOUT)\n>>\n>> My worry is that other places also assume watchdog petted by getc().\n>> Simon, is there a reason DM_SERIAL isn't doing what was done before?\n>> Thanks!\n> \n> This should really be fixed at source. Is the problems in\n> _serial_tstc()? The watchdog is reset with _serial_getc().\n\nSorry, my bad. WATCHDOG_RESET() is being called in __serial_getc() when\nerr is -EAGAIN. But looks like it is never hitting this case. This way\nymodem fails as watchdog gets reset when downloading large files.\n\nThanks and regards,\nLokesh\n\n> \n> Regards,\n> Simon\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ti.com header.i=@ti.com header.b=\"ggq0aCQv\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvy1k2TZjz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 15:12:24 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 8C1A6C21E2F; Sun, 17 Sep 2017 05:12:15 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id CDEFEC21C62;\n\tSun, 17 Sep 2017 05:12:12 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 8DCD5C21C62; Sun, 17 Sep 2017 05:12:11 +0000 (UTC)","from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17])\n\tby lists.denx.de (Postfix) with ESMTPS id 4496EC21C39\n\tfor <u-boot@lists.denx.de>; Sun, 17 Sep 2017 05:12:10 +0000 (UTC)","from dlelxv90.itg.ti.com ([172.17.2.17])\n\tby fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v8H5C617032559; \n\tSun, 17 Sep 2017 00:12:06 -0500","from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23])\n\tby dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8H5C6Md031154; \n\tSun, 17 Sep 2017 00:12:06 -0500","from DFLE109.ent.ti.com (10.64.6.30) by DFLE102.ent.ti.com\n\t(10.64.6.23) with Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34;\n\tSun, 17 Sep 2017 00:12:06 -0500","from dflp33.itg.ti.com (10.64.6.16) by DFLE109.ent.ti.com\n\t(10.64.6.30) with Microsoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend\n\tTransport; Sun, 17 Sep 2017 00:12:06 -0500","from [172.22.216.213] (ileax41-snat.itg.ti.com [10.172.224.153])\n\tby dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8H5C43s015254;\n\tSun, 17 Sep 2017 00:12:05 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com;\n\ts=ti-com-17Q1; t=1505625126;\n\tbh=nd1RCJMdApI6dzbvGwR1v8KR2ucuPLdUmhtGY8Sc6oc=;\n\th=Subject:To:CC:References:From:Date:In-Reply-To;\n\tb=ggq0aCQvnvBKvrn6fnIyQZf2fmKMrBsHcR/4xfxuqsNR3qu+HtJAYPaYR38bx8xpQ\n\tsnzKoKtayNS8Vma2l/C/mKxON4OxTYYuAXS9XmsrrCcqgn7dcOQDNQnVfXSSXEUiio\n\tn27lfk0R1PxDdqk8Mo6OfGq8lbFTXRhKxlOrlZfE=","To":"Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>","References":"<20170916114431.23412-1-lokeshvutla@ti.com>\n\t<20170916134312.GD4560@bill-the-cat>\n\t<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>","From":"Lokesh Vutla <lokeshvutla@ti.com>","Message-ID":"<afb2cde0-a698-e1a0-401f-bb8dd5fbe139@ti.com>","Date":"Sun, 17 Sep 2017 10:42:03 +0530","User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>","Content-Language":"en-GB","X-EXCLAIMER-MD-CONFIG":"e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180","Cc":"Tero Kristo <t-kristo@ti.com>, U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1774389,"web_url":"http://patchwork.ozlabs.org/comment/1774389/","msgid":"<CAPnjgZ0-eKWsDvXmpYPRbe=tA+BG7YuBcNeAuS2uYUStyNrkxA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-25T02:15:26","subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi,\n\nOn 16 September 2017 at 23:12, Lokesh Vutla <lokeshvutla@ti.com> wrote:\n> Simon,\n>\n> On 9/16/2017 9:43 PM, Simon Glass wrote:\n>> Hi,\n>>\n>> On 16 September 2017 at 07:43, Tom Rini <trini@konsulko.com> wrote:\n>>> On Sat, Sep 16, 2017 at 05:14:31PM +0530, Lokesh Vutla wrote:\n>>>> Commit 2c77c0d6524eb (\"xyz-modem: Change getc timeout loop waiting\")\n>>>> fixes the loop delay when using a hw watchdog. But assuming that Watchdog\n>>>> kicking is taken care of by getc(). This is not true in case of DM_SERIAL.\n>>>> So, kick the watchdog before loop waiting, instead of relying on other\n>>>> functions.\n>>>>\n>>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>\n>>>> ---\n>>>> - This fixes UART boot on AM335x-evm.\n>>>>\n>>>>  common/xyzModem.c | 2 ++\n>>>>  1 file changed, 2 insertions(+)\n>>>>\n>>>> diff --git a/common/xyzModem.c b/common/xyzModem.c\n>>>> index a0c5dfeece..8c4679473f 100644\n>>>> --- a/common/xyzModem.c\n>>>> +++ b/common/xyzModem.c\n>>>> @@ -26,6 +26,7 @@\n>>>>  #include <xyzModem.h>\n>>>>  #include <stdarg.h>\n>>>>  #include <crc.h>\n>>>> +#include <watchdog.h>\n>>>>\n>>>>  /* Assumption - run xyzModem protocol over the console port */\n>>>>\n>>>> @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)\n>>>>  {\n>>>>\n>>>>    ulong now = get_timer(0);\n>>>> +  WATCHDOG_RESET();\n>>>>    while (!tstc ())\n>>>>      {\n>>>>        if (get_timer(now) > xyzModem_CHAR_TIMEOUT)\n>>>\n>>> My worry is that other places also assume watchdog petted by getc().\n>>> Simon, is there a reason DM_SERIAL isn't doing what was done before?\n>>> Thanks!\n>>\n>> This should really be fixed at source. Is the problems in\n>> _serial_tstc()? The watchdog is reset with _serial_getc().\n>\n> Sorry, my bad. WATCHDOG_RESET() is being called in __serial_getc() when\n> err is -EAGAIN. But looks like it is never hitting this case. This way\n> ymodem fails as watchdog gets reset when downloading large files.\n\nSo every time we read a character there is one available? How can that\nhappen? Surely the CPU can run faster than the serial port?\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"Hmts9mif\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"XcKTN9el\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0pS81Mnyz9t30\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 12:48:40 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid EC853C221CC; Mon, 25 Sep 2017 02:34:15 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E199EC221F8;\n\tMon, 25 Sep 2017 02:32:12 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 44860C221F9; Mon, 25 Sep 2017 02:15:53 +0000 (UTC)","from mail-qt0-f176.google.com (mail-qt0-f176.google.com\n\t[209.85.216.176])\n\tby lists.denx.de (Postfix) with ESMTPS id 8A37BC22184\n\tfor <u-boot@lists.denx.de>; Mon, 25 Sep 2017 02:15:48 +0000 (UTC)","by mail-qt0-f176.google.com with SMTP id i13so5530752qtc.11\n\tfor <u-boot@lists.denx.de>; Sun, 24 Sep 2017 19:15:48 -0700 (PDT)","by 10.200.37.200 with HTTP; Sun, 24 Sep 2017 19:15:26 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=nwOqPRinnIC1rceIvFhvEJv6cl8fwBdsly88Bhw3kH8=;\n\tb=Hmts9mifWPzQ+NVIIJ8t5zI9kcXflkzHMJoKqcV2rN/SqON0vLuUxeGUndhk1sKgEC\n\tvddDy4vmdrfonIVBtLUAobYWGBKfi+BV0wDT/PSrrBy7XXeciRL6W2NJ5KPScmlzNaaI\n\tvw7GFS08ufxYsr4ApCjWTq29OJrEddaBB0w5C21ShIOnoX5UoTN5aZROkXeil3cuPCA7\n\tR4zMU4OE/QH012PHhY5Q7yx2OnFkuh9FJQxNVzzsA+SxWaon6JL9bao3Ll5T8L+5JbE7\n\tVYlR2KZj22W7tUVR7YikZFXFq4g0ONd7ahAOIIoLiQ3kGpLdT5X+ol25X1JxqKCub1kR\n\tc4fA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=nwOqPRinnIC1rceIvFhvEJv6cl8fwBdsly88Bhw3kH8=;\n\tb=XcKTN9eltrgvrlk3HWkfayUU/cX1OTVaiOVi+lS23hnY9mrErCFIk8N8dhKGW0VCwt\n\t8hRl4TkUiCb7G3DBQk/vyTqNrZnQ8uEybuzXjXDBpLq6VhXDvHCAdisRr5aNwPzDDR/Y\n\t5qVrgjV0aGGJYYfttyQTmPa04Xoo2XiPJX56g="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=nwOqPRinnIC1rceIvFhvEJv6cl8fwBdsly88Bhw3kH8=;\n\tb=CrHsHntY0A/iQ5beRkQF8bnHJlXWxbFNvhhMZ6MpuFDI4c1m1dTrxVqsI4gtbVTc0V\n\toM46oO83qsru98/sBa/VMI0L8zXB8D7Z8durvix6J9IUYnWjANPngJHgG4zJSYyJQpR1\n\t0fPpGlFNHQazH+pNahnDU2CWn8Q5+Xll/f4zbpyNfvcyxwPbZgmRDv0bROrcBN2Ry5fS\n\tWilWPQQ0Dko1N7uGnW5uP5CZYD9Ynaj1nYa9J992wuSkql4Rcw4xeNu2o21Bl/nryaFR\n\tKJHTPgkLvJM7JI9WWCEtyrc7kYuyZE0f/VZLPnzxdY0t3FnSicZZf4iElfwgoUc/nmoq\n\tJvoA==","X-Gm-Message-State":"AHPjjUgRcrAN+ekZ8gf5d65BiXygi24tPW5lPAF28XHYxQZa3bJSVjoG\n\tJHLAeINU2bDgitEYYkEjLuevT2FToStwNQao+aFcow==","X-Google-Smtp-Source":"AOwi7QBjAlv4dI0ZNBPHDHK1JhL51PPH7dF19JKcmKel0SA9bwf+Z95O3yweLLkp07fMwICvVWPoN4iDmgTtbpaoLrQ=","X-Received":"by 10.237.33.33 with SMTP id 30mr8690314qtc.138.1506305747198;\n\tSun, 24 Sep 2017 19:15:47 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<afb2cde0-a698-e1a0-401f-bb8dd5fbe139@ti.com>","References":"<20170916114431.23412-1-lokeshvutla@ti.com>\n\t<20170916134312.GD4560@bill-the-cat>\n\t<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>\n\t<afb2cde0-a698-e1a0-401f-bb8dd5fbe139@ti.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Sun, 24 Sep 2017 22:15:26 -0400","X-Google-Sender-Auth":"zuafcOVk6FwMJLwAU8KBgzDbwsk","Message-ID":"<CAPnjgZ0-eKWsDvXmpYPRbe=tA+BG7YuBcNeAuS2uYUStyNrkxA@mail.gmail.com>","To":"Lokesh Vutla <lokeshvutla@ti.com>","Cc":"Tero Kristo <t-kristo@ti.com>, Tom Rini <trini@konsulko.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1776056,"web_url":"http://patchwork.ozlabs.org/comment/1776056/","msgid":"<639dc7c9-c65b-43a3-a82b-9fe55e834ad6@ti.com>","list_archive_url":null,"date":"2017-09-27T06:27:48","subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","submitter":{"id":14145,"url":"http://patchwork.ozlabs.org/api/people/14145/","name":"Lokesh Vutla","email":"lokeshvutla@ti.com"},"content":"On Monday 25 September 2017 07:45 AM, Simon Glass wrote:\n> Hi,\n> \n> On 16 September 2017 at 23:12, Lokesh Vutla <lokeshvutla@ti.com> wrote:\n>> Simon,\n>>\n>> On 9/16/2017 9:43 PM, Simon Glass wrote:\n>>> Hi,\n>>>\n>>> On 16 September 2017 at 07:43, Tom Rini <trini@konsulko.com> wrote:\n>>>> On Sat, Sep 16, 2017 at 05:14:31PM +0530, Lokesh Vutla wrote:\n>>>>> Commit 2c77c0d6524eb (\"xyz-modem: Change getc timeout loop waiting\")\n>>>>> fixes the loop delay when using a hw watchdog. But assuming that Watchdog\n>>>>> kicking is taken care of by getc(). This is not true in case of DM_SERIAL.\n>>>>> So, kick the watchdog before loop waiting, instead of relying on other\n>>>>> functions.\n>>>>>\n>>>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>\n>>>>> ---\n>>>>> - This fixes UART boot on AM335x-evm.\n>>>>>\n>>>>>  common/xyzModem.c | 2 ++\n>>>>>  1 file changed, 2 insertions(+)\n>>>>>\n>>>>> diff --git a/common/xyzModem.c b/common/xyzModem.c\n>>>>> index a0c5dfeece..8c4679473f 100644\n>>>>> --- a/common/xyzModem.c\n>>>>> +++ b/common/xyzModem.c\n>>>>> @@ -26,6 +26,7 @@\n>>>>>  #include <xyzModem.h>\n>>>>>  #include <stdarg.h>\n>>>>>  #include <crc.h>\n>>>>> +#include <watchdog.h>\n>>>>>\n>>>>>  /* Assumption - run xyzModem protocol over the console port */\n>>>>>\n>>>>> @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)\n>>>>>  {\n>>>>>\n>>>>>    ulong now = get_timer(0);\n>>>>> +  WATCHDOG_RESET();\n>>>>>    while (!tstc ())\n>>>>>      {\n>>>>>        if (get_timer(now) > xyzModem_CHAR_TIMEOUT)\n>>>>\n>>>> My worry is that other places also assume watchdog petted by getc().\n>>>> Simon, is there a reason DM_SERIAL isn't doing what was done before?\n>>>> Thanks!\n>>>\n>>> This should really be fixed at source. Is the problems in\n>>> _serial_tstc()? The watchdog is reset with _serial_getc().\n>>\n>> Sorry, my bad. WATCHDOG_RESET() is being called in __serial_getc() when\n>> err is -EAGAIN. But looks like it is never hitting this case. This way\n>> ymodem fails as watchdog gets reset when downloading large files.\n> \n> So every time we read a character there is one available? How can that\n> happen? Surely the CPU can run faster than the serial port?\n\nFor a quick experiment, I added a infinite while loop[1] instead of\n-EAGAIN. I never hit this case when downloading with ymodem. File\ndownloaded successfully with $patch even with the infinite while loop.\nAm I missing something?\n\n[1] http://pastebin.ubuntu.com/25625299/\n\nThanks and regards,\nLokesh","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ti.com header.i=@ti.com header.b=\"r90xkUBo\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y27LT2zGpz9sRm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 16:33:20 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid CA56CC21DEF; Wed, 27 Sep 2017 06:33:10 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id EF0D9C21C45;\n\tWed, 27 Sep 2017 06:33:07 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 64513C21C45; Wed, 27 Sep 2017 06:33:06 +0000 (UTC)","from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16])\n\tby lists.denx.de (Postfix) with ESMTPS id 2601CC21C40\n\tfor <u-boot@lists.denx.de>; Wed, 27 Sep 2017 06:33:03 +0000 (UTC)","from dflxv15.itg.ti.com ([128.247.5.124])\n\tby fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v8R6WPhU005547; \n\tWed, 27 Sep 2017 01:32:25 -0500","from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21])\n\tby dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8R6WJEe012639;\n\tWed, 27 Sep 2017 01:32:20 -0500","from DFLE104.ent.ti.com (10.64.6.25) by DFLE100.ent.ti.com\n\t(10.64.6.21) with Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34;\n\tWed, 27 Sep 2017 01:32:19 -0500","from dflp33.itg.ti.com (10.64.6.16) by DFLE104.ent.ti.com\n\t(10.64.6.25) with Microsoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend\n\tTransport; Wed, 27 Sep 2017 01:32:19 -0500","from [172.24.190.69] (ileax41-snat.itg.ti.com [10.172.224.153])\n\tby dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8R6WHHk029352;\n\tWed, 27 Sep 2017 01:32:18 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com;\n\ts=ti-com-17Q1; t=1506493945;\n\tbh=miSj/oCdrCXgzWzxdzLWZoWSRTujb4JYzx7tyLw7nLA=;\n\th=Subject:To:CC:References:From:Date:In-Reply-To;\n\tb=r90xkUBoS30YrXm0koHnI55FPok8D9WDAZaBctTGaqJSzbjn+7SGvt2eQUPRlhIPz\n\tMAZ1KJFX96GwV5i7jS7Plzv347PoCO/Rqiql40nOOjviBmAzH5WJzzSWEvx+5AbSTN\n\t0z/Jh2hrk399M921KARZkWo4f7/rqhhrZTPCnxwo=","To":"Simon Glass <sjg@chromium.org>","References":"<20170916114431.23412-1-lokeshvutla@ti.com>\n\t<20170916134312.GD4560@bill-the-cat>\n\t<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>\n\t<afb2cde0-a698-e1a0-401f-bb8dd5fbe139@ti.com>\n\t<CAPnjgZ0-eKWsDvXmpYPRbe=tA+BG7YuBcNeAuS2uYUStyNrkxA@mail.gmail.com>","From":"Lokesh Vutla <lokeshvutla@ti.com>","Message-ID":"<639dc7c9-c65b-43a3-a82b-9fe55e834ad6@ti.com>","Date":"Wed, 27 Sep 2017 11:57:48 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<CAPnjgZ0-eKWsDvXmpYPRbe=tA+BG7YuBcNeAuS2uYUStyNrkxA@mail.gmail.com>","Content-Language":"en-US","X-EXCLAIMER-MD-CONFIG":"e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180","Cc":"Tero Kristo <t-kristo@ti.com>, Tom Rini <trini@konsulko.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1782488,"web_url":"http://patchwork.ozlabs.org/comment/1782488/","msgid":"<CAPnjgZ0XVwQCjAOCsBJLYqjHJjgNc=cjBEd3UWnhxsWU1g2Teg@mail.gmail.com>","list_archive_url":null,"date":"2017-10-09T04:47:19","subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Lokesh,\n\nOn 27 September 2017 at 00:27, Lokesh Vutla <lokeshvutla@ti.com> wrote:\n>\n>\n> On Monday 25 September 2017 07:45 AM, Simon Glass wrote:\n>> Hi,\n>>\n>> On 16 September 2017 at 23:12, Lokesh Vutla <lokeshvutla@ti.com> wrote:\n>>> Simon,\n>>>\n>>> On 9/16/2017 9:43 PM, Simon Glass wrote:\n>>>> Hi,\n>>>>\n>>>> On 16 September 2017 at 07:43, Tom Rini <trini@konsulko.com> wrote:\n>>>>> On Sat, Sep 16, 2017 at 05:14:31PM +0530, Lokesh Vutla wrote:\n>>>>>> Commit 2c77c0d6524eb (\"xyz-modem: Change getc timeout loop waiting\")\n>>>>>> fixes the loop delay when using a hw watchdog. But assuming that Watchdog\n>>>>>> kicking is taken care of by getc(). This is not true in case of DM_SERIAL.\n>>>>>> So, kick the watchdog before loop waiting, instead of relying on other\n>>>>>> functions.\n>>>>>>\n>>>>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>\n>>>>>> ---\n>>>>>> - This fixes UART boot on AM335x-evm.\n>>>>>>\n>>>>>>  common/xyzModem.c | 2 ++\n>>>>>>  1 file changed, 2 insertions(+)\n>>>>>>\n>>>>>> diff --git a/common/xyzModem.c b/common/xyzModem.c\n>>>>>> index a0c5dfeece..8c4679473f 100644\n>>>>>> --- a/common/xyzModem.c\n>>>>>> +++ b/common/xyzModem.c\n>>>>>> @@ -26,6 +26,7 @@\n>>>>>>  #include <xyzModem.h>\n>>>>>>  #include <stdarg.h>\n>>>>>>  #include <crc.h>\n>>>>>> +#include <watchdog.h>\n>>>>>>\n>>>>>>  /* Assumption - run xyzModem protocol over the console port */\n>>>>>>\n>>>>>> @@ -64,6 +65,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)\n>>>>>>  {\n>>>>>>\n>>>>>>    ulong now = get_timer(0);\n>>>>>> +  WATCHDOG_RESET();\n>>>>>>    while (!tstc ())\n>>>>>>      {\n>>>>>>        if (get_timer(now) > xyzModem_CHAR_TIMEOUT)\n>>>>>\n>>>>> My worry is that other places also assume watchdog petted by getc().\n>>>>> Simon, is there a reason DM_SERIAL isn't doing what was done before?\n>>>>> Thanks!\n>>>>\n>>>> This should really be fixed at source. Is the problems in\n>>>> _serial_tstc()? The watchdog is reset with _serial_getc().\n>>>\n>>> Sorry, my bad. WATCHDOG_RESET() is being called in __serial_getc() when\n>>> err is -EAGAIN. But looks like it is never hitting this case. This way\n>>> ymodem fails as watchdog gets reset when downloading large files.\n>>\n>> So every time we read a character there is one available? How can that\n>> happen? Surely the CPU can run faster than the serial port?\n>\n> For a quick experiment, I added a infinite while loop[1] instead of\n> -EAGAIN. I never hit this case when downloading with ymodem. File\n> downloaded successfully with $patch even with the infinite while loop.\n> Am I missing something?\n>\n> [1] http://pastebin.ubuntu.com/25625299/\n\nWell it is very strange. I cannot imagine that a serial line could\nkeep up with the CPU requesting bytes. I think this needs more\ninvestigation.\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"XdWrA8GX\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"enUwj2Uu\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y9T7c4xl6z9tXx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  9 Oct 2017 16:19:24 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 62252C21E35; Mon,  9 Oct 2017 05:06:57 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 205FCC21DB9;\n\tMon,  9 Oct 2017 05:06:52 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 6EA2EC21D19; Mon,  9 Oct 2017 04:47:44 +0000 (UTC)","from mail-qk0-f177.google.com (mail-qk0-f177.google.com\n\t[209.85.220.177])\n\tby lists.denx.de (Postfix) with ESMTPS id 3529FC21DDA\n\tfor <u-boot@lists.denx.de>; Mon,  9 Oct 2017 04:47:41 +0000 (UTC)","by mail-qk0-f177.google.com with SMTP id x82so12631201qkb.12\n\tfor <u-boot@lists.denx.de>; Sun, 08 Oct 2017 21:47:41 -0700 (PDT)","by 10.200.63.170 with HTTP; Sun, 8 Oct 2017 21:47:19 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=BvTlxyzQn53JGOJGkzaFKdehwFOOYXCmK29Sewr0qcw=;\n\tb=XdWrA8GX+N6GoI7jEbcuHe48p8i/zXCWRhrh7yxWRLdlpNq/XDguX/w4CNb9qtA7Qx\n\tCqO5HtQw5h0mLTJMt0jRl8WW6eNb5pKIf18ed81UpaxmAIgvk8V475IuaC+MZj7Mw/Vn\n\tHiCAhC90ukfQcMwT7yyQsUE/8T04WbY0bIpurnULkXgCbine18mCFAnDlRGZ+7niiIfZ\n\tPYfZZ6hKZUxGVR+NOKyhkLreKKous7K/Afdw4h+kTghgUdJuXxrTi/xz0xxDw/WjZKxm\n\trJOXsjwqSrmhhF3MhYHeJ0ToMugnvB4Dv2ICb2Utj48HlMjoG3zQYErsBD9EHF05AoIK\n\tMjbQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=BvTlxyzQn53JGOJGkzaFKdehwFOOYXCmK29Sewr0qcw=;\n\tb=enUwj2UuLFobZ0fGJTTyhsTZuzLzsAKnyCdUYPrNlpB4w7hMWMcVbaC+10np0Dh27C\n\tMHvV1kqgFjmi/ck+7jihj5feRtgpyt9+0sZWjI1dAXy+yll0obQYg3HloCzetPiehdiZ\n\tqPNdQCYYNT2g8OjTwKXnxufdmptOYvzasXGio="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=BvTlxyzQn53JGOJGkzaFKdehwFOOYXCmK29Sewr0qcw=;\n\tb=A7HppH+uKjSNuECI3eN5iRDmQa2yRvaMX3qsZoxgRGnljzSU3XQljfDyQUpp7Y/9YY\n\tDxUz7jupEZAhcpsXaTuKGaD3fTjWgHJsnK46UyAWVqu2hYuWupE+iit6bVqexSL4DQUx\n\tcR3h1UTMYX5NNMrg1pUv9uL1JiSyDg48xqlXRQPwwwFFHMpW9/43Qe2m2wcdQVydg/Mq\n\txmWjcGRG9nyAUjatFwls/Ad3l4eTejw3Xkwm7e+OoU06aGb3YXqE9Ze/MboPE0TvBtaT\n\tyA/Jg+Qjm3pYw5IHuBzSpSxPg+U0uRs61N+pQyg3z7HeJ4SZWzv9LMPFeaqpRXO7oSFD\n\totpg==","X-Gm-Message-State":"AMCzsaWL5SpJ6T3XpNjxJ1XMwcyd4HnZ0MYmB6eXOfYVSlju3PrFFEEE\n\tflOUnxg4Nye8d7Nh1mEp8aqYL+G9xK6gjN0yvgncTPOT","X-Google-Smtp-Source":"AOwi7QChawYkh2R6kv+6k/p/+NdfE6p3muVQX4AY7npGUaCi4M2jKdkEfh0OeA0db1P5oimhhjoV6+cPXX+8QqG7gfQ=","X-Received":"by 10.55.212.219 with SMTP id s88mr7813046qks.188.1507524459938; \n\tSun, 08 Oct 2017 21:47:39 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<639dc7c9-c65b-43a3-a82b-9fe55e834ad6@ti.com>","References":"<20170916114431.23412-1-lokeshvutla@ti.com>\n\t<20170916134312.GD4560@bill-the-cat>\n\t<CAPnjgZ2GD3zUccBsLm_0NZkLZJkXX0CAJWdsnqZ_Fg3u55VR8Q@mail.gmail.com>\n\t<afb2cde0-a698-e1a0-401f-bb8dd5fbe139@ti.com>\n\t<CAPnjgZ0-eKWsDvXmpYPRbe=tA+BG7YuBcNeAuS2uYUStyNrkxA@mail.gmail.com>\n\t<639dc7c9-c65b-43a3-a82b-9fe55e834ad6@ti.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Sun, 8 Oct 2017 22:47:19 -0600","X-Google-Sender-Auth":"XqrsmoDcA7Rg4TdheifLVTuYPvA","Message-ID":"<CAPnjgZ0XVwQCjAOCsBJLYqjHJjgNc=cjBEd3UWnhxsWU1g2Teg@mail.gmail.com>","To":"Lokesh Vutla <lokeshvutla@ti.com>","Cc":"Tero Kristo <t-kristo@ti.com>, Tom Rini <trini@konsulko.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] xyz-modem: Fix timeout loop waiting with\n\tWATCHDOG","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]