summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-10-15 16:44:10 +0100
committerTom Rini <[email protected]>2025-10-22 14:16:56 -0600
commite52053c93c128284ccfae11001d7b211bb081aeb (patch)
tree1aed5e9972516bd0c1ffe2ec021f41cfadda1575 /boot
parent8e31093dbce4fb233c6f14520149293b92981b50 (diff)
boot: Only run global bootmeths once each
Use the methods_done flags to make sure that each global bootmeth is only used once. For now this has no effect, since they are all processed at the start. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
-rw-r--r--boot/bootflow.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c
index 73deba24d30..ca1fe741bab 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -294,7 +294,13 @@ static int iter_incr(struct bootflow_iter *iter)
return BF_NO_MORE_DEVICES;
/* Get the next boothmethod */
- if (++iter->cur_method < iter->num_methods) {
+ for (iter->cur_method++; iter->cur_method < iter->num_methods;
+ iter->cur_method++) {
+ /* loop until we find a global bootmeth we haven't used */
+ if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && iter->doing_global &&
+ !bootmeth_glob_allowed(iter, iter->cur_method))
+ continue;
+
iter->method = iter->method_order[iter->cur_method];
return 0;
}