diff mbox series

efi_loader: Use sysreset instead of reset command

Message ID 164730500523.191671.13596780381116303195.stgit@localhost
State New
Headers show
Series efi_loader: Use sysreset instead of reset command | expand

Commit Message

Masami Hiramatsu March 15, 2022, 12:43 a.m. UTC
Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
feature to reboot (cold reset) machine instead of using reset command
interface, since this is not a command.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
---
 lib/efi_loader/efi_capsule.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Heinrich Schuchardt March 15, 2022, 10:26 a.m. UTC | #1
On 3/15/22 01:43, Masami Hiramatsu wrote:
> Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> feature to reboot (cold reset) machine instead of using reset command
> interface, since this is not a command.

As long as not all UEFI supported boards use sysreset you cannot do this
change. See wandboard_defconfig.

Best regards

Heinrich

>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> ---
>   lib/efi_loader/efi_capsule.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> index 613b531b82..35907ad0d2 100644
> --- a/lib/efi_loader/efi_capsule.c
> +++ b/lib/efi_loader/efi_capsule.c
> @@ -1150,9 +1150,9 @@ efi_status_t efi_launch_capsules(void)
>   	 * UEFI spec requires to reset system after complete processing capsule
>   	 * update on the storage.
>   	 */
> -	log_info("Reboot after firmware update");
> +	log_info("Reboot after firmware update.\n");
>   	/* Cold reset is required for loading the new firmware. */
> -	do_reset(NULL, 0, 0, NULL);
> +	sysreset_walk_halt(SYSRESET_COLD);
>   	hang();
>   	/* not reach here */
>
>
Simon Glass March 15, 2022, 5:46 p.m. UTC | #2
On Mon, 14 Mar 2022 at 18:43, Masami Hiramatsu
<masami.hiramatsu@linaro.org> wrote:
>
> Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> feature to reboot (cold reset) machine instead of using reset command
> interface, since this is not a command.
>
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> ---
>  lib/efi_loader/efi_capsule.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>


>
> diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> index 613b531b82..35907ad0d2 100644
> --- a/lib/efi_loader/efi_capsule.c
> +++ b/lib/efi_loader/efi_capsule.c
> @@ -1150,9 +1150,9 @@ efi_status_t efi_launch_capsules(void)
>          * UEFI spec requires to reset system after complete processing capsule
>          * update on the storage.
>          */
> -       log_info("Reboot after firmware update");
> +       log_info("Reboot after firmware update.\n");
>         /* Cold reset is required for loading the new firmware. */
> -       do_reset(NULL, 0, 0, NULL);
> +       sysreset_walk_halt(SYSRESET_COLD);
>         hang();
>         /* not reach here */
>
>
Simon Glass March 15, 2022, 5:47 p.m. UTC | #3
Hi Heinrich,

On Tue, 15 Mar 2022 at 04:31, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 3/15/22 01:43, Masami Hiramatsu wrote:
> > Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> > feature to reboot (cold reset) machine instead of using reset command
> > interface, since this is not a command.
>
> As long as not all UEFI supported boards use sysreset you cannot do this
> change. See wandboard_defconfig.

We can make the feature depend on SYSRESET.

Regards,
Simon

>
> Best regards
>
> Heinrich
>
> >
> > Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> > ---
> >   lib/efi_loader/efi_capsule.c |    4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> > index 613b531b82..35907ad0d2 100644
> > --- a/lib/efi_loader/efi_capsule.c
> > +++ b/lib/efi_loader/efi_capsule.c
> > @@ -1150,9 +1150,9 @@ efi_status_t efi_launch_capsules(void)
> >        * UEFI spec requires to reset system after complete processing capsule
> >        * update on the storage.
> >        */
> > -     log_info("Reboot after firmware update");
> > +     log_info("Reboot after firmware update.\n");
> >       /* Cold reset is required for loading the new firmware. */
> > -     do_reset(NULL, 0, 0, NULL);
> > +     sysreset_walk_halt(SYSRESET_COLD);
> >       hang();
> >       /* not reach here */
> >
> >
>
Heinrich Schuchardt March 15, 2022, 6:20 p.m. UTC | #4
Am 15. März 2022 18:47:09 MEZ schrieb Simon Glass <sjg@chromium.org>:
>Hi Heinrich,
>
>On Tue, 15 Mar 2022 at 04:31, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> On 3/15/22 01:43, Masami Hiramatsu wrote:
>> > Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
>> > feature to reboot (cold reset) machine instead of using reset command
>> > interface, since this is not a command.
>>
>> As long as not all UEFI supported boards use sysreset you cannot do this
>> change. See wandboard_defconfig.
>
>We can make the feature depend on SYSRESET.

Is there anything requiring this change? If not leave it as it is for now and set a deadline for the migration of the boards.

Best regards

Heinrich 

>
>Regards,
>Simon
>
>>
>> Best regards
>>
>> Heinrich
>>
>> >
>> > Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
>> > ---
>> >   lib/efi_loader/efi_capsule.c |    4 ++--
>> >   1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
>> > index 613b531b82..35907ad0d2 100644
>> > --- a/lib/efi_loader/efi_capsule.c
>> > +++ b/lib/efi_loader/efi_capsule.c
>> > @@ -1150,9 +1150,9 @@ efi_status_t efi_launch_capsules(void)
>> >        * UEFI spec requires to reset system after complete processing capsule
>> >        * update on the storage.
>> >        */
>> > -     log_info("Reboot after firmware update");
>> > +     log_info("Reboot after firmware update.\n");
>> >       /* Cold reset is required for loading the new firmware. */
>> > -     do_reset(NULL, 0, 0, NULL);
>> > +     sysreset_walk_halt(SYSRESET_COLD);
>> >       hang();
>> >       /* not reach here */
>> >
>> >
>>
Simon Glass March 15, 2022, 9:15 p.m. UTC | #5
Hi Heinrich,

On Tue, 15 Mar 2022 at 12:26, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
>
>
> Am 15. März 2022 18:47:09 MEZ schrieb Simon Glass <sjg@chromium.org>:
> >Hi Heinrich,
> >
> >On Tue, 15 Mar 2022 at 04:31, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >>
> >> On 3/15/22 01:43, Masami Hiramatsu wrote:
> >> > Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> >> > feature to reboot (cold reset) machine instead of using reset command
> >> > interface, since this is not a command.
> >>
> >> As long as not all UEFI supported boards use sysreset you cannot do this
> >> change. See wandboard_defconfig.
> >
> >We can make the feature depend on SYSRESET.
>
> Is there anything requiring this change? If not leave it as it is for now and set a deadline for the migration of the boards.

Yes, it makes the test painful, as I understand it. We should not use
do_reset() to reset, from new code. That is a legacy thing. New code
should use up-to-data features.

No more deadlines for now, there is too much push-back :-)

Regards,
Simon



> >> > Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> >> > ---
> >> >   lib/efi_loader/efi_capsule.c |    4 ++--
> >> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> >> > index 613b531b82..35907ad0d2 100644
> >> > --- a/lib/efi_loader/efi_capsule.c
> >> > +++ b/lib/efi_loader/efi_capsule.c
> >> > @@ -1150,9 +1150,9 @@ efi_status_t efi_launch_capsules(void)
> >> >        * UEFI spec requires to reset system after complete processing capsule
> >> >        * update on the storage.
> >> >        */
> >> > -     log_info("Reboot after firmware update");
> >> > +     log_info("Reboot after firmware update.\n");
> >> >       /* Cold reset is required for loading the new firmware. */
> >> > -     do_reset(NULL, 0, 0, NULL);
> >> > +     sysreset_walk_halt(SYSRESET_COLD);
> >> >       hang();
> >> >       /* not reach here */
> >> >
> >> >
> >>
Masami Hiramatsu March 16, 2022, 7:07 a.m. UTC | #6
Hi Heinrich and Simon,

OK, I will introduce a dependency of SYSRESET to EFI_CAPSULE_ON_DISK.
Thank you,

2022年3月16日(水) 6:15 Simon Glass <sjg@chromium.org>:
>
> Hi Heinrich,
>
> On Tue, 15 Mar 2022 at 12:26, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >
> >
> >
> > Am 15. März 2022 18:47:09 MEZ schrieb Simon Glass <sjg@chromium.org>:
> > >Hi Heinrich,
> > >
> > >On Tue, 15 Mar 2022 at 04:31, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> > >>
> > >> On 3/15/22 01:43, Masami Hiramatsu wrote:
> > >> > Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
> > >> > feature to reboot (cold reset) machine instead of using reset command
> > >> > interface, since this is not a command.
> > >>
> > >> As long as not all UEFI supported boards use sysreset you cannot do this
> > >> change. See wandboard_defconfig.
> > >
> > >We can make the feature depend on SYSRESET.
> >
> > Is there anything requiring this change? If not leave it as it is for now and set a deadline for the migration of the boards.
>
> Yes, it makes the test painful, as I understand it. We should not use
> do_reset() to reset, from new code. That is a legacy thing. New code
> should use up-to-data features.
>
> No more deadlines for now, there is too much push-back :-)
>
> Regards,
> Simon
>
>
>
> > >> > Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> > >> > ---
> > >> >   lib/efi_loader/efi_capsule.c |    4 ++--
> > >> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > >> >
> > >> > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
> > >> > index 613b531b82..35907ad0d2 100644
> > >> > --- a/lib/efi_loader/efi_capsule.c
> > >> > +++ b/lib/efi_loader/efi_capsule.c
> > >> > @@ -1150,9 +1150,9 @@ efi_status_t efi_launch_capsules(void)
> > >> >        * UEFI spec requires to reset system after complete processing capsule
> > >> >        * update on the storage.
> > >> >        */
> > >> > -     log_info("Reboot after firmware update");
> > >> > +     log_info("Reboot after firmware update.\n");
> > >> >       /* Cold reset is required for loading the new firmware. */
> > >> > -     do_reset(NULL, 0, 0, NULL);
> > >> > +     sysreset_walk_halt(SYSRESET_COLD);
> > >> >       hang();
> > >> >       /* not reach here */
> > >> >
> > >> >
> > >>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 613b531b82..35907ad0d2 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -1150,9 +1150,9 @@  efi_status_t efi_launch_capsules(void)
 	 * UEFI spec requires to reset system after complete processing capsule
 	 * update on the storage.
 	 */
-	log_info("Reboot after firmware update");
+	log_info("Reboot after firmware update.\n");
 	/* Cold reset is required for loading the new firmware. */
-	do_reset(NULL, 0, 0, NULL);
+	sysreset_walk_halt(SYSRESET_COLD);
 	hang();
 	/* not reach here */