From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 D13BC81943 for ; Thu, 5 Jan 2017 23:08:08 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP; 05 Jan 2017 23:08:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="50142891" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 05 Jan 2017 23:08:08 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 23:08:08 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 23:08:08 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 15:08:06 +0800 From: "Tian, Feng" To: Haojian Zhuang , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" CC: "Tian, Feng" Thread-Topic: [edk2] [PATCH 1/9] Ufs: fix data direction checking Thread-Index: AQHSZ+l6ZGflol9In0yOWrnd8O+0uKErBeEQ Date: Fri, 6 Jan 2017 07:08:05 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699A5FA5@SHSMSX101.ccr.corp.intel.com> References: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> <1483685538-11058-2-git-send-email-haojian.zhuang@linaro.org> In-Reply-To: <1483685538-11058-2-git-send-email-haojian.zhuang@linaro.org> 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 1/9] Ufs: fix data direction checking X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 07:08:08 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Haojian, The bit 5 is Flags.U of RESPONSE UPIU, which means the Target has less data= bytes to transfer than the Initiator requested. That's why we use "Packet->InTransferLength -=3D ResTranCount;" to return a= ctual transfer data length. It's not related data direction checking. The bit 6 is Flags.O, which means the Target has more data bytes to transfe= r than the Initiator requested. It's not designated for your below intentio= n. Thanks Feng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Haoj= ian Zhuang Sent: Friday, January 6, 2017 2:52 PM To: Tian, Feng ; leif.lindholm@linaro.org; ard.biesheu= vel@linaro.org; edk2-devel@lists.01.org Cc: Haojian Zhuang Subject: [edk2] [PATCH 1/9] Ufs: fix data direction checking BIT6 is used in read operation, and BIT5 is used in write operation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModu= lePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 3bd6dad..9b77a89 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -1564,7 +1564,7 @@ UfsExecScsiCmds ( =20 if (TransReq->Trd->Ocs =3D=3D 0) { if (Packet->DataDirection =3D=3D EFI_EXT_SCSI_DATA_DIRECTION_READ) { - if ((Response->Flags & BIT5) =3D=3D BIT5) { + if ((Response->Flags & BIT6) =3D=3D BIT6) { ResTranCount =3D Response->ResTranCount; SwapLittleEndianToBigEndian ((UINT8*)&ResTranCount, sizeof (UINT32= )); Packet->InTransferLength -=3D ResTranCount; @@ -2321,7 +2321,7 @@ = ProcessAsyncTaskList ( =20 if (TransReq->Trd->Ocs =3D=3D 0) { if (Packet->DataDirection =3D=3D EFI_EXT_SCSI_DATA_DIRECTION_REA= D) { - if ((Response->Flags & BIT5) =3D=3D BIT5) { + if ((Response->Flags & BIT6) =3D=3D BIT6) { ResTranCount =3D Response->ResTranCount; SwapLittleEndianToBigEndian ((UINT8*)&ResTranCount, sizeof (= UINT32)); Packet->InTransferLength -=3D ResTranCount; -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel