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 CE0DBD8004C for ; Fri, 5 Jan 2024 04:38:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=SWCWKPKq40bJe2JIJ55oDPxovAqK9Yy1XHswZ8Zh8yk=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Message-ID:Date:User-Agent:Subject:To:CC:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704429506; v=1; b=Lz0Mu03uyhV9kChO4HsW4vi0YgV54vCnECZWwfogxNuOBkKe3zI4qLpa1mTevE5LpE2nkvlo 7l9BOqQM4wlg46HHahKzLK+dBfbXbe0Y47hpeYxEhhE3H2aFQ0/3wN5JNIrcrHbLdiOYQRyxOZO WA4bnifmQ0bC639yEt2oLLbY= X-Received: by 127.0.0.2 with SMTP id 7IxgYY7687511xb9YdNZMfw8; Thu, 04 Jan 2024 20:38:26 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.100]) by mx.groups.io with SMTP id smtpd.web10.17215.1704429503907073906 for ; Thu, 04 Jan 2024 20:38:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVzxxbWfu6ZVzUME+1lRy3AvobZEAvVWfV4DR1CsPoHHHByVmHuagBeLi4NRvgMkc066Bqg5Glx9qaWybP0v2gvYhMH4ALXb36W+K+UL/0SUrRnyKv9U7673AWMq7Aom0Fepk7gLqNDoYYGot9wn2Q+RmQaDbQzgHOohbv3k/hC1Vlu2/aM40YP6LImPxMtek07ri3xKe5hrwBvjGoadz33HkG4HoWu7oDtA/OZVJfTLl2ayND0fVnXCJgbjzHBsD5jMXoyzFvoGyR0XnqI+TlLfbTHz2GlCahAmq40D7MIzSWAY0wY6GYxa2Spc/eDeaXkwsM//IiP5wE2O+TItJQ== 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=Qev1dUW+Or2tpVusvkNfz/kZ6/J5MQ1nS2UV9F4bXj8=; b=dIscVFFkoay6oVh9Bhl4I5yPnmRdkN243rO/YZS2N+KUaecgZGSJ5LC2x2W/HAAbfIb9zw0tHHMCttANGGZvsdsDhBiWYUOvhABVEyBWd7wWTI+6Awk7U/EBBSWqduVNQPOSDrZdFk31dWZjhDHXlIeC9pIbIzDfMMYGU38Opnb4qEAeBigckURaCNphiHLPYhR3fPJdbtg6ChO2AsiqoO1EW41ps4AIlWF+oCpmzDVRtzs9grkBSF9/CQLQlRQP52mMwsavzMxEXQ/OhejeaoA1sMalroX5483hUnyBLIlVv9IimRqJ1opb0HS/n09X9nSAHMaQJW218e5VP9IXVw== 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 SA0PR01MB6220.prod.exchangelabs.com (2603:10b6:806:e2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13; Fri, 5 Jan 2024 04:38:21 +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; Fri, 5 Jan 2024 04:38:21 +0000 Message-ID: <42bd3a5b-2612-4116-89a0-c66e45ef997f@os.amperecomputing.com> Date: Thu, 4 Jan 2024 21:38:17 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH 3/3] ArmPkg: Disable watchdog interaction after exiting boot services To: Sami Mujawar , Leif Lindholm , Ard Biesheuvel CC: "devel@edk2.groups.io" , nd References: <20240103204353.361541-1-rebecca@os.amperecomputing.com> <20240103204353.361541-4-rebecca@os.amperecomputing.com> From: "Rebecca Cran via groups.io" In-Reply-To: X-ClientProxiedBy: CH2PR07CA0049.namprd07.prod.outlook.com (2603:10b6:610:5b::23) To LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV3PR01MB8464:EE_|SA0PR01MB6220:EE_ X-MS-Office365-Filtering-Correlation-Id: 86701267-4899-43fc-31d0-08dc0da82550 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 6+fU3+kBEF9J0U0xBl7v8uwxCkWdXC/B/9kSUTLkFLDehDAyfLQGSFlnpQDxZ2bgve812XNuH/Bir0kVOcUNRDWcvhy5XUHJqE/CBVMhyIcNrRWN6/2fcnmO1Z0k4fVD94deu3BYK3xQc7zkUZk8Jv0tTWCS9+kJIW6rUXGTaU0C/1CJGpyG1FVQLDsC7TWjkfMN0VPPgBjk7H7Wgxlt8tpfzHDc6yZM5oFZy3B2soYQZZvWZi3KjphlH5IucnYu/2AhdVgN7xapwRxH5j1WWi9mx6qJE5edJbLl5oFo08jPlud1UJOSugNptdrKxa2xWftWmH/J67tYyoGct+Zbj53EM76mb2mwLLRZvvN3+7KLsG5Xj334ermtB/bYn2ZRKtPA35Zusg/srofzu7zYdToP4D5Q3KbggROibeyKYsy2Hfhf+TXzOQFGIobanxkAp9bhC19cGAyqibZDvB4FpBGvHPYlATMrYxhuMu4PxF44axo+Ncsxt6xZ73BYVhlyNyuaT6slU/UQmpz/UWMOUDCJ3yzr+I7nrgZKBe2xBLVBIMhoONYCSdNPGe8Er117IQdTj9LnG3RVC4c8nnEfTpIj1EqCjKQcDy9GieWkbnVIygI9S1X4mJaIn2qlKhuG X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?egPv1jnDAZOCRJdyGZryOhbrVwkn+lzPr1LlfEykOxfo2Fv4r1pBkGagwRYL?= =?us-ascii?Q?Oh53vKeiYWIeurNKaDY874aEsa76oRfMUfjX5Pl9fgs/XOfvnrsoz8xzHI7n?= =?us-ascii?Q?iRKx1xzNRQeQQ3W209D0jmrQc58AFa1hkjTingqtjILwIcIjQZWdJNY8VMXJ?= =?us-ascii?Q?0Jm3ULJpIYGxeePSCocQG/Ine2jbxzoEH5Des96/70vVIQ3ulODBLtydSNkj?= =?us-ascii?Q?8aXTKFExQyYy6iodsYtwjwERqVOqtwM4VzdsXHYnlZBRetQaJ3JpdcING6hB?= =?us-ascii?Q?V0yDD6IRDI9PFFV2Mu4ZE+fC75PbFfsYlmnajierB49ez36CMyhJsph1Kh7u?= =?us-ascii?Q?ZOa+HwG54ua80+OOdWUEWU/ND+iSflPVjHfWy+eWp5A+d9POcqnhWkTkkKRN?= =?us-ascii?Q?Z87A1hPg9jLZxZuhw0MsqYOs+zwZoevbEytlvljCFDJde64yfIyDDeGrnkVU?= =?us-ascii?Q?HBMR6qDaFE+JbHmIUeROt5QI0QqY3x4GDF9a9XfbHK3X/vz31DkktqMzXCOK?= =?us-ascii?Q?D3FPZksWb4magiLo8gLjCQ5unv0Ytb+rE7o7t45vArc1DkavrC6aJ4cHNGfB?= =?us-ascii?Q?K4OiCLijG4CoCUGCeqZocSUl1iEuV7AwAfuPO/j0W+/YB89ki/sDfrjH8Wy5?= =?us-ascii?Q?ic17WpSU2hJRfKAqVwQtdrU1mNG/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IP2CKR9csImRQX+ConTDiGe7dda8RReMgPnZARwsrUwXOvQ9dN4qHmyAchi5?= =?us-ascii?Q?ICK0gXx9Js6c/wKQTfP4LN8=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86701267-4899-43fc-31d0-08dc0da82550 X-MS-Exchange-CrossTenant-AuthSource: LV3PR01MB8464.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 04:38:21.2234 (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: XlLsroXjYLYnk9FPtCCi4jjcwwGJd2eJq4XOzkaCEhSdWzcPF5hSZk1j9NKLdiABKbeNxBAjIgOYtrqiSIrnL7SdEY/mhGHce7Mc6osvpIxbzJqDBtxPuz62WmUc/Wto X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR01MB6220 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: 9g4mkEFNdzfi17ofQMDZWScVx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Lz0Mu03u; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Thanks, I've incorporated the changes into the v2 patch series. --=20 Rebecca On 1/4/2024 3:01 AM, Sami Mujawar wrote: > Hi Rebecca, >=20 > Thank you for this patch. >=20 > I have some minor suggestions marked inline as [SAMI]. >=20 > Regards, >=20 > Sami Mujawar=09 >=20 > =EF=BB=BFOn 03/01/2024, 20:44, "Rebecca Cran" > wrote: >=20 >=20 > 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. >=20 >=20 > Signed-off-by: Rebecca Cran > > --- > ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 14 +++++++++----= - > 1 file changed, 9 insertions(+), 5 deletions(-) >=20 >=20 > diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/Arm= Pkg/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 >=20 > +/* disables watchdog interaction after Exit Boot Services */ > +STATIC BOOLEAN mExitedBootServices =3D FALSE; > + > #define MAX_UINT48 0xFFFFFFFFFFFFULL >=20 >=20 > STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol; > STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify; > +STATIC EFI_EVENT mEfiExitBootServicesEvent; >=20 >=20 > STATIC > VOID > @@ -91,7 +95,8 @@ WatchdogExitBootServicesEvent ( > ) > { > WatchdogDisable (); > - mNumTimerTicks =3D 0; > + mNumTimerTicks =3D 0; > + mExitedBootServices =3D TRUE; > } >=20 >=20 > /* This function is called when the watchdog's first signal (WS0) goes hi= gh. > @@ -202,8 +207,9 @@ WatchdogSetTimerPeriod ( > { > UINTN SystemCount; >=20 >=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) { > [SAMI] I think we need extra brackets here. Also, should EFI_DEVICE_ERROR= be returned if ExitBootServices is signalled but TimerPeriod !=3D 0? > i.e. we stop the watchdog but return an error to the caller so that it = knows to fix the broken code. > [/SAMI] > mNumTimerTicks =3D 0; > WatchdogDisable (); > return EFI_SUCCESS; > @@ -303,8 +309,6 @@ STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTime= r =3D { > WatchdogGetTimerPeriod > }; >=20 >=20 > -STATIC EFI_EVENT mEfiExitBootServicesEvent; > - > EFI_STATUS > EFIAPI > GenericWatchdogEntry ( -=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 (#113213): https://edk2.groups.io/g/devel/message/113213 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-