[PATCH] boot/bootm: Disable interrupts after loading the image

J. Neuschäfer via B4 Relay devnull+j.ne.posteo.net at kernel.org
Sun Mar 29 17:17:33 CEST 2026


From: "J. Neuschäfer" <j.ne at posteo.net>

Interrupts need to be disabled before we jump into the OS, but currently
they're already disabled before we load/uncompress the image. This has
the inconvenient side effect of taking up a part of the watchdog time
budget, which can be rather large when the image is big. Ideally, we
want to leave a full watchdog time slice for the OS, so that it has
enough time to initialize its own watchdog driver. To ease the pressure,
disable interrupts (and with it, a timer interrupt that could service
the watchdog) after loading/uncompressing the OS image.

Signed-off-by: J. Neuschäfer <j.ne at posteo.net>
---
 boot/bootm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 4bdca22ea8c..fa4b53050b7 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1015,7 +1015,6 @@ int bootm_run_states(struct bootm_info *bmi, int states)
 
 	/* Load the OS */
 	if (!ret && (states & BOOTM_STATE_LOADOS)) {
-		iflag = bootm_disable_interrupts();
 		ret = bootm_load_os(images, 0);
 		if (ret && ret != BOOTM_ERR_OVERLAP)
 			goto err;
@@ -1044,6 +1043,8 @@ int bootm_run_states(struct bootm_info *bmi, int states)
 	}
 #endif
 
+	iflag = bootm_disable_interrupts();
+
 	/* From now on, we need the OS boot function */
 	if (ret)
 		return ret;

---
base-commit: eb95914b9f5886b7ca0eaa2dbcd8a66bb8e5f81a
change-id: 20260329-bootm-wdt-c51187618e62

Best regards,
-- 
J. Neuschäfer <j.ne at posteo.net>




More information about the U-Boot mailing list