From patchwork Tue Sep 30 00:51:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 449 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759193558; bh=fGBb3vIikT2k1C8r1eZ3FiL1/zxMs65XWPFV3uOZaVw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ItjokkK79HZWu9KMwBC0vAVSwGBFeEY6EmFgxT4c1jMJSeWi/XvjTU5k2O0CWHtZ5 DJMYOeJuBubk1oUd8FjQX66/NasWjMfZYqwaPgnT6K/qT9vzEFEFjg4rkH0Nhtbo4g jnPEe6ViefBjJ3zfQ4QtskrY00X3n/Pk4QtPJSEkO4u4pUkhjG7S9IbJ+746wceh8G 36tKLL6KKOrsTnWWJH48NdMB2dxME95jbFPNoy1tUjrsU9JmW5RRl0x26M1H9QA5sD X2D6J6wXfb7aulXXhZRChczlCqwq6o55FfV/+BHySgy8LX1u+NqBzWI398EQkxSbMY EvLgWiAiFg7YA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A7E567E59 for ; Mon, 29 Sep 2025 18:52:38 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xLAHt4Z3SycV for ; Mon, 29 Sep 2025 18:52:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759193558; bh=fGBb3vIikT2k1C8r1eZ3FiL1/zxMs65XWPFV3uOZaVw=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ItjokkK79HZWu9KMwBC0vAVSwGBFeEY6EmFgxT4c1jMJSeWi/XvjTU5k2O0CWHtZ5 DJMYOeJuBubk1oUd8FjQX66/NasWjMfZYqwaPgnT6K/qT9vzEFEFjg4rkH0Nhtbo4g jnPEe6ViefBjJ3zfQ4QtskrY00X3n/Pk4QtPJSEkO4u4pUkhjG7S9IbJ+746wceh8G 36tKLL6KKOrsTnWWJH48NdMB2dxME95jbFPNoy1tUjrsU9JmW5RRl0x26M1H9QA5sD X2D6J6wXfb7aulXXhZRChczlCqwq6o55FfV/+BHySgy8LX1u+NqBzWI398EQkxSbMY EvLgWiAiFg7YA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 38A3367E15 for ; Mon, 29 Sep 2025 18:52:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759193555; bh=PEGg5oBRSfxK+6jJfOFk493Ih7AC+0swaLDzqC7p820=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HEvgiCdAIfUPiW6q4WxF3hUsic7MG4zSsrQ4fO4La1snBhT9NJiB1C3ZVHk4H42VH +FeBQs6yLmP5PIchACKw9++pnoCHRoIA4wg8JDW/cGDUhjqrN+pDiaiXMvsIKYb7Rn tG4ei59ebF0qJ9h2WYGznYcCawnjdQncS4bU3ACDCE8ynTisUQVegMDwPw5UdgjWvs LGp7RHMB1Gi+ZChBrPHdB+MGMgn6XnMo188xGUrEH37x9rMBM9Dx6RugoDmJy44mqA yImzHjkhS74fNetw6f3cilnHWwyrmc25haPcR58awd1feZ7nYxnpJTQ4kQf37blv4A uaGg5s61dzeWg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE08367E00; Mon, 29 Sep 2025 18:52:35 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id fF8ivq3JykDT; Mon, 29 Sep 2025 18:52:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759193550; bh=hBAtCZjGiLmmuwQZIQOCItInlO/9wMLYpnh87bWEmJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gpKCQnXmr720DJB01V7xKUTo5mK+UaNeGYh/YH545iy6ptrCGgtLtmQ8k7IAuFzLH XHa5LSoHuAg1c1Zs+xyViKhvEddwXqpXsj3YViib684TJOak1lcAetHTKi6EinE4pZ TY3Y98gSsnyTxviBw2OeN94ke2Zc24e342hfo9S5k71MzMGkQOYQtpevHWbz9H2M5u yMN5BWOWr9KogyNgutt2Q3d9V3bzsueU98SWoRkTCSFCkJRn2Rj9agYCquam96OGMP GsvjzCj6UtDb+dECoBjkp/ePv9MnGwquzcH70Pe+QbHKHyF5cJzZ043hjeYV5a3Q9E ZR9Tj0nLTKsYw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 182F767B49; Mon, 29 Sep 2025 18:52:30 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 29 Sep 2025 18:51:29 -0600 Message-ID: <20250930005137.3650600-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250930005137.3650600-1-sjg@u-boot.org> References: <20250930005137.3650600-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BWV5HPSHLJH6BO6LXZ24IKYVS7JVYRCC X-Message-ID-Hash: BWV5HPSHLJH6BO6LXZ24IKYVS7JVYRCC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/15] boot: Run global bootmeths after all bootdevs are exhausted List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When there are no more bootdevs we should still go through the global bootmeths, since some may not have yet been used, if their priority has not yet come up. Add a final check for this at the end of the iterator. Signed-off-by: Simon Glass --- boot/bootflow.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/boot/bootflow.c b/boot/bootflow.c index e58c55ebf19..9769a8a5f74 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -417,6 +417,18 @@ static int iter_incr(struct bootflow_iter *iter) return 0; } + /* if this was the final global bootmeth check, we are done */ + if (iter->cur_prio == BOOTDEVP_COUNT) { + log_debug("-> done global bootmeths\n"); + + /* print the same message as bootflow_iter_set_dev() */ + if ((iter->flags & (BOOTFLOWIF_SHOW | + BOOTFLOWIF_SINGLE_DEV)) == + BOOTFLOWIF_SHOW) + printf("No more bootdevs\n"); + return BF_NO_MORE_DEVICES; + } + /* * Don't move to the next dev as we haven't tried this * one yet! @@ -530,6 +542,17 @@ static int iter_incr(struct bootflow_iter *iter) ret = prepare_bootdev(iter, dev, method_flags, true); } + if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && ret) { + log_debug("no more bootdevs, trying global\n"); + + /* allow global bootmeths with any priority */ + iter->cur_prio = BOOTDEVP_COUNT; + if (!next_glob_bootmeth(iter)) { + log_debug("-> next method '%s'\n", iter->method->name); + return 0; + } + } + /* if there are no more bootdevs, give up */ if (ret) { log_debug("-> no more bootdevs\n");