From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.7407.1603761322851577225 for ; Mon, 26 Oct 2020 18:15:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ToXHIf/v; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: hao.a.wu@intel.com) IronPort-SDR: DrhoNEPsnd/u5bK55TsSGuCoaWCZdYq3ATYv9F++HjeyYVrfPVA8+Hpb09H7313PG9SF3bgXWX viSGGq92m/6Q== X-IronPort-AV: E=McAfee;i="6000,8403,9786"; a="168136750" X-IronPort-AV: E=Sophos;i="5.77,421,1596524400"; d="scan'208";a="168136750" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 18:15:19 -0700 IronPort-SDR: S/avnt/CYI+RK07p5C5KgTo+yVjkrv86y+XG7o4qMX23BjAxY8YSLDLX4weKDL2+JnN8lwaoTM Qx6VPPAIzRYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,421,1596524400"; d="scan'208";a="525701040" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga005.fm.intel.com with ESMTP; 26 Oct 2020 18:15:18 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 26 Oct 2020 18:15:18 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 26 Oct 2020 18:15:18 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 26 Oct 2020 18:15:18 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 26 Oct 2020 18:15:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=blOa7RkwfHoP34tEm/2KtfCDjCVMnmKRpF+xpgkxI5M1onwQob2h6yWwFlQodkjsUwU80f960lgtNxhrS/e8G8mi+FjB2K+FIkgRxBzJKgOE6Cn0q7AerkEQxS4PooXfcZOgmHwrwyCbOQZFjVR7J9wBjGiceLUCIVRiVhCToMandS/zVlvpNLqJL7r/LO3355Y345PwaX/diTmERksIKmQF3vHQPVKJXmyU0BM7Uvi1P5W7kM4u/hXLEB0VuZnwf7MhrFQ2X6k3j5ddlqkCrFIV73gapA5a23Q+TGMYsM1TDf6dkSEZ+6xB8aIfz+Dopf+MfwrdmAVuovfLxf2bNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eFtbwSa1Bza88OZjxmaAAGGTXiSr8MV7UUUuq+NG+hk=; b=EHR58tSOJnU8Ic8IxbIWY39vJAiYenqaTdmhwzcu/O8tQtKk/nNM5VDYN0gmndjk9U8m2r/pE9XX8p40dmMWlvTzAUlUuHFvIA5xOLMowYpB0qZEhSSvTf1tI0jzozNDX1m91or7q85NGdJb87AxOnbYNQ0/jyVdNZmqUiPfUqfeR5WOaDSoA82ivsaYGcDSALZw4r2Hmj/EsLA58qiR8p4vnLlRd7p3MvaWgsDVT5vpQA8353SU0LJJB3WKXfGuOS56dZiopdx/aKnTdR7a4KAPmVqn7cnlk7YQtVullAD5uxyu6zCKWqqudkdUSXhbqh6LB1UHXTTaNU8Wy6SZWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eFtbwSa1Bza88OZjxmaAAGGTXiSr8MV7UUUuq+NG+hk=; b=ToXHIf/vwdbZUjOEsF0350DBm1EVIDfotoTRC5PRy0sY6QtixEBu02IBYs3o8Od21GhqclEIIkG9fxa+//VcNG7VuEkjiLrWYP+zm0mjbYjBPAwQexAPXMZ2r2kxKorEme/L+JaYZVxXaF/CBbEh98hxcJc2pgF7CzcpTt+RTy4= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB1554.namprd11.prod.outlook.com (2603:10b6:405:b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Tue, 27 Oct 2020 01:15:15 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::c123:faac:1da3:f807]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::c123:faac:1da3:f807%5]) with mapi id 15.20.3477.028; Tue, 27 Oct 2020 01:15:15 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Wu, Hao A" , "Luo, Heng" CC: "Ni, Ray" Subject: Re: [edk2-devel] [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot initialization failure Thread-Topic: [edk2-devel] [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot initialization failure Thread-Index: AQHWqNzNbZrJG2y2g0Cdw6qUODc26amlIyRQgAWIJlA= Date: Tue, 27 Oct 2020 01:15:14 +0000 Message-ID: References: <20201023012611.4808-1-heng.luo@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a6c83c51-7be2-49b4-11e2-08d87a15c29a x-ms-traffictypediagnostic: BN6PR11MB1554: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SVJWU8+oRU5xJyogxb7m+8Y6VkT7gtLdVJEOpDE1GaTZxkD6oKX8/oWnZCWz+7eAk+qYc7GbannKGdQAG/Mbz0TiAJfch5N9ZU+/2uQymEWw2iRelECwLo2aOnRQ3HoKMGtrjmV0rYNfkVDTtHU35nj8AoBt+/m6DfFq8s6J1BG68fdA1Ycxwtxx3nwyOLz1KkbhIeJUq849KI+2PdfwIh35iyjCfpxyPOjKsDa3o7JoSX9I51rvvkyLsAoXayZ4UY0Ys9m0mkRbAo4wNxTKAATztOje+PiPC8vYbgLM94y/Q0nZikXTWdCCwLPU+S4mO4gKZo/3kWLu3Q3GdNRpANjrzZEXcrB7F8gXuo5HEwpwaQNcUWqmK8qtUPVEbIa5GQOCwr2DsLUPqu9wn3PtXw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(366004)(136003)(346002)(39860400002)(53546011)(76116006)(8936002)(316002)(45080400002)(6506007)(64756008)(5660300002)(52536014)(478600001)(7696005)(86362001)(966005)(26005)(66946007)(19627235002)(107886003)(66446008)(33656002)(66476007)(66556008)(186003)(2906002)(8676002)(55016002)(71200400001)(9686003)(6636002)(4326008)(110136005)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: dg+Qf8yz6PnTQ4GOwGWr2nXoBgrlM7Y8jpsyon2P2lKkdjVOsvrOEhcOKTwJ+LT1vNJ+XIiMAZfCBHDSetG7wOE26dFtV3rkouyA85egYohgXSsmPIrmTHD424OzkUL0j9egLfa/TrqtLnySExfZMo7xZPqH15trDi4cJcBgskhhPajUJRgyrGOcyrIBQw1QmmTAcYQEDjjdUprIyJAJnfFRNX0R2iZIuQhrdfHRxik4cYfeW70q7kMNMV9fPFSaWIoxSfutvnUs6gevJp+xAd7ou3cnyoiCS47M7Lp37M9MyOnddkzqJQ49yqC8oCCpMN+g0R7CpCJvdwFqNTeKDqGmKeXYEh8IMa7KfoiFik+4QEFbKvHtwZuaIuUl/FeglS3TWYI7tajahj8szsqUJncV2mjS80tZKnuj6KDm16kKqPjfe1Yt7y4/8YafK8tGBIBtddpfOGcJK4HMtmYgVMcZZIISd93nLc1uFg79utxFIXp48qy/Tr+2v9yAusiMTsXKUbbT3n1KennWjSCvMk6+L6fpx25183N4eL656ZKp754IoJ8BtE7jk8FqgpOgsRwZLDhenmazEnrZ0cAXaf0oVPfhKBmizHBycAeK0JoBnISYplwlzSfvURBUVU6E56DVWzxkXa7BVyEhcUkwMA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6c83c51-7be2-49b4-11e2-08d87a15c29a X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2020 01:15:14.9444 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 58INuKTuTPZSK6CHwZf9Eb0ZeRLPl7dDHgMIEZR2fO4IQTm/NemX20C55AVUMRneG66wJRNHl2bqWQCvLej5EQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1554 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Wu, Hao > A > Sent: Friday, October 23, 2020 8:46 PM > To: Luo, Heng ; devel@edk2.groups.io > Cc: Ni, Ray > Subject: Re: [edk2-devel] [Patch V4] MdeModulePkg/XhciDxe: Error handle > for USB slot initialization failure >=20 > > -----Original Message----- > > From: Luo, Heng > > Sent: Friday, October 23, 2020 9:26 AM > > To: devel@edk2.groups.io > > Cc: Ni, Ray ; Wu, Hao A > > Subject: [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot > > initialization failure > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3007 > > > > Currently UsbDevContext is not cleaned up if USB slot initialization > > is failed, the wrong context data will affect next USB devices and the > > USB devices can not be enumerated. > > Need to disable slot if USB slot initialization is failed. > > > > Below test cases are passed on UpXtreme: > > a. USB 3.0 thumb drives can be recognized in UEFI shell b. SUT can > > boot to Puppylinux from USB3.0 mass storage, the storage can be > recognized in linux c. > > Plug in a USB keyboard (hot plug) and enumeration is OK in UEFI > > shell and linux d. Plug in a USB mouse(hot plug) and enumeration is OK= in > linux. >=20 >=20 > Reviewed-by: Hao A Wu Pushed via: PR: https://github.com/tianocore/edk2/pull/1049 Commit: https://github.com/tianocore/edk2/commit/a3212009d95bbcba7d08076ab= a2eee51eb1f8e7c Best Regards, Hao Wu >=20 > Best Regards, > Hao Wu >=20 >=20 > > > > Cc: Ray Ni > > Cc: Hao A Wu > > Signed-off-by: Heng Luo > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 9cb115363c..00e9cc63d6 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -2,7 +2,7 @@ > > XHCI transfer scheduling routines. -Copyright (c) 2011 - 2018, > > Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2020, > > Intel Corporation. All rights reserved.
Copyright (c) Microsoft > > Corporation.
> > SPDX-License-Identifier: BSD-2-Clause-Patent @@ -2279,6 +2279,9 @@ > > XhcInitializeDeviceSlot ( > > DeviceAddress =3D (UINT8) ((DEVICE_CONTEXT *) OutputContext)- > > >Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned > > successfully\n", DeviceAddress)); Xhc- > >UsbDevContext[SlotId].XhciDevAddr =3D > > DeviceAddress;+ } else {+ DEBUG ((DEBUG_INFO, " Address %d > assigned > > unsuccessfully\n"));+ XhcDisableSlotCmd (Xhc, SlotId); } retur= n > Status;@@ - > > 2489,7 +2492,11 @@ XhcInitializeDeviceSlot64 ( > > DeviceAddress =3D (UINT8) ((DEVICE_CONTEXT_64 *) OutputContext)- > > >Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned > > successfully\n", DeviceAddress)); Xhc- > >UsbDevContext[SlotId].XhciDevAddr =3D > > DeviceAddress;+ } else {+ DEBUG ((DEBUG_INFO, " Address %d > assigned > > unsuccessfully\n"));+ XhcDisableSlotCmd64 (Xhc, SlotId); }+ ret= urn > Status; } -- > > 2.24.0.windows.2 >=20 >=20 >=20 >=20 >=20