public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Tian, Feng" <feng.tian@intel.com>,
	"Dong, Eric" <eric.dong@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH v2] MdeModulePkg/SdMmcPciHcDxe: call SdMmcFreeTrb() to complete sync operation
Date: Mon, 6 Nov 2017 01:12:44 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A0931D1A2A3@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20171105093054.22349-1-ard.biesheuvel@linaro.org>

Reviewed-by: Hao Wu <hao.a.wu@intel.com>


Best Regards,
Hao Wu


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard
> Biesheuvel
> Sent: Sunday, November 05, 2017 5:31 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; Dong, Eric; Zeng, Star; Ard Biesheuvel
> Subject: [edk2] [PATCH v2] MdeModulePkg/SdMmcPciHcDxe: call
> SdMmcFreeTrb() to complete sync operation
> 
> Currently, we complete a synchronous operation without unmapping the
> DMA mappings, and free the pages using FreePages () rather than calling
> EFI_PCI_IO_PROTOCOL::FreeBuffer. This is simply incorrecnt, but it also
> breaks non-coherent DMA as well as DMA protection and/or memory
> encryption
> so let's do it correctly and call SdMmcFreeTrb() instead.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> index 23faec5e2be0..0be8828abfcc 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> @@ -1008,13 +1008,7 @@ SdMmcPassThruPassThru (
>    }
> 
>  Done:
> -  if ((Trb != NULL) && (Trb->AdmaDesc != NULL)) {
> -    FreePages (Trb->AdmaDesc, Trb->AdmaPages);
> -  }
> -
> -  if (Trb != NULL) {
> -    FreePool (Trb);
> -  }
> +  SdMmcFreeTrb (Trb);
> 
>    return Status;
>  }
> --
> 2.11.0
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2017-11-06  1:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05  9:30 [PATCH v2] MdeModulePkg/SdMmcPciHcDxe: call SdMmcFreeTrb() to complete sync operation Ard Biesheuvel
2017-11-06  1:12 ` Wu, Hao A [this message]
2017-11-06  8:56 ` Zeng, Star
2017-11-06 10:34   ` Ard Biesheuvel

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=B80AF82E9BFB8E4FBD8C89DA810C6A0931D1A2A3@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