[PATCH 1/2] efi: remove error in efi_disk_probe

Patrick Delaunay patrick.delaunay at foss.st.com
Wed Mar 8 14:26:47 CET 2023


EFI has no reason to block the dm core device_probe() in the callback
efi_disk_probe() registered with EVT_DM_POST_PROBE.

This patch avoids to have error in DM core on device_probe()

  ret = device_notify(dev, EVT_DM_POST_PROBE);

only because EFI is not able to create its instance/handle.

For example on usb start, when the SAME KEY (PID/VID) is present on
2 ports of the USB HUB, the 2nd key have the same EFI device path
with the call stack:

efi_disk_probe()
	efi_disk_create_raw()
		efi_disk_add_dev()
			efi_install_multiple_protocol_interfaces()
				EFI_ALREADY_STARTED

In case of error in probe, the 2nd key is unbound and deactivated for
the next usb commands even if the limitation is only for EFI.

This patch removes any return error in probe event callback;
if something occurs in EFI registration, the device is still probed.

Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
---

 lib/efi_loader/efi_disk.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index d2256713a8e7..8d53ba3bd27e 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -677,14 +677,18 @@ int efi_disk_probe(void *ctx, struct event *event)
 	desc = dev_get_uclass_plat(dev);
 	if (desc->uclass_id != UCLASS_EFI_LOADER) {
 		ret = efi_disk_create_raw(dev, agent_handle);
-		if (ret)
-			return -1;
+		if (ret) {
+			log_err("efi_disk_create_raw %s failed (%d)\n",
+				dev->name, ret);
+			return 0;
+		}
 	}
 
 	device_foreach_child(child, dev) {
 		ret = efi_disk_create_part(child, agent_handle);
 		if (ret)
-			return -1;
+			log_err("efi_disk_create_part %s failed (%d)\n",
+				dev->name, ret);
 	}
 
 	return 0;
-- 
2.25.1



More information about the U-Boot mailing list