From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 127C5941B4B for ; Wed, 3 Jan 2024 20:44:26 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=eixXk1hDV2aX8ZlJyPVp1ngIC1GRTjulRGDDur2TTUI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704314665; v=1; b=V7mEoBbgd7AQyRQhlZ4G2HRd2yePRp49uBHSzu2Gs8WvLR1Uua8C4IbCWEm+XZT0KiVgaj27 qcmSXCBuSOSlTiqmpElNQPQvORtM6DEJMw/lqbdJY88nQ58AOGF5kKNI32+nZetW1Hnlpw+eiAM 8LIwJqx//4Rtwxk4noYn6DxM= X-Received: by 127.0.0.2 with SMTP id deZVYY7687511x3wf64OR6DP; Wed, 03 Jan 2024 12:44:25 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.131]) by mx.groups.io with SMTP id smtpd.web10.28992.1704314663228833425 for ; Wed, 03 Jan 2024 12:44:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gDuv/BgzFi9gqIFVkxJIC0899hijVPKYxmlyrymRNTMsQZnw+cjY03Ju0Ts2Ghi2CEBc3Yp7agf4W9vCXfNZahINX1u/0zFhSO4Cp/gb0l69s002aIEF/PyCNVYuAac821cAYUbqrR+UPYwr+Pk8I/spM6QKsTwqn4n9yY0IxhJshZanJInv5S89QtRSPiEQXnqxLkaP8xLQgOjBUwqXQ6kGZ1ZIThoGt/o7wvA+VUzlg6l31pyQDVRAe4jhoBq1FDOznHL0lL+pH1378seWLBVChgwCyBs27A5glVOMk2PpgjvzSjp7aTJRCWbnHE2c/8fTHkovNJCvLXGUXNyMuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=htnfs9Y23/ZulbNSacvPrbICvAb50OxPMqdLQYS2eaY=; b=NwxJXo5gYJPoZdiwJxqboXBXImfV++NkOgboJ9FI07JxXYynfUYkFY1sbhvaGReL2FcsxixVSva59DVxBJn8qLiGqnE6wPHlpwvqoGKLq5INyuv3T7NpWXmeH6uM36hQLJIuPSwCqk63c1AEgaHa9BJknua7bL50nP7jr2PHZZ12SHFhcIkOWU26ympwwBl0qVOw0eGJJkBewNjKRtnpskN3IIxOYiFbpVm7gvwO86D+W8waK9JFksRJXiGfIs+ipXWwPN2NgAk0tE6xQg/NbrUodxc2PwIGmZrzD890uXL855HrDNJttIcqkqKZ6jlu5RhfNT5yDmliEadvHulH6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none X-Received: from LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) by CH0PR01MB7139.prod.exchangelabs.com (2603:10b6:610:f6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 20:44:18 +0000 X-Received: from LV3PR01MB8464.prod.exchangelabs.com ([fe80::7748:d4a3:bcd9:14c1]) by LV3PR01MB8464.prod.exchangelabs.com ([fe80::7748:d4a3:bcd9:14c1%6]) with mapi id 15.20.7159.013; Wed, 3 Jan 2024 20:44:18 +0000 From: "Rebecca Cran via groups.io" To: Leif Lindholm , Ard Biesheuvel , Sami Mujawar CC: Rebecca Cran , devel@edk2.groups.io Subject: [edk2-devel] [PATCH 3/3] ArmPkg: Disable watchdog interaction after exiting boot services Date: Wed, 3 Jan 2024 13:43:53 -0700 Message-ID: <20240103204353.361541-4-rebecca@os.amperecomputing.com> In-Reply-To: <20240103204353.361541-1-rebecca@os.amperecomputing.com> References: <20240103204353.361541-1-rebecca@os.amperecomputing.com> X-ClientProxiedBy: CH2PR18CA0049.namprd18.prod.outlook.com (2603:10b6:610:55::29) To LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV3PR01MB8464:EE_|CH0PR01MB7139:EE_ X-MS-Office365-Filtering-Correlation-Id: 39a57ee2-6b74-4455-4e78-08dc0c9cc19a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: Rd3wyLdIemfIVk0LJW2MBSaYOTtNPXooFmlZEw876AyrYX7ETFsgrifW0hwLUq+xKSkwOIbT2KhpUhxbLrQaGeH0rsHx5XAfw+htNbi+2i8/7SSmqs8cjYgMaSzjVFWTRxxCBS0C781tZKpdvsicucghoewN/SG4nT8WKimP9KXKpF9L+IpAVcV5qc6L1AQFG3cnWwK4HWJFVaEjz5zPWguKFVqPrSJ99i/rA2y05oU07zgutzpqqhJ65QrbjullA0et30gp7bSTHFYhjQCyQuiLSZSElJw2KWQyih7AL2IKnE96BZ1qeeN47MBAxnv/UTIZ2bpe/0NEgQNuQq5i+CoztYeipDmK6pCD88PwGf6cATaDt9FMV01KKYrI7c8yyO89KwkuCTikHK4a5PMtZ5Mchj0UdfTe++yZsO59U1iy5la2dCIDnTcI0ihQ6AKLfrXEx52b0iHzUDcO3JqVtaqbQG/pHWjJNfF467/qEAOfRxeEvaBDJLOfmfyr7kr8dy06sWPqNfwZ/mfrlOQEUSiyHS3pflveVFTFKYkuXut50//RbJJ8gqNQc3Gf1pD5l9Qu47FujveTrZ9buUWkwVpFyk+zaN3spvb6oH8S796QsRqXBdMgqVhsBOCmAVl3 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hyPrYge9wqvfk9o9UNPlYHQJN/+wfbzP3KmnmudGAzCdZ+NR6pt6vuZp1tlH?= =?us-ascii?Q?+13XZoTy7qEG0KPqIXOBuIRCZ4vd/Z/fxw6/venoKmmsPr0PaTMPSM8RhO86?= =?us-ascii?Q?9sU0y0vFvFKSWBpjB/kxzjkwvsWlxXt2B3CU87bFZKSnTihHZ6SbXrw/Ijka?= =?us-ascii?Q?oErqWPc8s5GtG9HiVYzCUjPZau+rUbcKL+HK0XemzCz/Ap2vEBTOTzwVhQWT?= =?us-ascii?Q?9ODTJvf0qgB5X6smSAE4pqWYnV82Amz1r9k5YE+Q51E2xtyJNUksQ+XWzi0N?= =?us-ascii?Q?iuSdYC9AQWRXyWeXPV6Ui6EteNyCewEUzqxK1F71Qo5Bx462Cj105xS1RrFm?= =?us-ascii?Q?uT7rwswgYHMNO0a+NzTJdT7VHy2GDcy4v0QITZ3wiTM5gEXiuE1cpINpKeBg?= =?us-ascii?Q?MEuLA+FIMMhRP13Yvpg6ogRoQk0wTIeC8ZQfEkgrh2HjhzHDfxMJFLSQlR7P?= =?us-ascii?Q?BpDDgSR6YUspwvyef5KcVOOxXb/zDap6NvL/8q7yIQvGsBekLlW4btHTOafQ?= =?us-ascii?Q?7D4mfES2E31egdqkd8ytzQpmP6KFV0Zq4P0cbsHyyAfna80KKovvikqWEHPR?= =?us-ascii?Q?XyyrTIHdH9yOaWMR6HFux25c3zfWA8B55pIROIYFRlQswgOXqz1r9ICIkbKj?= =?us-ascii?Q?lKEmo2HcS+Z7ZQ7EoBRvIgG2G4Z50mFxNux5+twD7qL+AMfGPbvKvPnbC24j?= =?us-ascii?Q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5I38i18NKhZUdWbmeppuMRgC?= =?us-ascii?Q?qugPJ3uR4CysCYXI60IfSDk=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39a57ee2-6b74-4455-4e78-08dc0c9cc19a X-MS-Exchange-CrossTenant-AuthSource: LV3PR01MB8464.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 20:44:18.3290 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i0/+7TduqHKF5d+fgt3Bp+EryJ36vrTf3ozX+VOVN7/NC195HGCF48CpVx6vKa4S34egxg/jf00KXAvLmsDXkG3UTJqkxHIGO0vk3osE/VQaOahOcfY1J38XwzslXOYS X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR01MB7139 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Mxv69OZDtYfcSJHLZ3ILvNCAx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=V7mEoBbg; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Update GenericWatchdogDxe to disable watchdog interaction after exiting boot services. Also, move the mEfiExitBootServicesEvent event to the top of the file with the other static variables. Signed-off-by: Rebecca Cran --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPk= g/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index 8f02f38c64e3..912106eb6ad2 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -36,10 +36,14 @@ STATIC UINTN mTimerFrequencyHz =3D 0; It is therefore stored here. 0 means the timer is not running. */ STATIC UINT64 mNumTimerTicks =3D 0; =20 +/* disables watchdog interaction after Exit Boot Services */ +STATIC BOOLEAN mExitedBootServices =3D FALSE; + #define MAX_UINT48 0xFFFFFFFFFFFFULL =20 STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol; STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify; +STATIC EFI_EVENT mEfiExitBootServicesEvent; =20 STATIC VOID @@ -91,7 +95,8 @@ WatchdogExitBootServicesEvent ( ) { WatchdogDisable (); - mNumTimerTicks =3D 0; + mNumTimerTicks =3D 0; + mExitedBootServices =3D TRUE; } =20 /* This function is called when the watchdog's first signal (WS0) goes hig= h. @@ -202,8 +207,9 @@ WatchdogSetTimerPeriod ( { UINTN SystemCount; =20 - // if TimerPeriod is 0, this is a request to stop the watchdog. - if (TimerPeriod =3D=3D 0) { + // if TimerPeriod is 0 or we've exited boot services, + // this is a request to stop the watchdog. + if (TimerPeriod =3D=3D 0 || mExitedBootServices) { mNumTimerTicks =3D 0; WatchdogDisable (); return EFI_SUCCESS; @@ -303,8 +309,6 @@ STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer= =3D { WatchdogGetTimerPeriod }; =20 -STATIC EFI_EVENT mEfiExitBootServicesEvent; - EFI_STATUS EFIAPI GenericWatchdogEntry ( --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113107): https://edk2.groups.io/g/devel/message/113107 Mute This Topic: https://groups.io/mt/103510105/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-