public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Simon Glass <sjg@chromium.org>, Paul Liu <paul.liu@linaro.org>,
	Jose Marinho <jose.marinho@arm.com>,
	Etienne Carriere <etienne.carriere@linaro.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	Grant Likely <grant.likely@arm.com>,
	Bin Meng <bmeng.cn@gmail.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Alexander Graf <agraf@csgraf.de>,
	u-boot@lists.denx.de,
	Masami Hiramatsu <masami.hiramatsu@linaro.org>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: Re: [PATCH v2 2/2] efi_loader: Reset system after CapsuleUpdate on disk
Date: Sat, 5 Feb 2022 07:33:33 -0500	[thread overview]
Message-ID: <20220205123333.GS7515@bill-the-cat> (raw)
In-Reply-To: <7bfebeac-ee98-855a-9635-41863bc5da78@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 4046 bytes --]

On Thu, Feb 03, 2022 at 06:32:50PM +0100, Heinrich Schuchardt wrote:
> On 2/2/22 05:15, AKASHI Takahiro wrote:
> > On Wed, Feb 02, 2022 at 10:53:05AM +0900, Masami Hiramatsu wrote:
> > > Hi Takahiro,
> > > 
> > > 2022年2月1日(火) 20:38 AKASHI Takahiro <takahiro.akashi@linaro.org>:
> > > 
> > > > 
> > > > On Tue, Feb 01, 2022 at 05:33:09PM +0900, Masami Hiramatsu wrote:
> > > > > Add a config option to reset system soon after processing capsule update
> > > > > on disk. This is required in UEFI specification 2.9 Section 8.5.5
> > > > >   "Delivery of Capsules via file on Mass Storage device" as;
> > > > > 
> > > > >      In all cases that a capsule is identified for processing the system is
> > > > >      restarted after capsule processing is completed.
> > > > > 
> > > > > This also reports the result of each capsule update so that the user can
> > > > > notice that the capsule update has been succeeded or not from console log.
> > > > > 
> > > > > Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> > > > > ---
> > > > >   Changes in v2:
> > > > >    - Remove kconfig option to disable this feature.
> > > > >    - Use panic() instead of do_reset() so that if the reset fails,
> > > > >      the machine halt.
> > > > >    - Log the result of each capsule update always.
> > > > > ---
> > > > >   lib/efi_loader/efi_capsule.c |   12 +++++++++---
> > > > >   1 file changed, 9 insertions(+), 3 deletions(-)
> > > > > 
> > > > > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> > > > > index 1ec7ea29ff..39bce714f7 100644
> > > > > --- a/lib/efi_loader/efi_capsule.c
> > > > > +++ b/lib/efi_loader/efi_capsule.c
> > > > > @@ -1119,9 +1119,9 @@ efi_status_t efi_launch_capsules(void)
> > > > >                ret = efi_capsule_read_file(files[i], &capsule);
> > > > >                if (ret == EFI_SUCCESS) {
> > > > >                        ret = efi_capsule_update_firmware(capsule);
> > > > > -                     if (ret != EFI_SUCCESS)
> > > > > -                             log_err("Applying capsule %ls failed\n",
> > > > > -                                     files[i]);
> > > > > +                     log_err("Applying capsule %ls %s\n",
> > > > > +                             files[i],
> > > > > +                             ret == EFI_SUCCESS ? "succeeded" : "failed");
> > > > 
> > > > log_err()? log_info() is better, I think.
> > > 
> > > Hmm, would you think to use log_info() even if it is failed? Or should
> > > we have log_err(failure) and log_info(success)?
> > 
> > It is what I meant :)
> > 
> > > > 
> > > > > 
> > > > >                        /* create CapsuleXXXX */
> > > > >                        set_capsule_result(index, capsule, ret);
> > > > > @@ -1142,6 +1142,12 @@ efi_status_t efi_launch_capsules(void)
> > > > >                free(files[i]);
> > > > >        free(files);
> > > > > 
> > > > > +     /*
> > > > > +      * UEFI spec requires to reset system after complete processing capsule
> > > > > +      * update on the storage.
> > > > > +      */
> > > > > +     panic("Reboot after firmware update");
> > > > 
> > > > If CONFIG_PANIC_HANG is enabled, the system won't restart.
> > > > It's not what we want here.
> > > 
> > > Indeed.
> > > Heinrich, what would you think if do_reset() doesn't work?
> > > (I think it is OK to get it back here, but needs a warning)
> > 
> > If (CONFIG_IS_ENABLED(SYSRESET)) {
> >      puts ("resetting ...\n");
> >      sysreset_reset_walk(SYSRESET_WARM);
> 
> do_reset() is implemented in many 25 places.
> drivers/sysreset/sysreset-uclass.c is just one of them.
> 
> @Tom, @Simon:
> Is there a migration timeline to replace all other do_reset()
> implementations?
> 
> A dummy implementation like in arch/riscv/lib/reset.c should not exist.
> The sysreset uclass handles the case of no sysreset driver already.

Not yet, please feel free to propose something, if it can't just be done
outright, right now.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2022-02-05 12:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01  8:32 [PATCH v2 0/2] EFI: Reset system after capsule-on-disk Masami Hiramatsu
2022-02-01  8:32 ` [PATCH v2 1/2] efi_loader: Avoid using efi_update_capsule() from update capsule on disk Masami Hiramatsu
2022-02-01 15:42   ` Sughosh Ganu
2022-02-01 16:44     ` Heinrich Schuchardt
2022-02-01 17:03       ` Sughosh Ganu
2022-02-01 23:47         ` AKASHI Takahiro
2022-02-02  5:28           ` Sughosh Ganu
2022-02-02  0:09         ` Masami Hiramatsu
2022-02-02  5:34           ` Sughosh Ganu
2022-02-02  7:03             ` Masami Hiramatsu
2022-02-02  8:28               ` Sughosh Ganu
2022-02-01  8:33 ` [PATCH v2 2/2] efi_loader: Reset system after CapsuleUpdate " Masami Hiramatsu
2022-02-01 11:38   ` AKASHI Takahiro
2022-02-02  1:53     ` Masami Hiramatsu
2022-02-02  4:15       ` AKASHI Takahiro
2022-02-02  7:06         ` Masami Hiramatsu
2022-02-03 17:32         ` Heinrich Schuchardt
2022-02-05 12:33           ` Tom Rini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-02 13:54 [PATCH v2 0/2] EFI: Reset system after capsule-on-disk Masami Hiramatsu
2022-02-02 13:54 ` [PATCH v2 2/2] efi_loader: Reset system after CapsuleUpdate on disk Masami Hiramatsu
2022-02-03  1:24   ` AKASHI Takahiro
2022-02-03  4:34     ` Masami Hiramatsu
2022-02-03  6:35       ` Masami Hiramatsu

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=20220205123333.GS7515@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=agraf@csgraf.de \
    --cc=bmeng.cn@gmail.com \
    --cc=etienne.carriere@linaro.org \
    --cc=grant.likely@arm.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jose.marinho@arm.com \
    --cc=masami.hiramatsu@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=paul.liu@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=takahiro.akashi@linaro.org \
    --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