From patchwork Fri Jan 30 03:58:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1782 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org Authentication-Results: mail.u-boot.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=e6/A7IrF; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 70316697CB for ; Thu, 29 Jan 2026 20:59:25 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 3ce9tI2qSMqo for ; Thu, 29 Jan 2026 20:59:25 -0700 (MST) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 33C17697E6 for ; Thu, 29 Jan 2026 20:59:24 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5904769738 for ; Thu, 29 Jan 2026 20:59:21 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wX64N8i0f6zL for ; Thu, 29 Jan 2026 20:59:21 -0700 (MST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.160.54; helo=mail-oa1-f54.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) by mail.u-boot.org (Postfix) with ESMTPS id 0700C697EB for ; Thu, 29 Jan 2026 20:59:19 -0700 (MST) Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-4086661715cso1232996fac.2 for ; Thu, 29 Jan 2026 19:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1769745558; x=1770350358; darn=u-boot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eW6vvfurqkh9rPe4lw48FSmesggNsBFieiy3DyAlrTw=; b=e6/A7IrFBljf3xXAvYOLSq5y1WFzjvHu1oXR5/oVMaE1L/qs+Hkv1z66T72os6n7Q6 eNecYVfhgjW+l0zccbPoKoBeuF8H1oxqfb9XkhrJhRGkhneK7puGtfsm6MPXaP1FKFHT /g9jlQWptYRJAvAGm6JK6mI5juYzb67w9Cqj4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769745558; x=1770350358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eW6vvfurqkh9rPe4lw48FSmesggNsBFieiy3DyAlrTw=; b=ohjBDiE0e73R+c2sq8CYCKyhHG5jglDKVpgEPL3CZBo5zVOi+uVQaR7TQNLKx2uIKM jqTfwHVKV0/V0aZrckqauK2L2Ck+YxAUu+7FVxOawPy4s2Vme3O+WNdlj13kJSrMrvuc seidizL863lchNsZG/EritTDI4ZJFDPJxHfvGmWSIz0EQh9xqCgoqQ6sS6qD4ILJGxlF lQEgwRXb/qvuVBbNWyOmEVrriYJL0MokngUiY7h+SiIl3QwEV8vaenOv8YNTaCXRjsPv 8aPQ4kq9mM5cjwdQKpUEBJfjwDc3sMTZxA/w/mqVE+3Avq89BinPQZRos7GrRVJcIdxR y+4Q== X-Gm-Message-State: AOJu0YzsO2FbBujw6ho5C8ipuZi831yovEJOc3RlQltoSTkXDwapLk0H YZvXgrNUK+zmeCkX6TLXwTiTvCcWjEXs0Ss3qzUXk6SjCIuGzNnm8GReqHH0rivPyKOJpHhymX1 284u2uw== X-Gm-Gg: AZuq6aL8OxrsEVcKoWE5GPFbtA+XZlTGFQa4Pc3QSSgWB3TIOQ8qDW076ydtD2KHeAP wdGNtVesz7i0L2exKo1IGdpuAsyPir7rG7FKgYZaE18zBWPCedaFhL4sepnqYZpKBaNSghMDoK2 JZU3w3N1c3OsAX447BOxezxUBDnUtWwkd0Q72lkDlnUYoGHuzA3khPoPrYh+KF3H+zrcXwjvOrO qwoiNNNTV+YsXVwf0/0SLYT3tLOrEqjepTq8oByv94M8B7zMqoFr73FAN5GYnr6089d5OH4AS75 wQHx4/6UZsuTayEUtIYVlrXcL5v7FMexSs2wOwy+AQPZWGAWoWs4OBSMKPr1KQXyZiyH/krVCCX ZDQMJkf6Rp/4gh4PLyqLLhExzapX6Z3u+igsuyR1kBJjQ0c2OhuAUi0ocozPl141XF4U86/p/n+ H/gm7WvQpNwrftFGslpqGTOJNM/Y0= X-Received: by 2002:a05:6820:1689:b0:663:b6f:c261 with SMTP id 006d021491bc7-6630f38c7fcmr820114eaf.43.1769745557784; Thu, 29 Jan 2026 19:59:17 -0800 (PST) Received: from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-662f9a4e491sm4128687eaf.16.2026.01.29.19.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 19:59:16 -0800 (PST) From: Simon Glass X-Google-Original-From: Simon Glass To: U-Boot Concept Date: Thu, 29 Jan 2026 20:58:30 -0700 Message-ID: <20260130035849.3580212-8-simon.glass@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260130035849.3580212-1-simon.glass@canonical.com> References: <20260130035849.3580212-1-simon.glass@canonical.com> MIME-Version: 1.0 Message-ID-Hash: ZC6M2NA37XIQ6HQ3WLMJMCUZD3CMY6O7 X-Message-ID-Hash: ZC6M2NA37XIQ6HQ3WLMJMCUZD3CMY6O7 X-MailFrom: sjg@chromium.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/19] expo: Read all available input to keep up with key repeat List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When the user holds down a key, the terminal sends characters faster than expo can process them if it only reads one character per poll. Change poll_keys() to drain the input buffer by reading all available characters until a complete key is decoded or no more input is available. There are no tests for this feature. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/expo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/boot/expo.c b/boot/expo.c index 842bacae163..e44c7552f30 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -498,10 +498,12 @@ static int poll_keys(struct expo *exp) ichar = cli_ch_process(&exp->cch, 0); if (!ichar) { - /* Check once for available input */ - if (tstc()) { + /* Read all available input to keep up with key repeat */ + while (tstc()) { ch = getchar(); ichar = cli_ch_process(&exp->cch, ch); + if (ichar) + break; } if (!ch && get_timer(exp->last_key_ms) >= 10)