From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A2CDC433EF for ; Tue, 9 Nov 2021 10:19:26 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 837D4610A0 for ; Tue, 9 Nov 2021 10:19:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 837D4610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D12EA8390F; Tue, 9 Nov 2021 11:19:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="mx8bVt4a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C719835CB; Tue, 9 Nov 2021 11:19:12 +0100 (CET) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D2389836CE for ; Tue, 9 Nov 2021 11:19:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-88-152-144-157.hsi03.unitymediagroup.de [88.152.144.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 520594004D; Tue, 9 Nov 2021 10:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636453148; bh=VhitZHNmver3V+xO4BMvpbfFiFvg3GnUKjWnBSstuOg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mx8bVt4aHN5YkCnCIps9ivPvISyghBm7whU1pchj0rTAoLCDRUkAQ2OTQRo5tWuB6 KChTmKyJz7+llorRFHE0JS+VrDcTnxtko9H/4lzNbKQnU1oFL94ZsMhS0FrHJaLvQu V/RtMQ4k8kCCRKVs2/KEBxhFRwviQB4z5n/v8MdmFWaFCSbIp/s9lQE7BH6ZV2KHab iXTKqA/P2yXC0+/keebIW9VzTK0dosdpuqIevuUCo53b42Lrf85+mudKlwRtKTrmlC 7WhIn5fLJ+ULfN/4vkDdm41I+we1s5T8zZjiOoiNzkopxN9Suf54/xwo+iO0tGGVnT h+1IrUyB1rTgg== From: Heinrich Schuchardt To: u-boot@lists.denx.de Cc: Andre Przywara , Heinrich Schuchardt , Alexander Graf , Heinrich Schuchardt Subject: [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices() Date: Tue, 9 Nov 2021 11:19:01 +0100 Message-Id: <20211109101901.24015-2-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211109101901.24015-1-heinrich.schuchardt@canonical.com> References: <20211109101901.24015-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The UEFI specification requires for ExitBootServices() that "the boot services watchdog timer is disabled". We already disable the software watchdog. We should additionally disable the hardware watchdogs. Reported-by: Andre Przywara Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_boottime.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 1823990d9b..e33821c93a 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -2166,6 +2167,11 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, /* Fix up caches for EFI payloads if necessary */ efi_exit_caches(); + /* Disable watchdogs */ + efi_set_watchdog(0); + if IS_ENABLED(CONFIG_WDT) + wdt_stop_all(); + /* This stops all lingering devices */ bootm_disable_interrupts(); @@ -2181,9 +2187,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, /* Recalculate CRC32 */ efi_update_table_header_crc32(&systab.hdr); - /* Give the payload some time to boot */ - efi_set_watchdog(0); - WATCHDOG_RESET(); out: if (IS_ENABLED(CONFIG_EFI_TCG2_PROTOCOL)) { if (ret != EFI_SUCCESS) -- 2.32.0