]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Revert "bootstd: Scan all bootdevs in a boot_targets entry"
authorSimon Glass <sjg@chromium.org>
Mon, 23 Oct 2023 07:02:10 +0000 (00:02 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 23 Oct 2023 17:05:13 +0000 (13:05 -0400)
This commit was intended to allow all bootdevs in each boot_targets
entry to be scanned. However it causes bad ordering with bootdevs, e.g.
scanning Ethernet bootdevs when it should be keeping to mmc.

Revert it so we can try another approach.

This reverts commit e824d0d0c219bc6da767f13f90c5b00eefe929f0.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Ivan T.Ivanov <iivanov@suse.de>
boot/bootdev-uclass.c
boot/bootflow.c
test/boot/bootdev.c

index 44ae98a9269cc65ff5438b3568e8b14f840c97a6..974ddee5d2faa05af687dab16f99ab4065a31f08 100644 (file)
@@ -469,11 +469,10 @@ int bootdev_find_by_label(const char *label, struct udevice **devp,
                         * if no sequence number was provided, we must scan all
                         * bootdevs for this media uclass
                         */
-                       if (seq == -1)
+                       if (IS_ENABLED(CONFIG_BOOTSTD_FULL) && seq == -1)
                                method_flags |= BOOTFLOW_METHF_SINGLE_UCLASS;
                        if (method_flagsp)
                                *method_flagsp = method_flags;
-                       log_debug("method flags %x\n", method_flags);
                        return 0;
                }
                log_debug("- no device in %s\n", media->name);
index e03932e65a74e1a1ecdef0b2ec382a70a238ca27..6ef62e1d1896637d1feaf127e0def36c7a341e3d 100644 (file)
@@ -260,25 +260,8 @@ static int iter_incr(struct bootflow_iter *iter)
                } else {
                        log_debug("labels %p\n", iter->labels);
                        if (iter->labels) {
-                               /*
-                                * when the label is "mmc" we want to scan all
-                                * mmc bootdevs, not just the first. See
-                                * bootdev_find_by_label() where this flag is
-                                * set up
-                                */
-                               if (iter->method_flags & BOOTFLOW_METHF_SINGLE_UCLASS) {
-                                       uclass_next_device(&dev);
-                                       log_debug("looking for next device %s: %s\n",
-                                                 iter->dev->name,
-                                                 dev ? dev->name : "<none>");
-                               } else {
-                                       dev = NULL;
-                               }
-                               if (!dev) {
-                                       log_debug("looking at next label\n");
-                                       ret = bootdev_next_label(iter, &dev,
-                                                                &method_flags);
-                               }
+                               ret = bootdev_next_label(iter, &dev,
+                                                        &method_flags);
                        } else {
                                ret = bootdev_next_prio(iter, &dev);
                                method_flags = 0;
index c5f14a7a1323257328bccb2bccc06ff421383f57..6b29213416db931b71a5a55fb590692a40704a24 100644 (file)
@@ -221,16 +221,6 @@ static int bootdev_test_order(struct unit_test_state *uts)
        ut_asserteq_str("mmc2.bootdev", iter.dev_used[1]->name);
        bootflow_iter_uninit(&iter);
 
-       /* Make sure it scans a bootdevs in each target */
-       ut_assertok(env_set("boot_targets", "mmc spi"));
-       ut_asserteq(0, bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
-       ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
-       ut_asserteq(3, iter.num_devs);
-       ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
-       ut_asserteq_str("mmc1.bootdev", iter.dev_used[1]->name);
-       ut_asserteq_str("mmc0.bootdev", iter.dev_used[2]->name);
-       bootflow_iter_uninit(&iter);
-
        return 0;
 }
 BOOTSTD_TEST(bootdev_test_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);