From nobody Mon May 6 00:41:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+66529+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+66529+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1603348611; cv=none; d=zohomail.com; s=zohoarc; b=FytOwomFhKCHT0kFj5ZR8sZfT5g5bW5O0BoC5arLJ/cPhGPLSBPwhSBmgcBEWj8pzOO10mJHkjRaCBNEHBexpeBlw05MccUXzKgWuVSgD/0yu4MDEM0NXtdFNxTbMRIF3Pog6FHPhho9x+wua5KkVj+/6Nw1YPcoQrVo8xpY0c0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603348611; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=0gBOlHFc53h+L4vO9pZUf8miQasMRtjXv07narAef3E=; b=lyNVx2Xqy3DQuRgyIWG5KbVj6TKvkbs/JAwlaRQrbrgI0u5UkkHKyp/A8/M6kJvmobs0chCEs+MDLNW3ybsLgmBkz92gzFy6sUaI4DJEYgatnoYzUt5nsuQgIoEEw0BToxbP4TONYFx9CAq1envR/qjAUlei3fjiA1ejgOr+gS8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+66529+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1603348611421830.8698349186584; Wed, 21 Oct 2020 23:36:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uo2VYY1788612xYvZAAnKlEk; Wed, 21 Oct 2020 23:36:51 -0700 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.6411.1603348605260923949 for ; Wed, 21 Oct 2020 23:36:45 -0700 IronPort-SDR: IxIbYhi416EP7WJKP+QKafm6vyX0gP4Zj7+UbikW/RC9lzKfc3+54YMaB4W5ehBW5SG0ciSx+y I7ymDWaicW5w== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="163989008" X-IronPort-AV: E=Sophos;i="5.77,403,1596524400"; d="scan'208";a="163989008" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 23:36:44 -0700 IronPort-SDR: kYzw2234fwPARn4IgtDzhIaOeGu8zvAXyfUDUEJEoeJJg1ZsTURxtYh+nah1Jg+ROg0jtkGcf8 YTtBctdFo9/g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,403,1596524400"; d="scan'208";a="524163837" X-Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.154]) by fmsmga005.fm.intel.com with ESMTP; 21 Oct 2020 23:36:43 -0700 From: "Heng Luo" To: devel@edk2.groups.io Cc: Ray Ni , Hao A Wu Subject: [edk2-devel] [Patch V3] MdeModulePkg/XhciDxe: Error handle for USB slot initialization failure Date: Thu, 22 Oct 2020 14:36:36 +0800 Message-Id: <20201022063636.4609-1-heng.luo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,heng.luo@intel.com X-Gm-Message-State: AV6TUdWBiyPLHQOAwM7e79YFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1603348611; bh=be6fwH0/hYq4sVti7ccbWSXYfAJXr/jiKtSJMUooPog=; h=Cc:Date:From:Reply-To:Subject:To; b=YRlpaR+zHFv6WgZq0BTO3QvUttLfpViW16It8SlObB6a3nOn3XIoI7AEdwYs3XfZD9R ElRhaPo3MoANVJyTe/Rt+g3Kb72Gle19ozS1b84XzUtzGRTL0X8UaKTGoMStBYRw3uJRW r3s2WDBXVSfDndQjZeGM4G5NL3FVcOAUUqM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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. 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/Pc= i/XhciDxe/XhciSched.c index 9cb115363c..98887c5f74 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -2,7 +2,7 @@ =20 XHCI transfer scheduling routines. =20 -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 =20 @@ -2279,6 +2279,9 @@ XhcInitializeDeviceSlot ( DeviceAddress =3D (UINT8) ((DEVICE_CONTEXT *) OutputContext)->Slot.Dev= iceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned successfully\n", DeviceAd= dress)); Xhc->UsbDevContext[SlotId].XhciDevAddr =3D DeviceAddress; + } else { + DEBUG ((DEBUG_INFO, " Address %d assigned unsuccessfully\n")); + Status =3D XhcDisableSlotCmd (Xhc, SlotId); } =20 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", DeviceAd= dress)); Xhc->UsbDevContext[SlotId].XhciDevAddr =3D DeviceAddress; + } else { + DEBUG ((DEBUG_INFO, " Address %d assigned unsuccessfully\n")); + Status =3D XhcDisableSlotCmd64 (Xhc, SlotId); } + return Status; } =20 --=20 2.24.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#66529): https://edk2.groups.io/g/devel/message/66529 Mute This Topic: https://groups.io/mt/77725292/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-