From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.2759.1571104565962972519 for ; Mon, 14 Oct 2019 18:56:06 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 18:56:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,297,1566889200"; d="scan'208";a="220278074" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 14 Oct 2019 18:56:04 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 18:56:04 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Oct 2019 18:56:04 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Oct 2019 18:56:03 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX151.ccr.corp.intel.com ([10.239.6.50]) with mapi id 14.03.0439.000; Tue, 15 Oct 2019 09:56:02 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Wu, Hao A" , "Agrawal, Sachin" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UfsPassThru : Fix UFS flag read from Query Resp UPIU Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/UfsPassThru : Fix UFS flag read from Query Resp UPIU Thread-Index: AQHVcgTd/yaOFny/skmuk4n5T0uRBqc5OYSwgCHZsDA= Date: Tue, 15 Oct 2019 01:56:01 +0000 Message-ID: References: <74c3980e787f85e769890c2677b4a0b1ae1e85a8.1569238938.git.sachin.agrawal@intel.com> In-Reply-To: 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: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Wu, Hao A > Sent: Thursday, September 26, 2019 9:40 AM > To: devel@edk2.groups.io; Agrawal, Sachin > Cc: Ni, Ray > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UfsPassThru : Fix UFS > flag read from Query Resp UPIU >=20 > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Agrawal, Sachin > > Sent: Monday, September 23, 2019 7:48 PM > > To: devel@edk2.groups.io > > Cc: Agrawal, Sachin; Wu, Hao A; Ni, Ray > > Subject: [edk2-devel] [PATCH] MdeModulePkg/UfsPassThru : Fix UFS flag > > read from Query Resp UPIU >=20 >=20 > When pushing the patch, I will change the subject a little bit to: > MdeModulePkg/Ufs : Fix UFS flag read from Query Resp UPIU >=20 > Other than this, the patch looks good to me: > Reviewed-by: Hao A Wu Patch pushed via commit cd70b1a71d. Best Regards, Hao Wu >=20 > Best Regards, > Hao Wu >=20 >=20 > > > > As per UFS spec, flag value is stored in the 'last byte' of value > > field. Existing code is attempting to read first byte. > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2208 > > > > Test: Verified the Fix by sending command to set fPowerOnWPEn flag > > and then reading it to verify the set value. > > > > Cc: Hao A Wu > > Cc: Ray Ni > > > > Signed-off-by: Sachin Agrawal > > --- > > MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c | 5 ++++- > > MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 5 ++++- > > 2 files changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c > > b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c > > index e8ef0c2a7a..e450f6f49d 100644 > > --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c > > +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c > > @@ -977,7 +977,10 @@ UfsRwFlags ( > > } > > > > if (Trd->Ocs =3D=3D 0) { > > - *Value =3D (UINT8)QueryResp->Tsf.Value; > > + // > > + // The 'FLAG VALUE' field is at byte offset 3 of QueryResp->Tsf.V= alue > > + // > > + *Value =3D *((UINT8*)&(QueryResp->Tsf.Value) + 3); > > } else { > > Status =3D EFI_DEVICE_ERROR; > > } > > diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > > b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > > index 0b95e7dddd..93ac958f65 100644 > > --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > > +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c > > @@ -863,7 +863,10 @@ UfsGetReturnDataFromQueryResponse ( > > case UtpQueryFuncOpcodeSetFlag: > > case UtpQueryFuncOpcodeClrFlag: > > case UtpQueryFuncOpcodeTogFlag: > > - CopyMem (Packet->DataBuffer, &QueryResp->Tsf.Value, sizeof > (UINT8)); > > + // > > + // The 'FLAG VALUE' field is at byte offset 3 of QueryResp->Tsf= .Value > > + // > > + *((UINT8*)(Packet->DataBuffer)) =3D *((UINT8*)&(QueryResp- > >Tsf.Value) > > + 3); > > break; > > case UtpQueryFuncOpcodeRdAttr: > > case UtpQueryFuncOpcodeWrAttr: > > -- > > 2.14.3.windows.1 > > > > > > >=20 >=20 >=20