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.65; helo=mga03.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 04FF7223972DC for ; Wed, 7 Feb 2018 03:32:39 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 03:38:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="28100940" Received: from shzintpr01.sh.intel.com (HELO [10.253.24.48]) ([10.239.4.80]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2018 03:38:21 -0800 To: Ruiyu Ni , edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao , star.zeng@intel.com References: <20180202064530.407028-1-ruiyu.ni@intel.com> <20180202064530.407028-3-ruiyu.ni@intel.com> From: "Zeng, Star" Message-ID: <5f05d4f2-85d4-8343-a3bd-3d162184259d@intel.com> Date: Wed, 7 Feb 2018 19:37:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180202064530.407028-3-ruiyu.ni@intel.com> Subject: Re: [PATCH 02/10] MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 11:32:40 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2018/2/2 14:45, Ruiyu Ni wrote: > From: Michael D Kinney > > Update PEI Service ResetSystem() to always attempt to use > the Reset2 PPI before looking for the Reset PPI. > > Cc: Liming Gao > Reviewed-by: Ruiyu Ni > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Michael D Kinney Reviewed-by: Star Zeng Thanks, Star > --- > MdeModulePkg/Core/Pei/Reset/Reset.c | 26 +++++++++++++++++++------- > 1 file changed, 19 insertions(+), 7 deletions(-) > > diff --git a/MdeModulePkg/Core/Pei/Reset/Reset.c b/MdeModulePkg/Core/Pei/Reset/Reset.c > index 7440eefd78..cd36c526b5 100644 > --- a/MdeModulePkg/Core/Pei/Reset/Reset.c > +++ b/MdeModulePkg/Core/Pei/Reset/Reset.c > @@ -35,16 +35,21 @@ PeiResetSystem ( > EFI_STATUS Status; > EFI_PEI_RESET_PPI *ResetPpi; > > - Status = PeiServicesLocatePpi ( > - &gEfiPeiResetPpiGuid, > - 0, > - NULL, > - (VOID **)&ResetPpi > - ); > + // > + // Attempt to use newer ResetSystem2(). If this returns, then ResetSystem2() > + // is not available. > + // > + PeiResetSystem2 (EfiResetCold, EFI_SUCCESS, 0, NULL); > > // > - // LocatePpi returns EFI_NOT_FOUND on error > + // Look for PEI Reset System PPI > // > + Status = PeiServicesLocatePpi ( > + &gEfiPeiResetPpiGuid, > + 0, > + NULL, > + (VOID **)&ResetPpi > + ); > if (!EFI_ERROR (Status)) { > return ResetPpi->ResetSystem (PeiServices); > } > @@ -55,6 +60,10 @@ PeiResetSystem ( > EFI_ERROR_CODE | EFI_ERROR_MINOR, > (EFI_SOFTWARE_PEI_CORE | EFI_SW_PS_EC_RESET_NOT_AVAILABLE) > ); > + > + // > + // No reset PPIs are available yet. > + // > return EFI_NOT_AVAILABLE_YET; > } > > @@ -85,6 +94,9 @@ PeiResetSystem2 ( > EFI_STATUS Status; > EFI_PEI_RESET2_PPI *Reset2Ppi; > > + // > + // Look for PEI Reset System 2 PPI > + // > Status = PeiServicesLocatePpi ( > &gEfiPeiReset2PpiGuid, > 0, >