From patchwork Thu May 24 04:29:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136697 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1711193lji; Wed, 23 May 2018 21:29:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEx9o107ElsOCTbaj+/gxUviO2KkPIW4YyJputp36MNtcpDLoEQoR1zhon0vgTmzp1c/Rz X-Received: by 2002:a50:8fa5:: with SMTP id y34-v6mr10168633edy.290.1527136191145; Wed, 23 May 2018 21:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527136191; cv=none; d=google.com; s=arc-20160816; b=Segbscq/JYD8wJ0AjbfRMqEVo1V96ZLRYaRVsu6aNBVLBLMizt/AXFJ+6HB1KjkMIC V1rI82ifAGZ4XP1AIb7yDxTHJYTWiS5jLbEEGg92nd00a/GBAEN+AMlrIDy/297iUBTB dfYx4T5ITwmFZLsp+/4GlYN2V4LPpuTkXr02vm4igx5wlk2MXcdxO7hm0UNg5fuCWizN E7xyOZmFdilrSwsMqOyoBMeMDOUIYTo0Y1AQ6HL8Maqowy7W2B+2uMeY5seVyCGDE0AW vMnmUMJdPYiuz6KZ5njdTljtsEpZ4sBuBhj+6e4x128ksYHBH1gu/Vi9pCsyjcuQRy3i ikwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=Y8PNKz+xs+4dRPwFu6/Yx6J3jruKlLqTjL7mtXYeh1U=; b=Jag3+kRpGxOJg+urLDaPnmWHY/F5tJrhn0vAv2lPd5ihi/JgbBHPyFbGwRNrzPoL4K zvCmNcVwrHxEVwPZ4gBEDSIN0hr8Gzsh5Q8ygek7OStJQ0jEoe6MNbqmEN1VDhb0fneh uY7jRSBwfEpD1HhtqcJD6Ka9xApwRphycAmV/fSIswUJPCr2HhNK/v19VdOZWBn3BvGA FDx7dYNZAS0jfprtte9XPABDZn839dKk46z6E8YznftCvQz3PqnJvmNm3bJ5T9DpRoZu 4+IqVGccNXKJCRXkYEniXBckxvsFA7c9wgDUQELq4qjALXa62IQqHnB+6ualb69aHyZ8 f4lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=eKtGI0zy; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id a16-v6si3181463edd.116.2018.05.23.21.29.50; Wed, 23 May 2018 21:29:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=eKtGI0zy; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 0A475C21C29; Thu, 24 May 2018 04:29:48 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D033EC21C29; Thu, 24 May 2018 04:29:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 08064C21C29; Thu, 24 May 2018 04:29:44 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id 03769C21BE5 for ; Thu, 24 May 2018 04:29:43 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w4O4TARZ001467; Thu, 24 May 2018 13:29:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w4O4TARZ001467 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527136150; bh=HIeLdXml4SQ7rE4Go3u8luu3EdHSgDlEGGse1rnJcio=; h=From:To:Cc:Subject:Date:From; b=eKtGI0zyXAvVGhrT9pTAqpP7Qw3wip7GHZU3+LH+0BfBytpnrVAwroBw0qWMTSYpe sZPhzWqMbUmEjJmyUyHrbQFSLPlu4QcFTXINp0/LWrTXjNDtjMgXyZrtGQMybpwho1 715wcDPzlpV4tdtJrMirvwP3GI33HHDuY8EXm71MHi1b9p82P4pLSAUU+8i8E9j5ei JeDF8NJ04TZRcI+wJwnY6IQJ417PjxPvBevVjiS7BVYuyOi0/eVW7imiLyV3Q0WJi7 Qwh/bDWolIk+4H0T4mP2YV9pygmHe7GiBKZRVH1XGj0oo9pUNPjHqU1KJW5Rcyapi5 L+plWaI3sSKZQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 24 May 2018 13:29:06 +0900 Message-Id: <1527136146-12665-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Alexander Graf , Tom Rini Subject: [U-Boot] [PATCH] menu: fix timeout duration X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" menu_interactive_choice() divides the timeout value by 10 before passing it to cli_readline_into_buffer(). For distro-boot, the "timeout" variable in the boot script should specify the time in _seconds_ to wait for keyboard input before booting the default menu entry. Due to the division, "timeout 50" actually wait for only 5 seconds instead of 50. What is worse, "timeout 5" never breaks because "m->timeout / 10" is zero, which means no timeout. For CONFIG_MENU_SHOW case, menu_show() should also take the timeout value in seconds because its default comes from CONFIG_BOOTDELAY. The "division by 10" was introduced by commit 8594753ba0a7 ("menu: only timeout when menu is displayed"). Its log claimed "fixed", but to me, it rather looks the root cause of the problem. Signed-off-by: Masahiro Yamada --- Rob, I know commit 8594753ba0a7 is already 6 years ago. If you remember something about "/ 10", please comment. common/menu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/menu.c b/common/menu.c index bf2b471..bf23194 100644 --- a/common/menu.c +++ b/common/menu.c @@ -194,8 +194,7 @@ static inline int menu_interactive_choice(struct menu *m, void **choice) if (!m->item_choice) { readret = cli_readline_into_buffer("Enter choice: ", - cbuf, - m->timeout / 10); + cbuf, timeout); if (readret >= 0) { choice_item = menu_item_by_key(m, cbuf);