From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.3362.1603421530042925591 for ; Thu, 22 Oct 2020 19:52:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=mYL49p3/; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: hao.a.wu@intel.com) IronPort-SDR: nkIkq+FlNP02mx8EO1BGwsEiPZNbrnGL1YuBrsLDfjn3wnc1udVtjSpNVaCZkM+pY4xB+kN2bH Jwmbk3ZsHahQ== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="252319823" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="252319823" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 19:52:09 -0700 IronPort-SDR: EAjaq3I/mSW8xiPCaf7IMP+D1ZHvGNHLHthe2fLGoaGdrYQ8faUULdxUHANmmZIsMLjTpwJNY3 ZLdeSRPljzZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="316940246" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 22 Oct 2020 19:52:08 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 22 Oct 2020 19:52:08 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 22 Oct 2020 19:52:08 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.171) 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; Thu, 22 Oct 2020 19:52:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQ3Fgp9WZes1MeHyZ/XZYSCvfVgGIWamdHaA5cVOTmS9UO5T2bs43MsxKLcjxdhu0O9DrqkIhJIwrGmkk6qPbo6Ka2/EuT2pQfQpegK6+fNtN/mT6ABy6pr0E2jO63BPLjIw1p1fsthtXzGZYU7y3nOibmROZJbWOG25cRXg3Dq4gkCxKsZhQ/7ZRMzqJn3E3kWv4v9m9Wxnx81SrqjM1OAK+tIBbkCWlhqwZS3jGKDulkJ9xSVOvapxKKGHWNqX2orEKNs0WEId6ZANCpBEhuP4H9eLZmN5TwB27yJHi0HYfMMidW+mWSA3ugV/+YRKtAiVLhYQq2WGqwRwaOjfCA== 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=zx48YQc8lCb/5wnuun93rD/YHnyTbOPQKz5cCmOmR9I=; b=h5jv7zjycVfulF9CHy2qXVT5xlwMBYTeA0EiNk/jyCZT6+N67e+UPwUu/ifFa01dh72ODtTp42N0Bq7H8RnO28eaViuDr2wRNMvqryZk/P/+rLYuF2vcXnisQbeAQrE82x3vnbVCzoKOt72ZhKZ5Sq+LF/wzTds76xc1QxQ0a3C0UCoAcNbWSirPldHr2RW+OgtZcxXm8sKsJK0WuimOclGu1IJiUD2otSYyrzx6qer7RpMTT0g6ix/ZOjTE6r2rwde+nAhLE2tgwQSeDfC74h9q6KHq1cKR/0b8LTnEkg0QDlbG/r8NB4ys55y7GrpF2MqDlEQhiath1qfzf0FSbg== 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=zx48YQc8lCb/5wnuun93rD/YHnyTbOPQKz5cCmOmR9I=; b=mYL49p3/usPC0CrBZAS1FWEllAD0XheF7Irl1R/bWErznNBKJqica7wu3+6Uv7R8eB7GXft8rThsOHdhcI3GIqCMu3K2aN0w9APmbEmBa+UMCWtJH8X3u4/Y2KyFbvcdjqpaQkwbomXZ2zlZjUi6sfy7snL6wEv3Lgs4I+Zjx3k= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN8PR11MB3667.namprd11.prod.outlook.com (2603:10b6:408:88::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Fri, 23 Oct 2020 02:52:05 +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; Fri, 23 Oct 2020 02:52:05 +0000 From: "Wu, Hao A" To: "Luo, Heng" , "devel@edk2.groups.io" , Jon Hunter , "jbrasen@nvidia.com" CC: "Ni, Ray" Subject: Re: [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot initialization failure Thread-Topic: [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot initialization failure Thread-Index: AQHWqNzNbZrJG2y2g0Cdw6qUODc26amkfPUw Date: Fri, 23 Oct 2020 02:52:05 +0000 Message-ID: References: <20201023012611.4808-1-heng.luo@intel.com> In-Reply-To: <20201023012611.4808-1-heng.luo@intel.com> 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: intel.com; dkim=none (message not signed) header.d=none;intel.com; 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: fdba1347-b485-4e6e-c7ed-08d876fea063 x-ms-traffictypediagnostic: BN8PR11MB3667: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e/BMAW9t2bdLVZhb6ZBmAyDbjYOfLeYRI73YRRPLj53U8ECtJbKBf071sr66FohTwCb0TP+Ic8yveMQwhcZk1gzDTEGz7khx5aUwLnXehn6E+vo2jDbAiBKtb0LoNqPALmgUqtGOsxLoGXJKGwDWC9uf1mOMzd3dnlMfi5bG6sdmoZjo2YcLnZ7YmPTuzqfbD3a4R3cidGP1uWEmccBrJ3YHOe/1xSF2f+SNPwpiaMnlsxNTGLAjz/6NqhnyAyi4DiLsKCBVjypIAbwmMckpwfwuOpMvncr8Ol+4nhGWcHajU00970YYpSjKn7p5SMUsTBml1V/Fok7LVBHOJrU5ejmCP03tiZLyyRjaPo2s7wnaPqj7LmsT/Zzzg3hJmek8VeUDSJKQEqE5thdJp/TWxw== 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)(396003)(136003)(366004)(376002)(39860400002)(346002)(66476007)(9686003)(2906002)(86362001)(186003)(8676002)(5660300002)(8936002)(316002)(966005)(52536014)(71200400001)(110136005)(33656002)(7696005)(19627235002)(107886003)(4326008)(66446008)(66946007)(55016002)(6506007)(45080400002)(64756008)(26005)(53546011)(478600001)(76116006)(83380400001)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: AqYlfSuUakVOVZVNB/Osa6dW6WwFamrZ0jZ0Id/wiqDfOdTlwJUZf0dLa6ZLXrppx58w55HfLUNjTejLBkH1QxfAcLSFdbpMMdBRQcCbjmLjLf7TIJKAqJwSmIwFZ+5450s2+qhUV+usTJUHJezh4Kz5hDxHWGoy18Xx+iiHxJFaz5MyzlRY4094yWkqXryfSDoBfE2M2X4Wh3gcqdISBWeRPoA0d3QzRVBdsJ503odmUzbbBsS9l7fzlCGJeXX+RYxt2gtcKExMJbA3ZeQfesvxkm4APFm3dbbMxWJPfuxKU9SYJHTKjIx8TQUnrC8QxvRmR3fUJXCQqNj3EYUVmAnvKBJU2d2UhKAASgtbCHTRFz16LMNJ3FOoy94dxMCmuH7f++gDv4PoCbLGkWIpJ6tS0aDV4STq9BcHQbybxMjQsJ2EwjMXsW2z7NCZtUGCdaEKpKI1Tp+6isXPfIjMSNJWNICcFYAjr/7VBpPcSFr+xRESTty89p036/ferpE9b4pwCyjztIvMyfkyictEyaD6UmuNb3Cz2Ze/UOUd4jDDpdemKpGVnKFp/If8736g5rpGYuVNoQcf0/nF6pITGrC19zJxRXhyzG18QVnHEW14ySXdGUpZjMhWorvRPpv0KQ9YkIRd0myxRmywbDKG2A== 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: fdba1347-b485-4e6e-c7ed-08d876fea063 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2020 02:52:05.6270 (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: CfbLjvCY0QhLMxBw5i22SSCVix3pmhG16VDwQRIThbx0YnSb1lttPgQD90qyJ6Ch9EWOD3iWVVwW21TPogMJuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3667 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 Hello Jon, Could you help to check of this version will co-work with your patch? Thanks in advance. Best Regards, Hao Wu > -----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 >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3007 >=20 > Currently UsbDevContext is not cleaned up if USB slot initialization is f= ailed, > the wrong context data will affect next USB devices and the USB devices c= an > not be enumerated. > Need to disable slot if USB slot initialization is failed. >=20 > Below test cases are passed on UpXtreme: > a. USB 3.0 thumb drives can be recognized in UEFI shell b. SUT can boot t= o > 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 UEF= I > shell and linux d. Plug in a USB mouse(hot plug) and enumeration is OK in > linux. >=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(-) >=20 > 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 {+ DEBU= G > ((DEBUG_INFO, " Address %d assigned unsuccessfully\n"));+ > XhcDisableSlotCmd (Xhc, SlotId); } return 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 {+ DEBU= G > ((DEBUG_INFO, " Address %d assigned unsuccessfully\n"));+ > XhcDisableSlotCmd64 (Xhc, SlotId); }+ return Status; } -- > 2.24.0.windows.2