From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 706972034C5CE for ; Tue, 21 Nov 2017 22:04:40 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2017 22:08:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="10583361" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 21 Nov 2017 22:08:56 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Nov 2017 22:08:55 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Nov 2017 22:08:55 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 22 Nov 2017 14:08:55 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU Thread-Index: AQHTYqeynOb0I6Q0YEy1iMcm0lUzSaMf62PQ Date: Wed, 22 Nov 2017 06:08:54 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA27BA5@shsmsx102.ccr.corp.intel.com> References: <1511255028-10804-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1511255028-10804-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTdhNDVlODktMzI0ZS00NGM0LThkNTgtZmQzYTgyZGI2NDgzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI4ZHFRR1BmYUpVWE1RaGxPVTk3dnhjTFJQc3ZyN0pmMis1ZWZOUm1cL3Vnd1RsdThudER3Q2xaNUQ0S2k1aVBqMiJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Wed, 22 Nov 2017 06:04:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 ; Yao, Jiewen > Subject: [PATCH] MdeModulePkg EhciPei: Minor refinement about IOMMU >=20 > 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. >=20 > 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(-) >=20 > 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 =3D=3D NULL) { > goto ON_ERROR; > } > - > + > + Urb->RequestPhy =3D NULL; > + Urb->RequestMap =3D NULL; > + Urb->DataPhy =3D NULL; > + Urb->DataMap =3D NULL; > + > // > // Map the request and user data > // > @@ -591,9 +596,6 @@ EhcCreateUrb ( >=20 > Urb->RequestPhy =3D (VOID *) ((UINTN) PhyAddr); > Urb->RequestMap =3D Map; > - } else { > - Urb->RequestPhy =3D NULL; > - Urb->RequestMap =3D NULL; > } >=20 > if (Data !=3D NULL) { > @@ -613,9 +615,6 @@ EhcCreateUrb ( >=20 > Urb->DataPhy =3D (VOID *) ((UINTN) PhyAddr); > Urb->DataMap =3D Map; > - } else { > - Urb->DataPhy =3D NULL; > - Urb->DataMap =3D NULL; > } >=20 > Status =3D EhcCreateQtds (Ehc, Urb); > -- > 2.7.0.windows.1