From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.1.42; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0042.outbound.protection.outlook.com [104.47.1.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 579102218E923 for ; Wed, 6 Dec 2017 19:30:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7jeqRjeVBLykIm/P4HTFyOgPsSz/dq3BZGpP1ky0CaA=; b=RJJUy2r35SyUIkN++RLbjvGWhwIHlv4bn7i9GVES9wsiQi2bXoBRK37QSrOaRA0R8ZNIyFlIMMOLBAY0MxeOKRrl0RSqh6ZzAooHMgRexe165tfBEZP3dG6CRg5Mzwwd61WddCY3581g45wVzxZp29igF4Oeb78C0+ZMUfH0c/4= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by DB6PR04MB2999.eurprd04.prod.outlook.com (10.170.213.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Thu, 7 Dec 2017 03:35:29 +0000 Received: from DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::1d9f:72df:a04f:ddb6]) by DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::1d9f:72df:a04f:ddb6%17]) with mapi id 15.20.0260.006; Thu, 7 Dec 2017 03:35:29 +0000 From: Meenakshi Aggarwal To: Leif Lindholm , "Kinney, Michael D" , "Gao, Liming" CC: "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" , Varun Sethi , Udit Kumar Thread-Topic: [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : Add support for Watchdog driver Thread-Index: AQHTZz0pxW4AsfntREuNB/61ei0MWqMzS9KAgAANVQCAAOYhAIAAZFUAgAKmIqA= Date: Thu, 7 Dec 2017 03:35:28 +0000 Message-ID: References: <1511779917-9255-1-git-send-email-meenakshi.aggarwal@nxp.com> <1511779917-9255-3-git-send-email-meenakshi.aggarwal@nxp.com> <20171204143537.abxvjztldex2bjde@bivouac.eciton.net> <4A89E2EF3DFEDB4C8BFDE51014F606A14E189CAA@SHSMSX104.ccr.corp.intel.com> <20171205110606.374td5x3rhdnhh5g@bivouac.eciton.net> In-Reply-To: <20171205110606.374td5x3rhdnhh5g@bivouac.eciton.net> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR04MB2999; 6:gMO++BZDprCxFTfbeFDDlQNXPC/yRxH+IKmNmN5AalM3pwml+zk8VYJv77S8Xz8DDBF3ErqbLATzdbzOyZhZjEiSbsEnTt5T3X8ZybWKYfcxoEL2oJIQLWrbs2TKtoc3z3Gumu5J3NhukIrUTQvXQ7ll82MNzsTyEZNGwTbw0XsVYaR/z7qld8OKDVzQ6vnM/9iwxbUbyenzFfvZ75luudyVtYNU4HtdCU2rX+b3AMlLUcHTIySVgTq4LaHtjzciJTTvxGzEahCIyOey6ADP5yAOsXrYIqzLdHWbOAjdiTgyTiRNr8O8N1JoC4qhIaWTAT6GlgE8jXsUcxWMJBbxLrCDvH22x+zLVKyYFKbkvqg=; 5:cgAz8f3TFnfJnoygZf1D26FUqi7eeZb5oYkrD4/dGEgYnhcinehLBM0O9lV9MFnP/Xx0B1JM3t9gdOi2UhbYwpa4/aw1wKdLh3NFKZqi4bme6q8ripq0Rciw0Klqk8E333X7PWzCJ4zcLwbrYZ2gfvUoQ2SCGQkykBlkr5JPM44=; 24:SVXk8uvXDIBMrNhsXTpZJULluumEkMnhzvRstuVl+sJwUUkNNpjCxZSjAOdWlQ5myS3S8xPac/Mz4DpGcUav6s9icEKLk4ydDcyxRTUqv9Y=; 7:JZ7lTaDll6SdN+HQ/IzzfR3Vm/6b4DqKYAWBSAq5cqgTDFkwcE3XHsp+t6AjSnNHg9PiAx8e8sWSbSK2sskPs6Ktq4vc5nQAmtouhMLMW+0m+cdXXi54UW7J+RUU/whw+GjO7koSoaRMb9FJInKaMFMiGdIxk5rj65vrpYYh5M2kQSwDLkWhCcg1Uzd7RF/KjdfyzSTKd+N9ne5hUiXKOeXq1YWCMNo4Wd6wIWyxUg3llxKqKap00HofocmIGJMJ x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(39860400002)(199004)(189003)(13464003)(24454002)(97736004)(3280700002)(33656002)(81166006)(81156014)(101416001)(2906002)(7736002)(14454004)(74316002)(305945005)(3660700001)(6436002)(229853002)(8676002)(6506006)(66066001)(55016002)(3846002)(102836003)(6116002)(110136005)(54906003)(9686003)(316002)(99286004)(5250100002)(93886005)(76176011)(7696005)(2900100001)(4326008)(68736007)(2950100002)(86362001)(53936002)(6246003)(478600001)(8936002)(106356001)(53546010)(25786009)(105586002)(5660300001)(171213001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR04MB2999; H:DB5PR04MB0998.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: 1a41ffae-36b9-40b2-7e29-08d53d238ff5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286); SRVR:DB6PR04MB2999; x-ms-traffictypediagnostic: DB6PR04MB2999: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011); SRVR:DB6PR04MB2999; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DB6PR04MB2999; x-forefront-prvs: 05143A8241 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a41ffae-36b9-40b2-7e29-08d53d238ff5 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2017 03:35:29.0079 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB2999 Subject: Re: [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : Add support for Watchdog driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2017 03:31:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Liming, Mike, Please share your inputs on this. Thanks, Meenakshi > -----Original Message----- > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > Sent: Tuesday, December 05, 2017 4:36 PM > To: Udit Kumar > Cc: Gao, Liming ; Kinney, Michael D > ; Meenakshi Aggarwal > ; ard.biesheuvel@linaro.org; edk2- > devel@lists.01.org; Varun Sethi > Subject: Re: [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : Add > support for Watchdog driver >=20 > On Tue, Dec 05, 2017 at 05:07:00AM +0000, Udit Kumar wrote: > > > I suggest return EFI_UNSUPPORTED for this case. The protocol > implementation > > > could return its status besides spec defined status. > > > > Thanks to help me , how core will treat this error > > 1/ Wdt not available > > 2/ ignoring this error > > 3/ core is not registering handler > > I guess 3 is valid, >=20 > Looking at Core/Dxe/Misc/SetWatchdogTimer.c: > // > // Attempt to set the timeout > // > Status =3D gWatchdogTimer->SetTimerPeriod (gWatchdogTimer, > MultU64x32 (Timeout, WATCHDOG_TIMER_CALIBRATE_PER_SECOND)); >=20 > // > // Check for errors > // > if (EFI_ERROR (Status)) { > return EFI_DEVICE_ERROR; > } >=20 > The SetWatchdogTimer() call would always return EFI_DEVICE_ERROR. >=20 > > On side track, looks wdt is not used by core services then do we > > really need this as part of arch protocol ? >=20 > Yes, that was ultimately what I was implying with my question > regarding whether this protocol is relevant for a watchdog that can > only ever reset the system on timeout. >=20 > The protocol looks to me to be designed to use a dedicated generic > timer as backing for a software watchdog. >=20 > Liming, Mike? >=20 > If that is the case, then I agree this driver should probably not > implement this protocol, but rather set up a timer event (or a > dedicated timer) to stroke the watchdog. >=20 > Regards, >=20 > Leif >=20 > > regards > > Udit > > > > > -----Original Message----- > > > From: Gao, Liming [mailto:liming.gao@intel.com] > > > Sent: Monday, December 04, 2017 8:53 PM > > > To: Leif Lindholm ; Kinney, Michael D > > > > > > Cc: Meenakshi Aggarwal ; > > > ard.biesheuvel@linaro.org; edk2-devel@lists.01.org; Udit Kumar > > > ; Varun Sethi > > > Subject: RE: [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : Add > support > > > for Watchdog driver > > > > > > Leif: > > > I suggest return EFI_UNSUPPORTED for this case. The protocol > implementation > > > could return its status besides spec defined status. > > > > > > Thanks > > > Liming > > > > -----Original Message----- > > > > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > > > > Sent: Monday, December 4, 2017 10:36 PM > > > > To: Kinney, Michael D ; Gao, Liming > > > > > > > > Cc: Meenakshi Aggarwal ; > > > > ard.biesheuvel@linaro.org; edk2-devel@lists.01.org; > > > > udit.kumar@nxp.com; v.sethi@nxp.com > > > > Subject: Re: [PATCH edk2-platforms] [PATCH v3 2/9] Platform/NXP : > Add > > > > support for Watchdog driver > > > > > > > > Mike, Liming, as MdePkg mainteiners - one question below: > > > > > > > > On Mon, Nov 27, 2017 at 04:21:50PM +0530, Meenakshi Aggarwal > wrote: > > > > > diff --git a/Platform/NXP/Drivers/WatchDog/WatchDog.c > > > > > b/Platform/NXP/Drivers/WatchDog/WatchDog.c > > > > > new file mode 100644 > > > > > index 0000000..a9c70ef > > > > > --- /dev/null > > > > > +++ b/Platform/NXP/Drivers/WatchDog/WatchDog.c > > > > > @@ -0,0 +1,421 @@ > > > > > > > > ... > > > > > > > > > +/** > > > > > + This function registers the handler NotifyFunction so it is > > > > > +called every time > > > > > + the watchdog timer expires. It also passes the amount of time > > > > > +since the last > > > > > + handler call to the NotifyFunction. > > > > > + If NotifyFunction is not NULL and a handler is not already > > > > > +registered, > > > > > + then the new handler is registered and EFI_SUCCESS is returned= . > > > > > + If NotifyFunction is NULL, and a handler is already registered= , > > > > > + then that handler is unregistered. > > > > > + If an attempt is made to register a handler when a handler is > > > > > +already registered, > > > > > + then EFI_ALREADY_STARTED is returned. > > > > > + If an attempt is made to unregister a handler when a handler i= s > > > > > +not registered, > > > > > + then EFI_INVALID_PARAMETER is returned. > > > > > + > > > > > + @param This The EFI_TIMER_ARCH_PROTOCOL instance. > > > > > + @param NotifyFunction The function to call when a timer > interrupt fires. > > > This > > > > > + function executes at TPL_HIGH_LEVEL. = The DXE Core > will > > > > > + register a handler for the timer inte= rrupt, so it can > know > > > > > + how much time has passed. This inform= ation is used to > > > > > + signal timer based events. NULL will = unregister the > handler. > > > > > + > > > > > + @retval EFI_SUCCESS The watchdog timer handler was > registered. > > > > > + @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and = a > > > handler is already > > > > > + registered. > > > > > + @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a > handler > > > was not > > > > > + previously registered. > > > > > + > > > > > +**/ > > > > > +STATIC > > > > > +EFI_STATUS > > > > > +EFIAPI > > > > > +WdogRegisterHandler ( > > > > > + IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, > > > > > + IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction > > > > > + ) > > > > > +{ > > > > > + // ERROR: This function is not supported. > > > > > + // The hardware watchdog will reset the board > > > > > + return EFI_INVALID_PARAMETER; > > > > > > > > Michael, Liming - what's your take on this? > > > > > > > > Is EFI_WATCHDOG_TIMER_ARCH_PROTOCOL suitable for use with a > pure-hw > > > > watchdog such as this? > > > > > > > > If so, what would be a suitable return code here? > > > > EFI_INVALID_PARAMETER does not look ideal. > > > > > > > > / > > > > Leif