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 50D92C433F5 for ; Tue, 9 Nov 2021 10:19:16 +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 92EBA610C8 for ; Tue, 9 Nov 2021 10:19:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 92EBA610C8 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 5DF128362F; Tue, 9 Nov 2021 11:19:13 +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="j1h6C2zQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEAF38383A; Tue, 9 Nov 2021 11:19:11 +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 A37F2835CB 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 033283F32F; Tue, 9 Nov 2021 10:19:07 +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:MIME-Version; b=j1h6C2zQthEjwbVXrVXRwSee+sXH/gY0Q4h41Qj0SnC3b2ARKSbQvk3gACXos/upd tsCrZtP2+8DKx2J+4533jGA5/gyrmWE/QKBjYNsnnKJV0xRNgq5qWAoPd/U0RtWWWY 9jeU6hBEJGmQBVZIwb8WOB6clIhTIxDpvhSHxmf/KqP6l80YNxrKCv8LnduYgmnfK2 sXGQ7BQKDPq1+tWHm9PjeIQu7yUeG8H3gytuYWDZE0oNaXfhDYEolmbEYO2V4cAmJQ 7yaeKsZN+TJ74hDPIj6XN0LLyy5hbezoOr3nVUxzqA5v0m4Vhs2cy5d/ggyyta+tkY UpjULv18MjpmA== 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:00 +0100 Message-Id: <20211109101901.24015-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.32.0 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