From patchwork Fri Nov 29 14:47:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 846143 Delivered-To: patch@linaro.org Received: by 2002:adf:f2c4:0:b0:382:43a8:7b94 with SMTP id d4csp916927wrp; Fri, 29 Nov 2024 06:47:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU/9kig8xKW87CL7IxrZL3zJ06s32FF67CPDNS9nE3n/bPnL7VOAHy2I2N9s53slKw0vcgC6w==@linaro.org X-Google-Smtp-Source: AGHT+IG4M4Oi50OIjN393dD/gh1JuFOny5gj1W+KZoVjMGzU8j6OxYWmLTtcaZ0Yiw6ek2F6cAJ5 X-Received: by 2002:a05:6512:224e:b0:53d:e7b6:c708 with SMTP id 2adb3069b0e04-53df0106999mr7048530e87.46.1732891673398; Fri, 29 Nov 2024 06:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732891673; cv=none; d=google.com; s=arc-20240605; b=Gd2/PShHuDlY5UGTTwz3kMURDramVuoJ34lk+udFxdMhDItmwHYtmxnoA92Sym7plB 2PJygHrVszFMyhv4mDaoNk/SubiTwmFnLm4mCIiHYCHDQUuLoMRbBdpMCOkIQLgrqGRr vE1r7T5GkBJFlVcbTad/qiN7osoPvnORr8d83OXckEC/x/LBkJ2xQ3pWRWxHZuW5EC/S M08zuHsSRgZVII3wVUxtA0YvJkjrCB7vJsmHZdemz5TdEA8upYNK3E2/zwQ8hqINaa41 1EnNsulPSSL7Yw4aOYYNDNUyulfPse8565rlq+2TtuCqtkK3fmAMRhSIn7l5t0v000rk gwMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=JVdDTznftY0MFtNMazEI8OUGmsYrwC3NO7GV6GFWTDo=; fh=QKgjaM7l8n38oEgIh5W9Q9OHn9+RlW8hyj30hQr7NYc=; b=DzjTJPkdcGGbPsQRmzSsj6SVSjgrhvYBp2JRe5oDrDbYJGh4KswBH/2RCYgiRK+ybw jn4grrmEzt2fM96aResl6KXE2VYOLb3MxxJcdqCVBl9lzuDfAxqcPJ0YHxLZc27rmAd5 EwnyM3NuFQN+IgSQqA06M1VMEt0AS+Sdp9ly0r0ASdI5nYt0YslR1Q5+lX7udYY6hMEf FJ5D6VopgYhQ0HwxLEtq8v0O0g5GmldI793+mO2UZXv0HsJBcOMRHSY3v9QTxrwciOXl Kf7wcSKMcxqtPb6Xz7EFaqfbAqhD3fLZ+WI2K2EEcyMz/rts3gJUohdubmpTDkWD9fVd p2wA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kSt4Gqr3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-aa5999bf5cfsi260041566b.943.2024.11.29.06.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 06:47:53 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kSt4Gqr3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3730F8932A; Fri, 29 Nov 2024 15:47:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="kSt4Gqr3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44C2C89021; Fri, 29 Nov 2024 15:47:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2296C893D0 for ; Fri, 29 Nov 2024 15:47:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385e1721716so114298f8f.3 for ; Fri, 29 Nov 2024 06:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732891668; x=1733496468; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JVdDTznftY0MFtNMazEI8OUGmsYrwC3NO7GV6GFWTDo=; b=kSt4Gqr3S0eABXqP552RfB4Ot/TR90ju/gjn/pTVz+Q63/LbnmZlmX3OGnENxWGRnB c8d3sNpH5/JBXt3aU9fRzMXE6CmC8n0iNHywmucSpu1bCDkZKqdcRNU3CxbUGB69FA/M phpV6kDXwZvZ5QEsBJpIk6UEEhycO7vMOWv+5gYXlWmfm5VQyC/CGbHltguiFt/lWhSo Wi82/305xPTmp18Gc9AzadixFCIJTJUVdISwWV0CeZ8yCiw0gVtCe0hYbwaNFbiXPV1e o8OmKwWmKzQlkqAs/nydAcJbZ0Ua9T5fl6oZCviI3hLk5MOajd64qexQBfld8hemlnG6 ElBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732891668; x=1733496468; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JVdDTznftY0MFtNMazEI8OUGmsYrwC3NO7GV6GFWTDo=; b=aj7UqdrPSFxApg7S48PwH/m/QU+kkFgE3Fc5p6dgjFLpzy57o6iLyRpVi8vcSyzg52 8NknP+0OCfoyjUsq+H3IwN3rwxk+JFDN9Kbnto9xfMYUAcNrtupS/lbfQkBMU5BghX3X 3pPV4gmEBO9hFBjHA7k+lITO/EqLOKG3eoMArK0/hVWpMVWZlLtm2IIAqURocJSpYrWA jIoeFZ0W39vPOvCJowj1XsgpqlcEjb9hDgQoAjQGNZOQeNMbQUf13ewujXKT9m5nJ9Hc 3CWFR0oJq8Hs50ACjMOIF5MB1aXnkQ42hbe85ztjn+GquDn93RcBgKnd4x1his0O5Qaf ZsRA== X-Gm-Message-State: AOJu0Yz/TgwxbIreCFtmFlzKzfuCC/SboU3chMAGMUWIV2zjUzLl9Vav 3jZ5o/1b7Mhx1utHNLT4BekjpAy9BcZ8HZ1XncVdjw+H1ktuu9BSTaaQWsfIsxtZ/3vqN/XgYAb oxzU= X-Gm-Gg: ASbGncuLJ8ox3eS+EzhlMYrPIdHPMe6unqrB/GoJgcuI4sxFvQ2yQmc2c29csVngOsS YpJ7rHaRRTm6iUPS6HUTxD2rofNBn6JG+61GITlI4UmqE95SbRPNqJ3DUaHCCI28g40EHkwIn89 BrZ75XARjUe7/1nfT4Bqa5/WxQ4Yx1MG807Paswfj9eZecZbexv/obEs0FfUULOSwu/4dY9Vp8+ kE517cSwezy0Fnze9mOsSYweRh5Nq3fV7yVJo/O0XLSRqjxYDYXRbKh9FM= X-Received: by 2002:a5d:64e7:0:b0:381:f604:3d55 with SMTP id ffacd0b85a97d-385c6ef479dmr10389644f8f.52.1732891668376; Fri, 29 Nov 2024 06:47:48 -0800 (PST) Received: from builder.. ([2a01:e0a:3cb:7bb0:af71:dfb2:66ef:80c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2e1bdsm4760309f8f.9.2024.11.29.06.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 06:47:48 -0800 (PST) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Simon Glass , Sughosh Ganu , Ilias Apalodimas , Christian Marangi , Mikhail Kshevetskiy , AKASHI Takahiro , Marek Vasut Subject: [PATCH] net: tftpput: reset timeout_count when an ACK is received Date: Fri, 29 Nov 2024 15:47:32 +0100 Message-ID: <20241129144733.779043-1-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean timeout_count is never reset once a tftpput transfer has started. If for whatever reason timeouts occur frequently, but the server keeps replying nonetheless, the transfer may be needlessly aborted. Reset timer_count on reception of an ACK to avoid this situation. Signed-off-by: Jerome Forissier Signed-off-by: Mikhail Kshevetskiy --- net/tftp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tftp.c b/net/tftp.c index 704b20b4ff8..8d54a83d9c2 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -478,6 +478,7 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, case TFTP_ACK: #ifdef CONFIG_CMD_TFTPPUT if (tftp_put_active) { + timeout_count = 0; if (tftp_put_final_block_sent) { tftp_complete(); } else {