From: Michal Simek Date: Thu, 2 Apr 2026 15:37:00 +0000 (+0200) Subject: fwu: Move boottime checks to EVT_POST_PREBOOT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=353166279c32216697025b80df83fc260155251d;p=thirdparty%2Fu-boot.git fwu: Move boottime checks to EVT_POST_PREBOOT Switch fwu_boottime_checks() from EVT_MAIN_LOOP to EVT_POST_PREBOOT because there is no reason to call FWU so early. FWU triggers EFI stack initialization before all devices are visible which prevents the EFI stack from scanning these devices and adding them to EFI variables. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c index 37c613014d1..e82600a29a4 100644 --- a/lib/fwu_updates/fwu.c +++ b/lib/fwu_updates/fwu.c @@ -796,4 +796,4 @@ static int fwu_boottime_checks(void) return 0; } -EVENT_SPY_SIMPLE(EVT_MAIN_LOOP, fwu_boottime_checks); +EVENT_SPY_SIMPLE(EVT_POST_PREBOOT, fwu_boottime_checks); diff --git a/test/dm/fwu_mdata.c b/test/dm/fwu_mdata.c index 643b647af0a..cfe543d8a23 100644 --- a/test/dm/fwu_mdata.c +++ b/test/dm/fwu_mdata.c @@ -100,7 +100,7 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts) * Trigger lib/fwu_updates/fwu.c fwu_boottime_checks() * to populate g_dev global pointer in that library. */ - ut_assertok(event_notify_null(EVT_MAIN_LOOP)); + ut_assertok(event_notify_null(EVT_POST_PREBOOT)); ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev)); ut_assertok(fwu_init()); @@ -127,7 +127,7 @@ static int dm_test_fwu_mdata_write(struct unit_test_state *uts) * Trigger lib/fwu_updates/fwu.c fwu_boottime_checks() * to populate g_dev global pointer in that library. */ - ut_assertok(event_notify_null(EVT_MAIN_LOOP)); + ut_assertok(event_notify_null(EVT_POST_PREBOOT)); ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));