From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A0A9C433F5 for ; Fri, 10 Sep 2021 20:50:14 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01357610C9 for ; Fri, 10 Sep 2021 20:50:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 01357610C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1530F83707; Fri, 10 Sep 2021 22:49:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="b9GeRkhy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3ECC7836FE; Fri, 10 Sep 2021 22:48:52 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 230FA8371F for ; Fri, 10 Sep 2021 22:48:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F66661205; Fri, 10 Sep 2021 20:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631306893; bh=+Pm6wxh0BPhbTb2aZ187lty8pYlYvLTvGQTIw48V96o=; h=From:To:Cc:Subject:Date:From; b=b9GeRkhy0oc/KDG0TNJe4Y0viiOfMwUPx1UmOsnnGpL1WCjtMvxH4I8f5Fx5Fug7r khELkgXgkRjn1AWDePpuzr1ggNK2sY7qh3nYOwXDjgdVL0i9DkAUGYZIscqy6RrryB 7z1KkKKfH7J4IYhpDN0E1bhM08j/M3qidZ121MoGESIfQ9/OJmlnETCQMLs4Vs7zHS TsIhPr1jy5h5fW3xSYeiLfnpY8hl14qD7yctkp9bCvLqMUqhhCEpNfH+LVIujuSzrI GLxpP7t58PaKx4A61Sw8fl0zCbriomwac/lDyvwbrRcWek0mqRMKaut5bCJYo+A0+e Xm5jvW+rU2jXw== Received: by pali.im (Postfix) id E099B2828; Fri, 10 Sep 2021 22:48:10 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: [PATCH 1/2] xyz-modem: Wait infinitely for initial y-modem packet Date: Fri, 10 Sep 2021 22:46:52 +0200 Message-Id: <20210910204653.3066-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Now when command loady can be aborted / cancelled by CTRL+C, change wait timeout for initial packet to infinite. This would allow user to not be hurry when locating file which want to send. Commands loadb and loads already waits infinitely too. Signed-off-by: Pali Rohár --- common/xyzModem.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/xyzModem.c b/common/xyzModem.c index ece25acb183b..d6be489a174b 100644 --- a/common/xyzModem.c +++ b/common/xyzModem.c @@ -449,8 +449,14 @@ xyzModem_stream_open (connection_info_t * info, int *err) return 0; } - while (retries-- > 0) + while (1) { + if (--retries <= 0) + { + retries = xyzModem_MAX_RETRIES; + crc_retries = xyzModem_MAX_RETRIES_WITH_CRC; + xyz.crc_mode = true; + } stat = xyzModem_get_hdr (); if (stat == 0) { -- 2.20.1