summaryrefslogtreecommitdiff
path: root/lib/fwu_updates
diff options
context:
space:
mode:
authorKory Maincent <[email protected]>2026-01-19 17:07:42 +0100
committerIlias Apalodimas <[email protected]>2026-02-11 12:17:18 +0200
commit9367b8d9339f07d83aceaf03fcd89bff9d59f727 (patch)
treeb77fd3960175adb82df533edcb8baf2510ecebe2 /lib/fwu_updates
parente8d9ad18f068f65537bc04779d6110a1058bfb1e (diff)
fwu: Mark failed bank as invalid during rollback
When boot_idx differs from active_idx at boot time, it indicates a rollback scenario where the firmware update failed and the system reverted to the previous working bank. In this case, mark the failed bank (active_idx) as invalid to prevent future boot attempts from that bank. Signed-off-by: Kory Maincent <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'lib/fwu_updates')
-rw-r--r--lib/fwu_updates/fwu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c
index 0f5ef2ba515..37c613014d1 100644
--- a/lib/fwu_updates/fwu.c
+++ b/lib/fwu_updates/fwu.c
@@ -766,6 +766,12 @@ static int fwu_boottime_checks(void)
if (boot_idx != active_idx) {
log_info("Boot idx %u is not matching active idx %u, changing active_idx\n",
boot_idx, active_idx);
+
+ ret = fwu_state_machine_updates(FWU_BANK_INVALID, active_idx);
+ if (ret)
+ log_err("Unable to set bank %u state as invalid",
+ active_idx);
+
ret = fwu_set_active_index(boot_idx);
if (!ret)
boottime_check = 1;