From: Daniel Golle <daniel@makrotopia.org>
To: Weijie Gao <weijie.gao@mediatek.com>
Cc: u-boot@lists.denx.de,
GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Tom Rini <trini@konsulko.com>, John Crispin <john@phrozen.org>,
Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH v2 1/3] menu: fix the logic checking whether ESC key is pressed
Date: Sat, 2 Nov 2024 22:23:36 +0000 [thread overview]
Message-ID: <ZyamaLOiEMCd3c92@pidgin.makrotopia.org> (raw)
In-Reply-To: <cdb9a83d244a77e5ffb2a3d069607f16447b723e.camel@mediatek.com>
On Fri, Nov 01, 2024 at 03:20:11PM +0800, Weijie Gao wrote:
> Hi Daniel,
>
> On Thu, 2024-10-31 at 19:16 +0000, Daniel Golle wrote:
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> >
> >
> > On Tue, Oct 29, 2024 at 05:47:10PM +0800, Weijie Gao wrote:
> > > It's observed that the bootmenu on a serial console sometimes
> > > incorrectly quitted with superfluous characters filled to command
> > > line input:
> > >
> > > > *** U-Boot Boot Menu ***
> > > >
> > > > 1. Startup system (Default)
> > > > 2. Upgrade firmware
> > > > 3. Upgrade ATF BL2
> > > > 4. Upgrade ATF FIP
> > > > 5. Load image
> > > > 0. U-Boot console
> > > >
> > > >
> > > > Press UP/DOWN to move, ENTER to select, ESC to quit
> > > > MT7988> [B
> > >
> > > Analysis shows it was caused by the wrong logic of bootmenu_loop:
> > >
> > > At first the bootmenu_loop received the first ESC char correctly.
> > >
> > > However, during the second call to bootmenu_loop, there's no data
> > > in the UART Rx FIFO. Due to the low baudrate, the second char of
> > > the down array key sequence hasn't be fully received.
> > >
> > > But bootmenu_loop just did a mdelay(10), and then treated it as a
> > > single ESC key press event. It didn't even try tstc() again after
> > > the 10ms timeout.
> > >
> > > This patch fixes this issue by letting bootmenu_loop check tstc()
> > > twice.
> > >
> > > Tested-By: E Shattow <lucent@gmail.com>
> > > Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> >
> > Reviewed-by: Daniel Golle <daniel@makrotopia.org>
> > Tested-by: Daniel Golle <daniel@makrotopia.org>
> >
> > Together with 2/3 and 3/3 this now avoids dropping into the U-Boot
> > shell
> > as long as the menu is short enough. In case of menus with 8 entries
> > of
> > more I still manage to drop into shell when holding the arrow down
> > key
> > before the last item has been reached.
> > That being said, it's already a very big improvement that this now
> > only
> > happens when holding down a button traversing over a menu with a high
> > number of items.
>
> I didn't encounter with this.
> Did you try enabling CONFIG_SERIAL_RX_BUFFER?
Combined with CONFIG_SERIAL_RX_BUFFER it does resolve the issue and I no
longer manage to get dropped into console.
Thank you a lot for taking care of this!
next prev parent reply other threads:[~2024-11-02 22:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 9:47 [PATCH v2 1/3] menu: fix the logic checking whether ESC key is pressed Weijie Gao
2024-10-29 9:47 ` [PATCH v2 2/3] menu: add support to check if menu needs to be reprinted Weijie Gao
2024-10-31 19:13 ` Daniel Golle
2024-10-29 9:47 ` [PATCH v2 3/3] bootmenu: add reprint check Weijie Gao
2024-10-31 19:13 ` Daniel Golle
2024-10-31 18:04 ` [PATCH v2 1/3] menu: fix the logic checking whether ESC key is pressed Simon Glass
2024-10-31 19:16 ` Daniel Golle
2024-11-01 7:20 ` Weijie Gao
2024-11-02 22:23 ` Daniel Golle [this message]
2024-11-05 1:07 ` Tom Rini
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=ZyamaLOiEMCd3c92@pidgin.makrotopia.org \
--to=daniel@makrotopia.org \
--cc=GSS_MTK_Uboot_upstream@mediatek.com \
--cc=john@phrozen.org \
--cc=marek.vasut+renesas@mailbox.org \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=weijie.gao@mediatek.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox