Skip to contentSkip to conversation

efi: stop hw watchdog during EBS

PATCH Superseded Casey Connolly 1 participant 1 message Jan 19

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: stop hw watchdog during EBS

Hardware watchdogs don't currently get stopped as part of ExitBootServices, this can result in resets during boot if the OS doesn't have a driver for the watchdog, or if the driver isn't loaded in time.

As with the EFI watchdog, stop any hardware watchdogs as well.

---
 lib/efi_loader/efi_boottime.c | 2 ++
 1 file changed, 2 insertions(+)
lib/efi_loader/efi_boottime.c +2 -0
index ddc935d22409..2df6d2c7954a 100644
@@ -21,8 +21,9 @@
 #include <time.h>
 #include <u-boot/crc.h>
 #include <usb.h>
 #include <watchdog.h>
+#include <wdt.h>
 #include <asm/global_data.h>
 #include <linux/libfdt_env.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -2263,8 +2264,9 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
 	efi_update_table_header_crc32(&systab.hdr);
 
 	/* Give the payload some time to boot */
 	efi_set_watchdog(0);
+	wdt_stop_all();
 	schedule();
 out:
 	if (IS_ENABLED(CONFIG_EFI_TCG2_PROTOCOL)) {
 		if (ret != EFI_SUCCESS)
Signature · 1 line
2.52.0