From patchwork Tue Sep 30 23:25:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 465 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=1759274835; bh=pfkrY4V5BRJclwxtoAAM+bDwxt00+pycULPHwQCtQnQ=; 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=UdBKDj15AvMnyW4cL7k9hh4JiJaePy8WMRyXB5LCf7zmUGmhVwQKnHoc+UhHzV5Ri wkQxGE45v8OApTQKXSSUUlb00vmTOAFq0oZeHkudlmdTlYv3aqoSj1yStzxMaoOFnm Kpls555MtuY94DYzw3SiKLmMFmhUx2Sku0+py9vnT1Flr2HW0XU6ruBwdNeOp0izvj hwdiJqHbwKGqgZG++1pqDBD3GjbIKOTo5xFrDgsT328V33qVngpkbcn+gKP4lRgI2B HSKILB126AoCC35Z4KBhPZmp+sPQukwH9ecRucoWIpYe349bpBubbo1wMkotvmZdGR uiMugZRHoZklA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AB59567E2D for ; Tue, 30 Sep 2025 17:27:15 -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 x2N34eCKQaQY for ; Tue, 30 Sep 2025 17:27:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759274835; bh=pfkrY4V5BRJclwxtoAAM+bDwxt00+pycULPHwQCtQnQ=; 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=UdBKDj15AvMnyW4cL7k9hh4JiJaePy8WMRyXB5LCf7zmUGmhVwQKnHoc+UhHzV5Ri wkQxGE45v8OApTQKXSSUUlb00vmTOAFq0oZeHkudlmdTlYv3aqoSj1yStzxMaoOFnm Kpls555MtuY94DYzw3SiKLmMFmhUx2Sku0+py9vnT1Flr2HW0XU6ruBwdNeOp0izvj hwdiJqHbwKGqgZG++1pqDBD3GjbIKOTo5xFrDgsT328V33qVngpkbcn+gKP4lRgI2B HSKILB126AoCC35Z4KBhPZmp+sPQukwH9ecRucoWIpYe349bpBubbo1wMkotvmZdGR uiMugZRHoZklA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 21BDD67E97 for ; Tue, 30 Sep 2025 17:27:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759274834; bh=uZeMIlqb9dC+1GTs7elGQPWV/17hU5XOUxJaYFFDpE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ki74/0cRdvL4bGxd+8C3cjUlBdYZ8G8qHF/DY6wQqOwRB5wRUndw1L2fH5z6fphid K81Iciul7Xm4zgBc62LgJd6m5Ydt3qOsqix8abK1MP+kVm6+6iAtAUySGDM+vnbgoG g7L4Biv8TW7nSUJ3KMaMzaeEYZyQZNuwHl+tvVBnDT3mZ+IBT+qzLo4m/yjdrLtAUT ZxmJE+7y4FUMCFztlAKB+lHlpBcpF7qJqpwJfZb9xEEjRR8dHKvKUKeOoHT2ASM0MX cMinHdg/E8OK3CLItmL1m7Kmhobe6DQa2cBtFnu6F6CNoFc6mZdM3JCfRMqGVe13x7 facXpjEGryR+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 144B767E2D; Tue, 30 Sep 2025 17:27:14 -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 rv-SiojwKRcw; Tue, 30 Sep 2025 17:27:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759274830; bh=BRtil7tllHKoDx0KPajjqzGQK0/pEB7dsIXy/8PLOxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvPbqAIAx650hmQxZpVd7L9Q45UlkqZ5vesqiLmy+tXen6H42BoWAeViISNQ69V+Q VUFLXvKXSdTCKYv4lyBK+tjr+q+mVRmnDrO83MyiteBrzIKIxNi07BUvAlqWZvdsT+ vCP6MNgkkYIgTyAYrTw2sFcL3Ouuoq3lvC1gOONzJHLCkHhmXN2bsmglfNr2WXWKvk l/OLepkfiQuVbB30qk1W0kwaeAC9fs8CjRcbDFMBe1AixUvkIUpAXTuU/yKtyKhRxt mml0wIxc+PsVv/zMPMv3/7lt1wYK1PKA1gqhB4yORWBHRIeeis+gqvNPiiJ2m4duop IoyS+E6BmU4UA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8498567E32; Tue, 30 Sep 2025 17:27:10 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 30 Sep 2025 17:25:51 -0600 Message-ID: <20250930232611.1564850-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250930232611.1564850-1-sjg@u-boot.org> References: <20250930232611.1564850-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZBOT3XP6L3AUGJJHI6S2TY7MGK2AQFUL X-Message-ID-Hash: ZBOT3XP6L3AUGJJHI6S2TY7MGK2AQFUL 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 v2 14/15] boot: Run the EFI bootmgr just before network devices 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 At present the EFI bootmgr scans all devices in the system before deciding which one to boot. Ideally it would use the bootstd iterator for this, but in the meantime, give it a lower priority, so it runs just before the network devices. Note that if there are no hunted network devices hunted, then it will run at the end, after all bootdevs are exhausted. In other words, it will always run. Signed-off-by: Simon Glass --- Changes in v2: - Update commit message to indicate the bootmeth will always run - Document how the priority was chosen boot/bootmeth_efi_mgr.c | 9 +++++++++ test/boot/bootflow.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c index 5e83d1da103..6e0ca02d0a4 100644 --- a/boot/bootmeth_efi_mgr.c +++ b/boot/bootmeth_efi_mgr.c @@ -99,6 +99,15 @@ static int bootmeth_efi_mgr_bind(struct udevice *dev) plat->desc = "EFI bootmgr flow"; plat->flags = BOOTMETHF_GLOBAL; + /* + * bootmgr scans all available devices which can take a while, + * especially for network devices. So choose the priority so that it + * comes just before the 'very slow' devices. This allows systems which + * don't rely on bootmgr to boot quickly, while allowing bootmgr to run + * on systems which need it. + */ + plat->glob_prio = BOOTDEVP_6_NET_BASE; + return 0; } diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index ceab3c453c4..65e2b5b5c9d 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -495,11 +495,11 @@ static int bootflow_system(struct unit_test_state *uts) ut_assertok(device_probe(dev)); sandbox_set_fake_efi_mgr_dev(dev, true); - /* We should get a single 'bootmgr' method at the start */ + /* We should get a single 'bootmgr' method at the end */ bootstd_clear_glob(); ut_assertok(run_command("bootflow scan -lH", 0)); ut_assert_skip_to_line( - " 0 efi_mgr ready (none) 0 "); + " 1 efi_mgr ready (none) 0 "); ut_assert_skip_to_line("No more bootdevs"); ut_assert_skip_to_line("(2 bootflows, 2 valid)"); ut_assert_console_end();