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=star.zeng@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 160AC226CD789 for ; Thu, 12 Apr 2018 22:15:28 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 22:15:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,444,1517904000"; d="scan'208";a="220082700" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 12 Apr 2018 22:15:27 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 12 Apr 2018 22:15:27 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 12 Apr 2018 22:15:27 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.184]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.197]) with mapi id 14.03.0319.002; Fri, 13 Apr 2018 13:15:25 +0800 From: "Zeng, Star" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Shi, Steven" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart Thread-Index: AQHT0t3bB1XLgHn9nkqv3DDUGeLm/qP+JfKA Date: Fri, 13 Apr 2018 05:15:25 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAAC7D7@shsmsx102.ccr.corp.intel.com> References: <20180413041352.27740-1-ruiyu.ni@intel.com> In-Reply-To: <20180413041352.27740-1-ruiyu.ni@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: Fri, 13 Apr 2018 05:15:29 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 the = 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? Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiy= u 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 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(-) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeMod= ulePkg/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 Protocol= 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 availab= le under the terms and conditions of the BSD License which accompanies thi= s 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_STARTE= D)); + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { + return Status; + } =20 // // Open the Serial I/O Protocol BY_DRIVER. It might already be started. @@ -501,6 +504,9 @@ TerminalDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER ); ASSERT ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STARTE= D)); + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { + return Status; + } =20 if (!IsHotPlugDevice (ParentDevicePath)) { // -- 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel