Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218123/?format=api
{ "id": 2218123, "url": "http://patchwork.ozlabs.org/api/patches/2218123/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260331110413.1040527-1-gregor.herburger@linutronix.de/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260331110413.1040527-1-gregor.herburger@linutronix.de>", "list_archive_url": null, "date": "2026-03-31T11:03:08", "name": "cli: flush stdin before enabling cli", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "e95646e0f35a796dc5494b2f652660a5c2e982ef", "submitter": { "id": 93018, "url": "http://patchwork.ozlabs.org/api/people/93018/?format=api", "name": "Gregor Herburger", "email": "gregor.herburger@linutronix.de" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260331110413.1040527-1-gregor.herburger@linutronix.de/mbox/", "series": [ { "id": 498195, "url": "http://patchwork.ozlabs.org/api/series/498195/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498195", "date": "2026-03-31T11:03:08", "name": "cli: flush stdin before enabling cli", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498195/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218123/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218123/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256\n header.s=2020 header.b=HqGXkK6A;\n\tdkim=pass header.d=linutronix.de header.i=@linutronix.de\n header.a=ed25519-sha256 header.s=2020e header.b=IYz8MbqE;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linutronix.de", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=linutronix.de header.i=@linutronix.de header.b=\"HqGXkK6A\";\n\tdkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de\n header.b=\"IYz8MbqE\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linutronix.de", "phobos.denx.de;\n spf=pass smtp.mailfrom=gregor.herburger@linutronix.de" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flT2Y5xpSz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 00:08:37 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 0AD1384020;\n\tTue, 31 Mar 2026 15:08:28 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 191DB83DBF; Tue, 31 Mar 2026 13:04:59 +0200 (CEST)", "from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 2AC0483A41\n for <u-boot@lists.denx.de>; Tue, 31 Mar 2026 13:04:57 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2", "From": "Gregor Herburger <gregor.herburger@linutronix.de>", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;\n s=2020; t=1774955096;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=aaeGZgSHihZSGH4wKrAaj0NnBm7C9YK+n6VWCqgMJZs=;\n b=HqGXkK6A41JMGjCTbjxJfciXLtrR0xpNqBsSVp6hSO5lwc8lm688gf2DzrSxGNp3hRUYhU\n Z1T7fsRy4p7r7M4WVp2qN5u6re7BS+BLIqC7FC74e0fqboK0Ul/6bm/JOD9wsEmD7XhpFy\n 4RSPSb/Sw1ZcjTvdbwHXd1lM59isR2pLCiaSfOD5p9Lf+5A1034oykJamAq21EutOToKvQ\n CQxR09Z5DdMYL2lfrEooY1DF6/KzGYJd5cGqwCU7Ou/s2UEYk20dwKsXzk5mK70JICg95y\n WZnONXV5Hv+Ka/+gmc4AiAcVsEPc83xeHHqpL4v84qo7srNo9akR/K2M8RESjQ==", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;\n s=2020e; t=1774955096;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=aaeGZgSHihZSGH4wKrAaj0NnBm7C9YK+n6VWCqgMJZs=;\n b=IYz8MbqEHBYpTIWxQxdE7YeFTfSGywWc/hzDTC0qvw5CJA1F8KMg2HcVg8VbvadUcp+TM3\n BAptWL7wG0zoO3BA==" ], "To": "u-boot@lists.denx.de", "Cc": "Gregor Herburger <gregor.herburger@linutronix.de>,\n Andrew Goodbody <andrew.goodbody@linaro.org>,\n Heiko Schocher <hs@nabladev.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n \"Kory Maincent (TI.com)\" <kory.maincent@bootlin.com>,\n Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Quentin Schulz <quentin.schulz@cherry.de>, Tom Rini <trini@konsulko.com>", "Subject": "[PATCH] cli: flush stdin before enabling cli", "Date": "Tue, 31 Mar 2026 13:03:08 +0200", "Message-ID": "<20260331110413.1040527-1-gregor.herburger@linutronix.de>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Tue, 31 Mar 2026 15:08:26 +0200", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Currently there is no possibility to flush stdin after autocommands are\nexecuted. If in the bootcmd the stdin is changed, e.g. from nulldev to\nserial, it could happen that junk characters sit in the fifo and appear\non the cli.\n\nAdd a option to clear stdin before starting the CLI.\n\nSigned-off-by: Gregor Herburger <gregor.herburger@linutronix.de>\n\n---\n\n cmd/Kconfig | 7 +++++++\n common/cli.c | 6 ++++++\n 2 files changed, 13 insertions(+)", "diff": "diff --git a/cmd/Kconfig b/cmd/Kconfig\nindex 322ebe600c5..e08fbf27358 100644\n--- a/cmd/Kconfig\n+++ b/cmd/Kconfig\n@@ -47,6 +47,13 @@ config HUSH_SELECTABLE\n \tdefault y if HUSH_OLD_PARSER && HUSH_MODERN_PARSER\n endmenu\n \n+config CMDLINE_FLUSH_STDIN\n+\tbool \"Enable flushing input before starting cli\"\n+\tdefault n\n+\thelp\n+\t When this option is enabled the stdin buffer will be flushed before\n+\t starting the CLI.\n+\n config CMDLINE_EDITING\n \tbool \"Enable command line editing\"\n \tdefault y\ndiff --git a/common/cli.c b/common/cli.c\nindex 4694a35cd0e..42d27ed87e7 100644\n--- a/common/cli.c\n+++ b/common/cli.c\n@@ -295,6 +295,12 @@ err:\n void cli_loop(void)\n {\n \tbootstage_mark(BOOTSTAGE_ID_ENTER_CLI_LOOP);\n+\n+\tif (IS_ENABLED(CONFIG_CMDLINE_FLUSH_STDIN)) {\n+\t\twhile (tstc())\n+\t\t\t(void)getchar();\n+\t}\n+\n #if CONFIG_IS_ENABLED(HUSH_PARSER)\n \tif (gd->flags & GD_FLG_HUSH_MODERN_PARSER)\n \t\tparse_and_run_file();\n", "prefixes": [] }