summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/bootflow.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c
index 1a4cd0e28e8..38b8af916b2 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -304,9 +304,20 @@ static int iter_incr(struct bootflow_iter *iter)
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;
+ if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && iter->doing_global) {
+ if (!bootmeth_glob_allowed(iter, iter->cur_method))
+ continue;
+
+ iter->method = iter->method_order[iter->cur_method];
+ log_debug("-> next global method '%s'\n",
+ iter->method->name);
+ return 0;
+ }
+
+ /* at this point we are only considering non-global bootmeths */
+ if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && iter->have_global &&
+ iter->cur_method >= iter->first_glob_method)
+ break;
iter->method = iter->method_order[iter->cur_method];
return 0;
@@ -317,7 +328,6 @@ static int iter_incr(struct bootflow_iter *iter)
* normal bootdev scan
*/
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && global) {
- iter->num_methods = iter->first_glob_method;
iter->doing_global = false;
/*