From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 962FA226838EA for ; Tue, 17 Apr 2018 17:55:53 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2018 17:55:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,464,1517904000"; d="scan'208";a="42739349" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 17 Apr 2018 17:55:52 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Apr 2018 17:55:52 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Apr 2018 17:55:51 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.240]) by shsmsx102.ccr.corp.intel.com ([169.254.2.79]) with mapi id 14.03.0319.002; Wed, 18 Apr 2018 08:55:50 +0800 From: "Ni, Ruiyu" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart Thread-Index: AQHT0t3bYCVyElCPm0KqHIIRbo09v6P9oQOAgAgYn4A= Date: Wed, 18 Apr 2018 00:55:49 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BC6CE96@SHSMSX104.ccr.corp.intel.com> References: <20180413041352.27740-1-ruiyu.ni@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BAAC7D7@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BAAC7D7@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzYwYWU4MjQtZmUyMC00NWYyLWJhMjUtZDc5YTM4M2Y0YzY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJwaVkzOGpRXC9RWDNSMTNXdytRMkFJWFlcL3V5cE5hbmdnb1BkUXE2OTlUNXU2QUlyd2JjWDl1XC8xTnlMNlhOcnBUIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 00:55:53 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Indeed UEFI Spec requires that Supported() should be called before Start(). But Steven's test cases directly call Start() which exposes this "issue". I don't want to argue the call doesn't follow UEFI Spec. Fixing it doesn't harm:). > -----Original Message----- > From: Zeng, Star > Sent: Friday, April 13, 2018 1:15 PM > To: Ni, Ruiyu ; edk2-devel@lists.01.org > Cc: Shi, Steven ; Zeng, Star > Subject: RE: [edk2] [PATCH] MdeModulePkg/Terminal: Check status of > OpenProtocol in BindingStart >=20 > Generally, I am ok with the change. > But, what is the case for the change? > If the new "if condition" is TRUE, the ASSERT above it will happen, so th= e new "if > condition" is for RELEASE build case? > And if the code passes Support() check, then seemingly, the "if condition= " in > Start() will not happen. > Could more detailed information in the commit log or code comments? >=20 >=20 > Thanks, > Star > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ru= iyu > Ni > Sent: Friday, April 13, 2018 12:14 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star > Subject: [edk2] [PATCH] MdeModulePkg/Terminal: Check status of > OpenProtocol in BindingStart >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ruiyu Ni > Cc: Steven Shi > Cc: Star Zeng > --- > MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c > b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c > index 60de2d4d6d..66dd3ad550 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c > @@ -2,7 +2,7 @@ > Produces Simple Text Input Protocol, Simple Text Input Extended Protoc= ol and > Simple Text Output Protocol upon Serial IO Protocol. >=20 > -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made avail= able > under the terms and conditions of the BSD License which accompanies this > distribution. The full text of the license may be found at @@ -488,6 +48= 8,9 @@ > TerminalDriverBindingStart ( > EFI_OPEN_PROTOCOL_BY_DRIVER > ); > ASSERT ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STAR= TED)); > + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { > + return Status; > + } >=20 > // > // Open the Serial I/O Protocol BY_DRIVER. It might already be starte= d. > @@ -501,6 +504,9 @@ TerminalDriverBindingStart ( > EFI_OPEN_PROTOCOL_BY_DRIVER > ); > ASSERT ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STAR= TED)); > + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { > + return Status; > + } >=20 > if (!IsHotPlugDevice (ParentDevicePath)) { > // > -- > 2.14.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel