From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.2683.1572241383740291049 for ; Sun, 27 Oct 2019 22:43:03 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Oct 2019 22:43:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,238,1569308400"; d="scan'208";a="198548875" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 27 Oct 2019 22:43:03 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 27 Oct 2019 22:43:02 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.248]) with mapi id 14.03.0439.000; Mon, 28 Oct 2019 13:43:00 +0800 From: "Wu, Hao A" To: "Chu, Maggie" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Ni, Ray" , "Zeng, Star" , "Dong, Eric" Subject: Re: [PATCH] MdeModulePkg/NvmExpressPei: Fix Opal S3 unlock issue Thread-Topic: [PATCH] MdeModulePkg/NvmExpressPei: Fix Opal S3 unlock issue Thread-Index: AQHVjU2y88Q9t/QIG0iQSCJ6Pquo76dviV6Q Date: Mon, 28 Oct 2019 05:42:59 +0000 Message-ID: References: <20191028050802.856-1-maggie.chu@intel.com> In-Reply-To: <20191028050802.856-1-maggie.chu@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 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Chu, Maggie > Sent: Monday, October 28, 2019 1:08 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A; Wang, Jian J; Ni, Ray; Zeng, Star; Dong, Eric > Subject: [PATCH] MdeModulePkg/NvmExpressPei: Fix Opal S3 unlock issue >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2312 >=20 > This patch is for fixing unexpected system hang during S3 unlock process. > FatPei driver maintained and updated internal BlockIo devices list > when there is new BlockIo PPI has installed, and it relied on BlockIo PPI= service > to get data from devices. Because BlockIo Ppi leverage NvmExpressPei Ppi = to > transit > Nvm command to device, we should make sure NvmePassThruPpi installed > before BlockIo PPI. The change is good to me, Reviewed-by: Hao A Wu If no other comment, I will adjust the length of some commit log message li= nes when pushing this patch, since the PatchCheck.py script is complaining: The commit message format is not valid: * Line 7 of commit message is too long. * Line 8 of commit message is too long. * Line 9 of commit message is too long. Best Regards, Hao Wu >=20 > Signed-off-by: Maggie Chu > Cc: Hao A Wu > Cc: Jian J Wang > Cc: Ray Ni > Cc: Star Zeng > Cc: Eric Dong > --- > MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c | 43 ++++++++++++- > --------- > 1 file changed, 23 insertions(+), 20 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c > b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c > index 987eed420e..a8cb7f3a67 100644 > --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c > +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c > @@ -376,6 +376,29 @@ NvmExpressPeimEntry ( > continue; >=20 > } >=20 >=20 >=20 > + // >=20 > + // Nvm Express Pass Thru PPI >=20 > + // >=20 > + Private->PassThruMode.Attributes =3D > EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL | >=20 > + > EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL | >=20 > + > EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM; >=20 > + Private->PassThruMode.IoAlign =3D sizeof (UINTN); >=20 > + Private->PassThruMode.NvmeVersion =3D > EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI_REVISION; >=20 > + Private->NvmePassThruPpi.Mode =3D &Private->PassThruMo= de; >=20 > + Private->NvmePassThruPpi.GetDevicePath =3D > NvmePassThruGetDevicePath; >=20 > + Private->NvmePassThruPpi.GetNextNameSpace =3D > NvmePassThruGetNextNameSpace; >=20 > + Private->NvmePassThruPpi.PassThru =3D NvmePassThru; >=20 > + CopyMem ( >=20 > + &Private->NvmePassThruPpiList, >=20 > + &mNvmePassThruPpiListTemplate, >=20 > + sizeof (EFI_PEI_PPI_DESCRIPTOR) >=20 > + ); >=20 > + Private->NvmePassThruPpiList.Ppi =3D &Private->NvmePassTh= ruPpi; >=20 > + PeiServicesInstallPpi (&Private->NvmePassThruPpiList); >=20 > + >=20 > + // >=20 > + // Block Io PPI >=20 > + // >=20 > Private->BlkIoPpi.GetNumberOfBlockDevices =3D > NvmeBlockIoPeimGetDeviceNo; >=20 > Private->BlkIoPpi.GetBlockDeviceMediaInfo =3D > NvmeBlockIoPeimGetMediaInfo; >=20 > Private->BlkIoPpi.ReadBlocks =3D NvmeBlockIoPeimReadBl= ocks; >=20 > @@ -398,26 +421,6 @@ NvmExpressPeimEntry ( > Private->BlkIo2PpiList.Ppi =3D &Private->BlkIo2Ppi; >=20 > PeiServicesInstallPpi (&Private->BlkIoPpiList); >=20 >=20 >=20 > - // >=20 > - // Nvm Express Pass Thru PPI >=20 > - // >=20 > - Private->PassThruMode.Attributes =3D > EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL | >=20 > - > EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL | >=20 > - > EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM; >=20 > - Private->PassThruMode.IoAlign =3D sizeof (UINTN); >=20 > - Private->PassThruMode.NvmeVersion =3D > EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI_REVISION; >=20 > - Private->NvmePassThruPpi.Mode =3D &Private->PassThruMo= de; >=20 > - Private->NvmePassThruPpi.GetDevicePath =3D > NvmePassThruGetDevicePath; >=20 > - Private->NvmePassThruPpi.GetNextNameSpace =3D > NvmePassThruGetNextNameSpace; >=20 > - Private->NvmePassThruPpi.PassThru =3D NvmePassThru; >=20 > - CopyMem ( >=20 > - &Private->NvmePassThruPpiList, >=20 > - &mNvmePassThruPpiListTemplate, >=20 > - sizeof (EFI_PEI_PPI_DESCRIPTOR) >=20 > - ); >=20 > - Private->NvmePassThruPpiList.Ppi =3D &Private->NvmePassTh= ruPpi; >=20 > - PeiServicesInstallPpi (&Private->NvmePassThruPpiList); >=20 > - >=20 > // >=20 > // Check if the NVME controller supports the Security Receive/Send > commands >=20 > // >=20 > -- > 2.16.2.windows.1