From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 CC2242034711E for ; Tue, 21 Nov 2017 00:59:39 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2017 01:03:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,432,1505804400"; d="scan'208";a="10220597" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by orsmga002.jf.intel.com with ESMTP; 21 Nov 2017 01:03:50 -0800 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Jiewen Yao Date: Tue, 21 Nov 2017 17:03:48 +0800 Message-Id: <1511255028-10804-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 08:59:40 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- 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