public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Simon Glass" <sjg@chromium.org>, <gary@garyguo.net>
Cc: "Tom Rini" <trini@konsulko.com>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"David Zang" <davidzangcs@gmail.com>,
	"Sam Protsenko" <semen.protsenko@linaro.org>,
	"Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>,
	"Adriano Cordova" <adrianox@gmail.com>,
	"Javier Tia" <javier.tia@linaro.org>,
	"Martyn Welch" <martyn.welch@collabora.com>,
	<u-boot@lists.denx.de>
Subject: Re: [PATCH] efi_loader: support EFI_OS_INDICATIONS_BOOT_TO_FW_UI
Date: Fri, 03 Apr 2026 16:41:19 +0100	[thread overview]
Message-ID: <DHJMTRNSOX3S.2LQPF5ATDP78S@garyguo.net> (raw)
In-Reply-To: <CAFLszTj-QRQBCZHNCyM6YR7n5M4+myr8ztDo6Xn9CfDb6=ppSA@mail.gmail.com>

On Fri Apr 3, 2026 at 2:22 PM BST, Simon Glass wrote:
> Hi Gary,
>
> On 2026-03-31T19:18:51, Gary Guo <gary@garyguo.net> wrote:
>> efi_loader: support EFI_OS_INDICATIONS_BOOT_TO_FW_UI
>>
>> EFI variable OsIndications have a bit EFI_OS_INDICATIONS_BOOT_TO_FW_UI
>> indicating that the OS (or next stage bootloader) requests booting into
>> firmware UI instead of continuing autoboot process.
>>
>> Support it by having autoboot.c asking EFI bootmgr if boot should continue,
>> which checks and clear the bit (so the next boot continue as normal).
>>
>> With this change, systemd-boot will show a "Reboot Into Firmware Interface"
>> option which will be able to drop back to u-boot. This can be useful if
>> bootdelay is configured to be -2.
>>
>> Signed-off-by: Gary Guo <gary@garyguo.net>
>
>> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
>> @@ -1290,6 +1290,51 @@ out:
>> +bool efi_should_abort_autoboot(void)
>> +{
>> +     efi_status_t ret;
>> +     u64 os_indications = 0x0;
>> +     efi_uintn_t size;
>> +     efi_status_t r;
>
> (I'm leaving the proper review to Ilias & Heinrich, this is just a few
> nits and a though)
>
> Please can you use a single variable name for both efi_status_t variables.

Ah, I think I copied the init part from somewhere else and forget to merge the
variable names.

I'll adjust the variable name in the next version after receiving more reviews.

>
>> +     ret = efi_init_obj_list();
>> +     if (ret != EFI_SUCCESS) {
>> +             log_err("Error: Cannot initialize UEFI sub-system, r = %lu\n",
>> +                     ret & ~EFI_ERROR_MASK);
>
> The log message says "r = " but prints ret. The similar message in
> efi_bootmgr_run() just prints the value without a prefix.

Sorry, what do you mean by "without a prefix"? I think the code is identical to
the one in `efi_bootmgr_run`?

>
> I would also like to see the code which adjusts the variable placed in
> a function.

You mean the bit clearing part? What benefit does that provide, considering that
this is just a single function call?

Thanks,
Gary

  reply	other threads:[~2026-04-03 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 19:18 [PATCH] efi_loader: support EFI_OS_INDICATIONS_BOOT_TO_FW_UI Gary Guo
2026-04-03 10:30 ` Heinrich Schuchardt
2026-04-03 10:38   ` Ilias Apalodimas
2026-04-03 13:22 ` Simon Glass
2026-04-03 15:41   ` Gary Guo [this message]
2026-04-03 16:31     ` Simon Glass
2026-04-11 13:43       ` Heinrich Schuchardt

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=DHJMTRNSOX3S.2LQPF5ATDP78S@garyguo.net \
    --to=gary@garyguo.net \
    --cc=adrianox@gmail.com \
    --cc=davidzangcs@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=javier.tia@linaro.org \
    --cc=martyn.welch@collabora.com \
    --cc=paul.liu@linaro.org \
    --cc=semen.protsenko@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox