All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	 Patrice Chotard <patrice.chotard@foss.st.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Alexander Graf <agraf@csgraf.de>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Bin Meng <bmeng.cn@gmail.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	 Jose Marinho <jose.marinho@arm.com>,
	Grant Likely <grant.likely@arm.com>,
	 Tom Rini <trini@konsulko.com>,
	Etienne Carriere <etienne.carriere@linaro.org>,
	 Sughosh Ganu <sughosh.ganu@linaro.org>,
	Paul Liu <paul.liu@linaro.org>
Subject: Re: [PATCH v4 2/2] efi_loader: Reset system after CapsuleUpdate on disk
Date: Mon, 28 Feb 2022 13:19:50 +0900	[thread overview]
Message-ID: <CAA93ih0f2H0iEF5F6d7wC1-WxMumNAidA=Mctz=6ZWjnhAAB0Q@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ0VcHewTDp5b_SwG961fPvNF6HzPp-8az-onr8jd-PKDA@mail.gmail.com>

Hi Simon,

2022年2月27日(日) 3:37 Simon Glass <sjg@chromium.org>:
>
> Hi Masami,
>
> On Thu, 3 Feb 2022 at 02:23, Masami Hiramatsu
> <masami.hiramatsu@linaro.org> wrote:
> >
> > Add a cold reset 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 v4:
> >   - Do not use sysreset because that is a warm reset.
>
> I don't get that.
>
> You should use sysreset and the SYSRESET_COLD type.

Thanks, yeah, I found that parameter.
Let's fix that.

Thank you,

>
> >   - Fix patch description.
> > ---
> >  lib/efi_loader/efi_capsule.c |   18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> > index 1ec7ea29ff..20d9490dbd 100644
> > --- a/lib/efi_loader/efi_capsule.c
> > +++ b/lib/efi_loader/efi_capsule.c
> > @@ -14,6 +14,7 @@
> >  #include <env.h>
> >  #include <fdtdec.h>
> >  #include <fs.h>
> > +#include <hang.h>
> >  #include <malloc.h>
> >  #include <mapmem.h>
> >  #include <sort.h>
> > @@ -1120,8 +1121,11 @@ efi_status_t efi_launch_capsules(void)
> >                 if (ret == EFI_SUCCESS) {
> >                         ret = efi_capsule_update_firmware(capsule);
> >                         if (ret != EFI_SUCCESS)
> > -                               log_err("Applying capsule %ls failed\n",
> > +                               log_err("Applying capsule %ls failed.\n",
> >                                         files[i]);
> > +                       else
> > +                               log_info("Applying capsule %ls succeeded.\n",
> > +                                        files[i]);
> >
> >                         /* create CapsuleXXXX */
> >                         set_capsule_result(index, capsule, ret);
> > @@ -1142,6 +1146,16 @@ efi_status_t efi_launch_capsules(void)
> >                 free(files[i]);
> >         free(files);
> >
> > -       return ret;
> > +       /*
> > +        * UEFI spec requires to reset system after complete processing capsule
> > +        * update on the storage.
> > +        */
> > +       log_info("Reboot after firmware update");
> > +       /* Cold reset is required for loading the new firmware. */
> > +       do_reset(NULL, 0, 0, NULL);
>
> No! This should use sysreset.
>
> > +       hang();
> > +       /* not reach here */
> > +
> > +       return 0;
> >  }
> >  #endif /* CONFIG_EFI_CAPSULE_ON_DISK */
> >
>
> Regards,
> Simon



-- 
Masami Hiramatsu

  reply	other threads:[~2022-02-28  4:20 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  9:23 [PATCH v4 0/2] EFI: Reset system after capsule-on-disk Masami Hiramatsu
2022-02-03  9:23 ` [PATCH v4 1/2] efi_loader: use efi_update_capsule_firmware() for capsule on disk Masami Hiramatsu
2022-02-13  8:58   ` Heinrich Schuchardt
2022-02-03  9:23 ` [PATCH v4 2/2] efi_loader: Reset system after CapsuleUpdate " Masami Hiramatsu
2022-02-09  3:13   ` AKASHI Takahiro
2022-02-09  3:54     ` Masami Hiramatsu
2022-02-13  9:01   ` Heinrich Schuchardt
2022-02-13 10:17     ` Heinrich Schuchardt
2022-02-14  1:06       ` AKASHI Takahiro
2022-02-14  2:39         ` Masami Hiramatsu
2022-02-15  9:05       ` [PATCH] test/py: efi_capsule: Handle expected reset after capsule " Masami Hiramatsu
2022-02-15  9:09         ` Masami Hiramatsu
2022-02-15 13:51           ` Heinrich Schuchardt
2022-02-15 13:52             ` Heinrich Schuchardt
2022-02-15 14:15         ` Heinrich Schuchardt
2022-02-15 23:50           ` Masami Hiramatsu
2022-02-16  1:34         ` AKASHI Takahiro
2022-02-16  1:46           ` Masami Hiramatsu
2022-02-16 15:26         ` Simon Glass
2022-02-16 15:32           ` Heinrich Schuchardt
2022-02-16 15:46             ` Tom Rini
2022-02-16 17:45               ` Heinrich Schuchardt
2022-02-16 17:51                 ` Tom Rini
2022-02-16 17:52                 ` Simon Glass
2022-02-17  1:11                   ` Masami Hiramatsu
2022-02-17 17:55                     ` Simon Glass
2022-02-18  2:16                       ` Masami Hiramatsu
2022-02-18 13:48                         ` Heinrich Schuchardt
2022-02-19  1:15                           ` AKASHI Takahiro
2022-03-12  2:24                             ` Simon Glass
2022-03-13 14:00                               ` Masami Hiramatsu
2022-03-13 22:23                                 ` Simon Glass
2022-03-14  1:08                               ` AKASHI Takahiro
2022-03-14  2:15                                 ` Simon Glass
2022-03-14  2:42                                   ` AKASHI Takahiro
2022-03-14  6:45                                     ` Simon Glass
2022-03-14  7:35                                       ` Masami Hiramatsu
2022-03-14  8:03                                         ` AKASHI Takahiro
2022-03-14 18:24                                         ` Simon Glass
2022-03-15  0:40                                           ` Masami Hiramatsu
2022-03-15  5:02                                             ` AKASHI Takahiro
2022-03-15  5:04                                             ` Simon Glass
2022-03-15  8:36                                               ` Masami Hiramatsu
2022-03-16  3:13                                                 ` Simon Glass
2022-03-16  3:26                                                   ` AKASHI Takahiro
2022-03-16  6:09                                                   ` Masami Hiramatsu
2022-03-16 19:23                                                     ` Simon Glass
2022-03-16 20:41                                                       ` Heinrich Schuchardt
2022-03-17  0:29                                                         ` Simon Glass
2022-02-18 13:59                       ` Heinrich Schuchardt
2022-02-18 14:11                         ` Tom Rini
2022-02-19  4:18                         ` Masami Hiramatsu
2022-02-18 16:50                       ` Tom Rini
2022-02-16 17:46             ` Simon Glass
2022-02-26 18:37   ` [PATCH v4 2/2] efi_loader: Reset system after CapsuleUpdate " Simon Glass
2022-02-28  4:19     ` Masami Hiramatsu [this message]
2022-02-28  7:53       ` Masami Hiramatsu
2022-03-01 14:58         ` Simon Glass
2022-03-02  1:58           ` 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='CAA93ih0f2H0iEF5F6d7wC1-WxMumNAidA=Mctz=6ZWjnhAAB0Q@mail.gmail.com' \
    --to=masami.hiramatsu@linaro.org \
    --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=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=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.