[PATCH] autoboot: Fix inconsistent countdown output

David Zang davidzangcs at gmail.com
Thu Nov 27 05:15:30 CET 2025


Thank you Sam for the fix.
Acked-by: David Zang <davidzangcs at gmail.com>

On Tue, Nov 25, 2025 at 10:51 AM Tom Rini <trini at konsulko.com> wrote:

> On Mon, Nov 24, 2025 at 02:49:23PM -0600, Sam Protsenko wrote:
> > Hi Tom,
> >
> > On Tue, Oct 28, 2025 at 11:51 AM Tom Rini <trini at konsulko.com> wrote:
> > >
> > > On Sun, Oct 26, 2025 at 07:24:58PM -0500, Sam Protsenko wrote:
> > >
> > > > Commit 5f70be08b015 ("Fix autoboot countdown printing wrong")
> introduces
> > > > inconsistency in how the countdown is displayed. For example, in case
> > > > when BOOTDELAY=5, the next output is observed during the boot:
> > > >
> > > >     Hit any key to stop autoboot:  5
> > > >     Hit any key to stop autoboot: 4
> > > >     Hit any key to stop autoboot: 3
> > > >
> > > > That happens due to different printf format (%2d vs %1d). Moreover,
> the
> > > > mentioned commit fails to handle the case when the user is holding
> some
> > > > key before the countdown is shown. E.g. if BOOTDELAY=101, the next
> > > > malformed output is being produced:
> > > >
> > > >     Hit any key to stop autoboot: 1 0
> > > >
> > > > That's because the fast path code wasn't modified accordingly, and
> still
> > > > tries to erase the number using '\b\b\b' format.
> > > >
> > > > Fix both issues by introducing a dedicated routine for printing the
> > > > whole countdown line.
> > > >
> > > > Fixes: 5f70be08b015 ("Fix autoboot countdown printing wrong")
> > > > Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> > >
> > > This seems the reasonable path, given everything in the following parts
> > > of the thread, thanks.
> > >
> > > Reviewed-by: Tom Rini <trini at konsulko.com>
> > >
> >
> > Since there are no new or outstanding comments for this patch, can you
> > please pull it for the next release?
>
> I'm going to take this for -next rather than master, soon, as it's just
> cleaning up some output. Thanks.
>
> --
> Tom
>


More information about the U-Boot mailing list