From 15cc283d1ba4f0821bf96dd709cc805513746da7 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 18 May 2026 16:32:05 -0600 Subject: bootdev: Fix the case where the driver ops field is null. In the case where a bootdev does not have a custom get_bootflow function but instead relies on default_get_bootflow to provide one, bootdev_get_bootflow was not handling the case where ops was simply not set. Restructure the function to check for "ops && ops->get_bootflow" and add appropriate log_debug calls for both cases. Signed-off-by: Tom Rini --- boot/bootdev-uclass.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'boot/bootdev-uclass.c') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 3f8dc2c3c4e..657804949f8 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -566,13 +566,18 @@ int bootdev_get_bootflow(struct udevice *dev, struct bootflow_iter *iter, { const struct bootdev_ops *ops = bootdev_get_ops(dev); - log_debug("->get_bootflow %s,%x=%p\n", dev->name, iter->part, - ops->get_bootflow); bootflow_init(bflow, dev, iter->method); - if (!ops->get_bootflow) - return default_get_bootflow(dev, iter, bflow); - return ops->get_bootflow(dev, iter, bflow); + if (ops && ops->get_bootflow) { + log_debug("->get_bootflow %s,%x=%p\n", dev->name, iter->part, + ops->get_bootflow); + + return ops->get_bootflow(dev, iter, bflow); + } + + log_debug("->get_bootflow %s,%x is unset\n", dev->name, iter->part); + + return default_get_bootflow(dev, iter, bflow); } int bootdev_next_label(struct bootflow_iter *iter, struct udevice **devp, -- cgit v1.3.1 From 264ba13f14767fbe7a881d25167d305fa5d7f6b6 Mon Sep 17 00:00:00 2001 From: Denis Mukhin Date: Tue, 23 Jun 2026 15:06:29 -0700 Subject: bootdev: scan boot devices at each priority level Currently, default 'bootflow scan -lb' will stop booting the board if any of higher-priority bootdevs fail to be hunted even if there are bootdevs of lower priority. For example, if the board has both NVMe (priority 4) and USB MSD devices (priority 5), and if NVMe bootdev hunt fails (in the event of a bad NVMe firmware update), USB (which may be a recovery bootdev) is never hunted automatically, leaving the board at the U-Boot prompt (user intervention is needed, e.g. something like 'bootflow scan usb' to hunt USB). Fix bootdev_next_prio() to scan bootdevs at the lower priority level by not exiting the scan loop early. Keep the existing logging verbosity unchanged and rely on the failing subsystem to provide a suitable diagnostic message. Signed-off-by: Denis Mukhin Reviewed-by: Simon Glass --- boot/bootdev-uclass.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'boot/bootdev-uclass.c') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 657804949f8..55e1a6c4e02 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -669,8 +669,6 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp) BOOTFLOWIF_SHOW); log_debug("- bootdev_hunt_prio() ret %d\n", ret); - if (ret) - return log_msg_ret("hun", ret); } } else { ret = device_probe(dev); -- cgit v1.3.1