public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Tian, Feng" <feng.tian@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [patch] MdeModulePkg/Ufs: ensure the DBC field of UTP PRDT is dword-aligned
Date: Tue, 18 Oct 2016 06:30:18 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A092F2C362B@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <0fd6e31790f23ea8ad162df1fbc7ceb325770dcf.1476767885.git.feng.tian@intel.com>

The patch is good to me. Please update the copyright info before checkin.
Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu

> -----Original Message-----
> From: Tian, Feng
> Sent: Tuesday, October 18, 2016 1:19 PM
> To: Wu, Hao A
> Cc: edk2-devel@lists.01.org
> Subject: [patch] MdeModulePkg/Ufs: ensure the DBC field of UTP PRDT is
> dword-aligned
> 
> According to UFS Host Controller Spec(JESD223), the bits 1:0 of this
> DataByteCount field shall be 11b to indicate Dword granularity.
> 
> But the size of UFS Request Sense Data Response defined in UFS Spec
> (JESD220C) is 18 which is not Dword aligned, we would have to round
> down to the multiple of 4 to fill the DBC field to avoid bring issue
> on some UFS HCs.
> 
> Cc: Hao Wu <hao.a.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Feng Tian <feng.tian@intel.com>
> ---
>  MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
> b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
> index 26986cb..a854264 100644
> --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
> +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
> @@ -399,6 +399,11 @@ UfsInitUtpPrdt (
>    UINT32     RemainingLen;
>    UINT8      *Remaining;
>    UINTN      PrdtNumber;
> +
> +  if ((BufferSize & (BIT0 | BIT1)) != 0) {
> +    BufferSize &= ~(BIT0 | BIT1);
> +    DEBUG ((EFI_D_WARN, "UfsInitUtpPrdt: The BufferSize [%d] is not dword-
> aligned!\n", BufferSize));
> +  }
> 
>    if (BufferSize == 0) {
>      return EFI_SUCCESS;
> --
> 2.7.1.windows.2



      reply	other threads:[~2016-10-18  6:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  5:18 [patch] MdeModulePkg/Ufs: ensure the DBC field of UTP PRDT is dword-aligned Feng Tian
2016-10-18  6:30 ` Wu, Hao A [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B80AF82E9BFB8E4FBD8C89DA810C6A092F2C362B@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox