Skip to contentSkip to conversation

efi_loader: Use sysreset instead of reset command

PATCH Superseded Masami Hiramatsu 3 participants 7 messages Mar 15, 2022 – Mar 16, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: Use sysreset instead of reset command

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.

---
 lib/efi_loader/efi_capsule.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */
 
#1 lore raw
Quoted 3 lines · Masami Hiramatsu

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

Quoted 23 lines
---
  lib/efi_loader/efi_capsule.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */
 
#2 lore raw

Hi Heinrich,

Quoted 8 lines · Heinrich Schuchardt
Quoted 3 lines · Masami Hiramatsu

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

Quoted 29 lines

Best regards

Heinrich

Quoted 23 lines
---
  lib/efi_loader/efi_capsule.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */
 
#3 lore raw

Am 15. März 2022 18:47:09 MEZ schrieb Simon Glass <[email protected]>:

Quoted 5 lines

Hi Heinrich,

Quoted 2 lines · Heinrich Schuchardt

On 3/15/22 01:43, Masami Hiramatsu wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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

Quoted 33 lines

Regards,
Simon

Quoted 29 lines

Best regards

Heinrich

Quoted 23 lines
---
  lib/efi_loader/efi_capsule.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */
 
#4 lore raw

Hi Heinrich,

Quoted 13 lines · Heinrich Schuchardt

Am 15. März 2022 18:47:09 MEZ schrieb Simon Glass <[email protected]>:

Quoted 9 lines

Hi Heinrich,

Quoted 6 lines · Heinrich Schuchardt
Quoted 3 lines · Masami Hiramatsu

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.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
---
  lib/efi_loader/efi_capsule.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */
 
#5 lore raw

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 <[email protected]>:

Quoted 58 lines

Hi Heinrich,

Quoted 13 lines · Heinrich Schuchardt

Am 15. März 2022 18:47:09 MEZ schrieb Simon Glass <[email protected]>:

Quoted 9 lines

Hi Heinrich,

Quoted 6 lines · Heinrich Schuchardt
Quoted 3 lines · Masami Hiramatsu

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.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
---
  lib/efi_loader/efi_capsule.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */
 
Signature · 1 line
Masami Hiramatsu
Reviewed-by on v1 1/1
#6 lore raw
In reply to Masami Hiramatsu
Quoted 9 lines · Masami Hiramatsu

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.

---
 lib/efi_loader/efi_capsule.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 18 lines
lib/efi_loader/efi_capsule.c +2 -2
index 613b531b82..35907ad0d2 100644
@@ -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 */