From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 059D9819DE for ; Fri, 6 Jan 2017 00:33:51 -0800 (PST) Received: by mail-qk0-x236.google.com with SMTP id n21so458364329qka.3 for ; Fri, 06 Jan 2017 00:33:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lPoXGrIkIigu47/KF2Gx1omfH/ZVeugm6YCwwmT8HPg=; b=AxyS86gGvNU25Cdgtc6MlPZKEuK7o9ZrRJ+TYXhhGg0gSWQqMyCA9XWvg29DZdnNH2 tYVOv6c2jtqXZhs3/UAK2yoqRAi2FeF0DAdTpz5S6liJ18i5QsVC46gDaPUoMg58WnuY I3taOwwGkbqI4HOuqNdMvBG9e45xJA+CTodL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lPoXGrIkIigu47/KF2Gx1omfH/ZVeugm6YCwwmT8HPg=; b=rUatEWkHH9+O3aZAqjMMM/oEFFBomhLVB8XyLK9ujs4xbkKduxXvGQRioFx4UTTzHr G/EFnEBqLr5kVsn38kVo4/39A0IAa+3mRmZYyG3MV4mmWxaOIHMneUWSFXElc0/klkE9 dCwRtuOAmQMHrI9PmS4+SeVTbQdqFffmnGoN9xQi+PmAKZYSEe/JTgOWhNXj88aPtL0w HHprxVfs+PYGXjWu826b/Q1hUnfNg/eaABCvikTHBFdgQ5N+HoT7M8EuDgs8f/DIGJvn CI1wzaRY2sLUSzjDQ5FGcFFwb1xt1oplMzhjBhpjG1399BRWvt0bYl0cf0GHe6Oods2I BUPw== X-Gm-Message-State: AIkVDXLxWH0z979DDBMKzQAmjCaoTnNxqqbG795cAeAG2XxmhpuWsQ43vYkJ/HTnvoxyshXahYp2zwsSuqLWtIpD X-Received: by 10.55.122.197 with SMTP id v188mr68733385qkc.120.1483691630235; Fri, 06 Jan 2017 00:33:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.41.114 with HTTP; Fri, 6 Jan 2017 00:33:49 -0800 (PST) In-Reply-To: <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> <7F1BAD85ADEA444D97065A60D2E97EE5699A5FA5@SHSMSX101.ccr.corp.intel.com> From: Haojian Zhuang Date: Fri, 6 Jan 2017 16:33:49 +0800 Message-ID: To: "Tian, Feng" Cc: "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" 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 08:33:51 -0000 Content-Type: text/plain; charset=UTF-8 Hi Feng, Yes, it's a different flag. My fix is wrong. Best Regards Haojian On 6 January 2017 at 15:08, Tian, Feng wrote: > 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 -= ResTranCount;" to return actual 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 transfer than the Initiator requested. It's not designated for your below intention. > > Thanks > Feng > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Haojian Zhuang > Sent: Friday, January 6, 2017 2:52 PM > To: Tian, Feng ; leif.lindholm@linaro.org; ard.biesheuvel@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/MdeModulePkg/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 ( > > if (TransReq->Trd->Ocs == 0) { > if (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ) { > - if ((Response->Flags & BIT5) == BIT5) { > + if ((Response->Flags & BIT6) == BIT6) { > ResTranCount = Response->ResTranCount; > SwapLittleEndianToBigEndian ((UINT8*)&ResTranCount, sizeof (UINT32)); > Packet->InTransferLength -= ResTranCount; @@ -2321,7 +2321,7 @@ ProcessAsyncTaskList ( > > if (TransReq->Trd->Ocs == 0) { > if (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ) { > - if ((Response->Flags & BIT5) == BIT5) { > + if ((Response->Flags & BIT6) == BIT6) { > ResTranCount = Response->ResTranCount; > SwapLittleEndianToBigEndian ((UINT8*)&ResTranCount, sizeof (UINT32)); > Packet->InTransferLength -= ResTranCount; > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel