]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
boot: Try all bootmeths on the final partition
authorSimon Glass <sjg@chromium.org>
Wed, 15 Oct 2025 15:44:04 +0000 (16:44 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 22 Oct 2025 20:16:56 +0000 (14:16 -0600)
At present, normally when one bootmeth fails on a partition, we move on
and try the next bootmeth. However, this was not the case for the final
partition due to a bug. Rework the logic so that all partitions are
treated the same.

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

index 7ed076c898f45f06446016b9148b89d12d1dfc88..deb5f42ba656f635892f1e2793c3be4d337e2702 100644 (file)
@@ -221,27 +221,25 @@ static int iter_incr(struct bootflow_iter *iter)
        if (iter->err == BF_NO_MORE_DEVICES)
                return BF_NO_MORE_DEVICES;
 
-       if (iter->err != BF_NO_MORE_PARTS) {
-               /* Get the next boothmethod */
-               if (++iter->cur_method < iter->num_methods) {
-                       iter->method = iter->method_order[iter->cur_method];
-                       return 0;
-               }
+       /* Get the next boothmethod */
+       if (++iter->cur_method < iter->num_methods) {
+               iter->method = iter->method_order[iter->cur_method];
+               return 0;
+       }
+
+       /*
+        * If we have finished scanning the global bootmeths, start the
+        * normal bootdev scan
+        */
+       if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && global) {
+               iter->num_methods = iter->first_glob_method;
+               iter->doing_global = false;
 
                /*
-                * If we have finished scanning the global bootmeths, start the
-                * normal bootdev scan
+                * Don't move to the next dev as we haven't tried this
+                * one yet!
                 */
-               if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && global) {
-                       iter->num_methods = iter->first_glob_method;
-                       iter->doing_global = false;
-
-                       /*
-                        * Don't move to the next dev as we haven't tried this
-                        * one yet!
-                        */
-                       inc_dev = false;
-               }
+               inc_dev = false;
        }
 
        if (iter->flags & BOOTFLOWIF_SINGLE_PARTITION)