diff mbox series

[U-Boot,v3,05/21] efi: Add a TODO to efi_init_obj_list()

Message ID 20180219154827.215990-6-sjg@chromium.org
State Superseded
Delegated to: Alexander Graf
Headers show
Series efi: Enable basic sandbox support for EFI loader | expand

Commit Message

Simon Glass Feb. 19, 2018, 3:48 p.m. UTC
This function repeats data structures provided by driver model. They are
only created once so can be stale if the EFI loader is called twice (e.g.
for testing or on boot failure).

Add a TODO to address this. It should be possible to attach EFI devices
and data structures to driver-model devices and avoid having a parallel
set of data structures.

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

Changes in v3: None
Changes in v2: None

 cmd/bootefi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Heinrich Schuchardt March 12, 2018, 8:54 p.m. UTC | #1
On 02/19/2018 04:48 PM, Simon Glass wrote:
> This function repeats data structures provided by driver model. They are
> only created once so can be stale if the EFI loader is called twice (e.g.
> for testing or on boot failure).
> 
> Add a TODO to address this. It should be possible to attach EFI devices
> and data structures to driver-model devices and avoid having a parallel
> set of data structures.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v3: None
> Changes in v2: None
> 
>  cmd/bootefi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index 259f80a0d8..d670a541eb 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -30,6 +30,10 @@ static struct efi_device_path *bootefi_device_path;
>  /**
>   * efi_init_obj_list() - Initialize and populate EFI object list
>   *
> + * TODO(sjg@chromium.org): Move this to a dynamic list based on driver model,
> + * so that it does not need to be created before running EFI applications
> + * and updates when devices change.

This could be implemented by calling the ConnectController and
DisconnectController boot services and adding the necessary EFI drivers
to the EFI uclass (see directory lib/efi_driver/).

Best regards

Heinrich

> + *
>   * @return 0 if OK, -ve on error (in which case it prints a message)
>   */
>  static efi_status_t efi_init_obj_list(void)
>
diff mbox series

Patch

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 259f80a0d8..d670a541eb 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -30,6 +30,10 @@  static struct efi_device_path *bootefi_device_path;
 /**
  * efi_init_obj_list() - Initialize and populate EFI object list
  *
+ * TODO(sjg@chromium.org): Move this to a dynamic list based on driver model,
+ * so that it does not need to be created before running EFI applications
+ * and updates when devices change.
+ *
  * @return 0 if OK, -ve on error (in which case it prints a message)
  */
 static efi_status_t efi_init_obj_list(void)