public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU
@ 2017-11-21  9:03 Star Zeng
  2017-11-22  6:08 ` Yao, Jiewen
  0 siblings, 1 reply; 2+ messages in thread
From: Star Zeng @ 2017-11-21  9:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Jiewen Yao

This patch is following 2c656af04d7f.
1. Fix typo "XHC" to "EHC".
2. Reinitialize Request(Phy/Map) and Data(Phy/Map)
in Urb, otherwise the last time value of them may
be used in error handling when error happens.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h |  2 +-
 MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
index 279407475b66..715a5ab1c142 100644
--- a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
+++ b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
@@ -99,7 +99,7 @@ struct _PEI_USB2_HC_DEV {
   EDKII_IOMMU_PPI                     *IoMmu;
   EFI_PEI_PPI_DESCRIPTOR              PpiDescriptor;
   //
-  // EndOfPei callback is used to stop the XHC DMA operation
+  // EndOfPei callback is used to stop the EHC DMA operation
   // after exit PEI phase.
   //
   EFI_PEI_NOTIFY_DESCRIPTOR           EndOfPeiNotifyList;
diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
index 3dadcd60b6fe..baacf5d56080 100644
--- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
+++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
@@ -576,7 +576,12 @@ EhcCreateUrb (
   if (Urb->Qh == NULL) {
     goto ON_ERROR;
   }
-  
+
+  Urb->RequestPhy = NULL;
+  Urb->RequestMap = NULL;
+  Urb->DataPhy  = NULL;
+  Urb->DataMap  = NULL;
+
   //
   // Map the request and user data
   //
@@ -591,9 +596,6 @@ EhcCreateUrb (
 
     Urb->RequestPhy = (VOID *) ((UINTN) PhyAddr);
     Urb->RequestMap = Map;
-  } else {
-    Urb->RequestPhy = NULL;
-    Urb->RequestMap = NULL;
   }
 
   if (Data != NULL) {
@@ -613,9 +615,6 @@ EhcCreateUrb (
 
     Urb->DataPhy  = (VOID *) ((UINTN) PhyAddr);
     Urb->DataMap  = Map;
-  } else {
-    Urb->DataPhy  = NULL;
-    Urb->DataMap  = NULL;
   }
 
   Status = EhcCreateQtds (Ehc, Urb);
-- 
2.7.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU
  2017-11-21  9:03 [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU Star Zeng
@ 2017-11-22  6:08 ` Yao, Jiewen
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2017-11-22  6:08 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Tuesday, November 21, 2017 5:04 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU
> 
> This patch is following 2c656af04d7f.
> 1. Fix typo "XHC" to "EHC".
> 2. Reinitialize Request(Phy/Map) and Data(Phy/Map)
> in Urb, otherwise the last time value of them may
> be used in error handling when error happens.
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h |  2 +-
>  MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 13 ++++++-------
>  2 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
> b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
> index 279407475b66..715a5ab1c142 100644
> --- a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
> +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
> @@ -99,7 +99,7 @@ struct _PEI_USB2_HC_DEV {
>    EDKII_IOMMU_PPI                     *IoMmu;
>    EFI_PEI_PPI_DESCRIPTOR              PpiDescriptor;
>    //
> -  // EndOfPei callback is used to stop the XHC DMA operation
> +  // EndOfPei callback is used to stop the EHC DMA operation
>    // after exit PEI phase.
>    //
>    EFI_PEI_NOTIFY_DESCRIPTOR           EndOfPeiNotifyList;
> diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> index 3dadcd60b6fe..baacf5d56080 100644
> --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c
> @@ -576,7 +576,12 @@ EhcCreateUrb (
>    if (Urb->Qh == NULL) {
>      goto ON_ERROR;
>    }
> -
> +
> +  Urb->RequestPhy = NULL;
> +  Urb->RequestMap = NULL;
> +  Urb->DataPhy  = NULL;
> +  Urb->DataMap  = NULL;
> +
>    //
>    // Map the request and user data
>    //
> @@ -591,9 +596,6 @@ EhcCreateUrb (
> 
>      Urb->RequestPhy = (VOID *) ((UINTN) PhyAddr);
>      Urb->RequestMap = Map;
> -  } else {
> -    Urb->RequestPhy = NULL;
> -    Urb->RequestMap = NULL;
>    }
> 
>    if (Data != NULL) {
> @@ -613,9 +615,6 @@ EhcCreateUrb (
> 
>      Urb->DataPhy  = (VOID *) ((UINTN) PhyAddr);
>      Urb->DataMap  = Map;
> -  } else {
> -    Urb->DataPhy  = NULL;
> -    Urb->DataMap  = NULL;
>    }
> 
>    Status = EhcCreateQtds (Ehc, Urb);
> --
> 2.7.0.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-22  6:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21  9:03 [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU Star Zeng
2017-11-22  6:08 ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox