Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4D102C433F5 for ; Thu, 10 Mar 2022 01:46:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B88EB83A3B; Thu, 10 Mar 2022 02:45:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 30B7683A3B; Thu, 10 Mar 2022 02:44:56 +0100 (CET) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 BB5C6839CB for ; Thu, 10 Mar 2022 02:44:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qk1-f171.google.com with SMTP id 85so3314595qkm.9 for ; Wed, 09 Mar 2022 17:44:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ExiL1RvRrG9GOV1NfqAm+HGLd+uT50NVLpuwgRjC1w=; b=i6Nj/ZawRFG0zGx9QB4Zc7dCBT1VpDVfrv8Z1zdPxohystLiaUlvOmgwjGEb5MfLRQ OuGN2K+JTs3QRMarawlXxYqDDo+S+e6jZV49udW+2HCopsJCeKIqnk2S8zNVu1yXt1ij hli61JxNv7gvOblq6+tFG6m8krdZlDaEJh3yvlHy7UDPrIB+W6QID6fs/9Doxy99sboM u38i/2ozj71PHNJ1gbFTlv7i/UYXJxqs0VIgKDf9Wmn3lZOjELVChFmJszQm8jxN50TS av6pw8DzsIp/PkalAmh1csJ38DulPOlPR+6Yy/pgjGrE6t/0DY/RYX7ruMp8OwOOBuvi R+OA== X-Gm-Message-State: AOAM532xYhNcvAG7xxdP7Au/i9Ysh9OuDn0qqIMuITFrDhWA2WXgY8qV 7xbPtbj4lMRzNnGuULrhHjvcwwsJ0A== X-Google-Smtp-Source: ABdhPJwx77Vaf8CHAabaujhRAPS6MocHcDNiULlPVf0hIeraN/u3akUfPp2nfZDfrDgpl2/cdYD54w== X-Received: by 2002:a05:620a:2681:b0:67d:1aa9:8f64 with SMTP id c1-20020a05620a268100b0067d1aa98f64mr1725641qkp.240.1646876656320; Wed, 09 Mar 2022 17:44:16 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id t7-20020a05622a180700b002e0ccf0aa49sm2486328qtc.62.2022.03.09.17.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 17:44:16 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: Ramon Fried Subject: [PATCH 10/15] Convert CONFIG_NFS_TIMEOUT to Kconfig Date: Wed, 9 Mar 2022 20:43:59 -0500 Message-Id: <20220310014404.1251636-10-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220310014404.1251636-1-trini@konsulko.com> References: <20220310014404.1251636-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_NFS_TIMEOUT Cc: Ramon Fried Signed-off-by: Tom Rini --- README | 7 ------- cmd/Kconfig | 9 +++++++++ configs/kzm9g_defconfig | 1 + include/configs/kzm9g.h | 2 -- net/nfs.c | 9 ++------- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README b/README index 227eb29a8902..b8b508f8a9c1 100644 --- a/README +++ b/README @@ -1555,13 +1555,6 @@ The following options need to be configured: FLAGADM - Error Recovery: - CONFIG_NFS_TIMEOUT - - Timeout in milliseconds used in NFS protocol. - If you encounter "ERROR: Cannot umount" in nfs command, - try longer timeout such as - #define CONFIG_NFS_TIMEOUT 10000UL - Note: In the current implementation, the local variables diff --git a/cmd/Kconfig b/cmd/Kconfig index d10deed244b3..7790cf3201bd 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1638,6 +1638,15 @@ config CMD_NFS help Boot image via network using NFS protocol. +config NFS_TIMEOUT + int "Timeout in milliseconds for NFS mounts" + depends on CMD_NFS + default 2000 + help + Timeout in milliseconds used in NFS protocol. If you encounter + "ERROR: Cannot umount" in nfs command, try longer timeout such as + 10000. + config CMD_MII bool "mii" imply CMD_MDIO diff --git a/configs/kzm9g_defconfig b/configs/kzm9g_defconfig index 867673f57358..e790072e539f 100644 --- a/configs/kzm9g_defconfig +++ b/configs/kzm9g_defconfig @@ -21,6 +21,7 @@ CONFIG_CMD_IMLS=y CONFIG_CMD_I2C=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y +CONFIG_NFS_TIMEOUT=10000 CONFIG_CMD_PING=y CONFIG_CMD_FAT=y CONFIG_ENV_IS_IN_FLASH=y diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h index 022858f69282..42f881b0be9f 100644 --- a/include/configs/kzm9g.h +++ b/include/configs/kzm9g.h @@ -71,6 +71,4 @@ #define CONFIG_SH_SCIF_CLK_FREQ get_board_sys_clk() #define TMU_CLK_DIVIDER (4) /* 4 (default), 16, 64, 256 or 1024 */ -#define CONFIG_NFS_TIMEOUT 10000UL - #endif /* __KZM9G_H */ diff --git a/net/nfs.c b/net/nfs.c index 70d0e08bde92..3c01cebd96f8 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -40,11 +40,6 @@ #define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */ #define NFS_RETRY_COUNT 30 -#ifndef CONFIG_NFS_TIMEOUT -# define NFS_TIMEOUT 2000UL -#else -# define NFS_TIMEOUT CONFIG_NFS_TIMEOUT -#endif #define NFS_RPC_ERR 1 #define NFS_RPC_DROP 124 @@ -53,7 +48,7 @@ static int fs_mounted; static unsigned long rpc_id; static int nfs_offset = -1; static int nfs_len; -static ulong nfs_timeout = NFS_TIMEOUT; +static const ulong nfs_timeout = CONFIG_NFS_TIMEOUT; static char dirfh[NFS_FHSIZE]; /* NFSv2 / NFSv3 file handle of directory */ static char filefh[NFS3_FHSIZE]; /* NFSv2 / NFSv3 file handle */ @@ -733,7 +728,7 @@ static void nfs_timeout_handler(void) } else { puts("T "); net_set_timeout_handler(nfs_timeout + - NFS_TIMEOUT * nfs_timeout_count, + nfs_timeout * nfs_timeout_count, nfs_timeout_handler); nfs_send(); } -- 2.25.1