U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] EFI Capsule update explicitly sets dfu_alt_info
@ 2025-02-26 22:35 Jonathan Humphreys
  2025-02-26 22:35 ` [PATCH v4 1/3] xilinx: dfu: Fill directly update_info.dfu_string Jonathan Humphreys
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jonathan Humphreys @ 2025-02-26 22:35 UTC (permalink / raw)
  To: Raymond Mao, Caleb Connolly, Adriano Cordova, Michal Simek,
	Udit Kumar, Simon Glass, Devarsh Thakkar, Hari Nagalla,
	Manorit Chawdhry, Santhosh Kumar K, Neha Malcom Francis,
	Daniel Schultz, Neil Armstrong, Aashvij Shenai, Roger Quadros,
	Jonathan Humphreys, Ilias Apalodimas, Heinrich Schuchardt,
	Bryan Brattlof, Vignesh Raghavendra, Wadim Egorov, Tom Rini,
	Robert Nelson, Nishanth Menon, Sughosh Ganu, Mattijs Korpershoek,
	Rasmus Villemoes, Lukasz Majewski, s-vadapalli
  Cc: u-boot

For capsule update, explicitly set the dfu_alt_info environment variable
before the DFU operation, and then restore it to the original value.
Previously, the dfu_alt_info environment variable was set with the
set_dfu_alt_info() function.

The problem with setting the capsule update's dfu_alt_info setting in
set_dfu_alt_info() is that set_dfu_alt_info() lacks the context of what DFU
operation is being performed (eg, capsule update, DFU boot, listing the
alt_info, etc) so the capsule update setting was overwriting the setting
for other DFU operations.

Changes from v1:
- use log_err() instead of pr_err()
- create a local copy of the original dfu_alt_info environment variable to
  be used to later restore it, rather than just a pointer to the stored
  value, because changing its value to the EFI capsule update setting will
  cause the original string location to be freed.
- even in the case of a DFU operation error, restore the dfu_alt_info
  environment variable to its original value.
- return EFI_EXIT based error codes if setting environment variables fails
Link to v1: https://lore.kernel.org/r/20250203215351.2840144-1-j-humphreys@ti.com

Changes from v2:
- add patch for xilinx boards to set the dfu_string member with the created
  dfu_alt_info string for capsule updates
Link to v2: https://lore.kernel.org/r/20250206154719.3032322-1-j-humphreys@ti.com

Changes from v3:
- in case that the dfu_alt_info env variable is set and we save a copy
  using strdup(), check that strdup() doesn't fail
- separate the reporting of an error due to the DFU operation from failure
  to restore the dfu_alt_info environment variable. In the latter case,
  just emit a warning and return success for the DFU operation.
Link to v3: https://lore.kernel.org/r/20250213195351.3518305-1-j-humphreys@ti.com

Tested-by: Michal Simek <michal.simek@amd.com>

Jonathan Humphreys (2):
  efi_firmware: set EFI capsule dfu_alt_info env explicitly
  board: remove capsule update support in set_dfu_alt_info()

Michal Simek (1):
  xilinx: dfu: Fill directly update_info.dfu_string

 board/beagle/beagleboneai64/beagleboneai64.c  |  8 ---
 board/beagle/beagleplay/beagleplay.c          |  8 ---
 .../aml-a311d-cc/aml-a311d-cc.c               |  2 -
 .../aml-s805x-ac/aml-s805x-ac.c               |  2 -
 .../aml-s905d3-cc/aml-s905d3-cc.c             |  2 -
 board/phytec/common/k3/board.c                |  8 ---
 board/ti/am62px/evm.c                         |  8 ---
 board/ti/am62x/evm.c                          |  8 ---
 board/ti/am64x/evm.c                          |  8 ---
 board/ti/j721e/evm.c                          |  8 ---
 board/ti/j784s4/evm.c                         |  8 ---
 board/xilinx/common/board.h                   |  3 +
 board/xilinx/versal/board.c                   | 16 +++---
 board/xilinx/zynq/board.c                     | 16 +++---
 board/xilinx/zynqmp/zynqmp.c                  | 16 +++---
 lib/efi_loader/Kconfig                        |  2 -
 lib/efi_loader/efi_firmware.c                 | 56 ++++++++++++++++---
 17 files changed, 72 insertions(+), 107 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-04-09 21:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 22:35 [PATCH v4 0/3] EFI Capsule update explicitly sets dfu_alt_info Jonathan Humphreys
2025-02-26 22:35 ` [PATCH v4 1/3] xilinx: dfu: Fill directly update_info.dfu_string Jonathan Humphreys
2025-02-28 14:33   ` Heinrich Schuchardt
2025-02-28 15:41     ` Michal Simek
2025-02-28 15:46       ` Heinrich Schuchardt
2025-02-28 18:15         ` Jon Humphreys
2025-03-03 14:02           ` Michal Simek
2025-02-26 22:35 ` [PATCH v4 2/3] efi_firmware: set EFI capsule dfu_alt_info env explicitly Jonathan Humphreys
2025-03-12  6:40   ` Ilias Apalodimas
2025-02-26 22:35 ` [PATCH v4 3/3] board: remove capsule update support in set_dfu_alt_info() Jonathan Humphreys
2025-02-27  5:07   ` Wadim Egorov
2025-04-09 14:52 ` [PATCH v4 0/3] EFI Capsule update explicitly sets dfu_alt_info Michal Simek
2025-04-09 21:36   ` Jon Humphreys

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox