]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Revert "bootdev: avoid infinite probe loop"
authorSimon Glass <sjg@chromium.org>
Thu, 15 Aug 2024 20:30:21 +0000 (14:30 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 27 Aug 2024 16:09:07 +0000 (10:09 -0600)
This turns out to be insufficient to fix the problem, since when
bootdev_next_prio() exits, the caller has no idea that this really
is the end. Nor is it, since there may be other devices which should
be checked.

The caller iterates which calls iter_incr() which calls
bootdev_next_prio() again, which finds the same device and the loop
continues.

We never did create a test for this[1], which makes it hard to be
sure which problem was fixed.

The original code had the virtue of staying in the loop looking for a
bootdev, so let's go back to that and try to fix this another way.

A future patch will make bootdev_next_prio() continue after failure
which should provide same effect.

This reverts commit 9d92c418acfb7576e12e2bd53fed294bb9543724.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/bootdev-uclass.c

index 7c7bba088c999f96862b6bb76616e9d0c3e6b13a..15a8a3555c69d3c70961e960fe8498109ba5005c 100644 (file)
@@ -632,7 +632,7 @@ int bootdev_next_label(struct bootflow_iter *iter, struct udevice **devp,
 
 int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp)
 {
-       struct udevice *dev = *devp, *last_dev = NULL;
+       struct udevice *dev = *devp;
        bool found;
        int ret;
 
@@ -682,19 +682,9 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp)
                        }
                } else {
                        ret = device_probe(dev);
-                       if (!ret)
-                               last_dev = dev;
                        if (ret) {
-                               log_warning("Device '%s' failed to probe\n",
+                               log_debug("Device '%s' failed to probe\n",
                                          dev->name);
-                               if (last_dev == dev) {
-                                       /*
-                                        * We have already tried this device
-                                        * and it failed to probe. Give up.
-                                        */
-                                       return log_msg_ret("probe", ret);
-                               }
-                               last_dev = dev;
                                dev = NULL;
                        }
                }