From: Gregor Herburger <gregor.herburger@linutronix.de>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Quentin Schulz <quentin.schulz@cherry.de>,
Andrew Goodbody <andrew.goodbody@linaro.org>,
Heiko Schocher <hs@nabladev.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jerome Forissier <jerome.forissier@arm.com>,
"Kory Maincent (TI.com)" <kory.maincent@bootlin.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v3 2/2] cli: flush stdin before enabling cli
Date: Mon, 13 Apr 2026 08:18:33 +0200 [thread overview]
Message-ID: <adyKucgpN0v4ddhA@gregor-framework> (raw)
In-Reply-To: <CAFLszTgOx73JFqH9+ES4w6oVP=DeM81QJFqQP9dR4_g4eOm15w@mail.gmail.com>
Hi Simon,
On Sat, Apr 11, 2026 at 10:41:00AM -0600, Simon Glass wrote:
> Hi Gregor,
>
> On 2026-04-07T06:33:10, Gregor Herburger <gregor.herburger@linutronix.de> wrote:
> > cli: flush stdin before enabling cli
> >
> > Currently there is no possibility to flush stdin after autocommands are
> > executed. If in the bootcmd the stdin is changed, e.g. from nulldev to
> > serial, it could happen that junk characters sit in the fifo and appear
> > on the cli.
> >
> > Add a option to clear stdin before starting the CLI.
> >
> > Signed-off-by: Gregor Herburger <gregor.herburger@linutronix.de>
> >
> > cmd/Kconfig | 8 ++++++++
> > common/cli.c | 4 ++++
> > 2 files changed, 12 insertions(+)
>
> > diff --git a/cmd/Kconfig b/cmd/Kconfig
> > @@ -47,6 +47,14 @@ config HUSH_SELECTABLE
> > +config CMDLINE_FLUSH_STDIN
> > + bool "Enable flushing input before starting cli"
> > + When this option is enabled the stdin buffer will be flushed before
> > + starting the CLI. This is useful when stdin is changed during boot
> > + (e.g. from nulldev to serial) and junk characters may be pending
> > + in the buffer.
>
> Thanks for expanding the help text!
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
I just realized I didn't collected the Reviewed-by Tags from v2. Should
I send a v4 with these or does a maintainer add them?
Regards
Gregor
next prev parent reply other threads:[~2026-04-13 6:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 6:33 [PATCH v3 1/2] console: add console_flush_stdin() Gregor Herburger
2026-04-07 6:33 ` [PATCH v3 2/2] cli: flush stdin before enabling cli Gregor Herburger
2026-04-11 16:41 ` Simon Glass
2026-04-13 6:18 ` Gregor Herburger [this message]
2026-04-13 13:35 ` Simon Glass
2026-04-11 16:40 ` [PATCH v3 1/2] console: add console_flush_stdin() Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adyKucgpN0v4ddhA@gregor-framework \
--to=gregor.herburger@linutronix.de \
--cc=andrew.goodbody@linaro.org \
--cc=hs@nabladev.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@arm.com \
--cc=kory.maincent@bootlin.com \
--cc=mikhail.kshevetskiy@iopsys.eu \
--cc=mkorpershoek@kernel.org \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.