From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by mx.groups.io with SMTP id smtpd.web11.6388.1603446584540141855 for ; Fri, 23 Oct 2020 02:49:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gpPtJNLf; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 216.228.121.65, mailfrom: jonathanh@nvidia.com) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 23 Oct 2020 02:49:31 -0700 Received: from [10.26.45.125] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 23 Oct 2020 09:49:40 +0000 Subject: Re: [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot initialization failure To: "Wu, Hao A" , "Luo, Heng" , "devel@edk2.groups.io" , "jbrasen@nvidia.com" CC: "Ni, Ray" References: <20201023012611.4808-1-heng.luo@intel.com> From: Jon Hunter Message-ID: <0aa621c2-e20d-67a0-e2b8-2ef205410f7d@nvidia.com> Date: Fri, 23 Oct 2020 10:49:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Return-Path: jonathanh@nvidia.com X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603446571; bh=ShY0NDEiH0agOT2L199S14F/m5sGL2hcAhTxyJf2ckQ=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=gpPtJNLfIa14/Gc+lCIY2lJ7lIeSnjfU3Te1xlBtqJuGqs0PbPzcBsFNCCnXp53gN FKnj5enYAngk90i47s/xn3bOjkVZHj93jcRp4SdzfV/tQH/6yvetkVjhK5NOFIMbAk T941ZGXpfG5GteQWhzYHlBvy55HZfnaDa1xU3p0RL9yDZcK2Sc3kLVAC612867NTWk SscZtJAlUJNeaZ8+DKYOc4drh1pkxmDScCWcGqu7vhfWigAguKd8ZeypR3EccyZU0H 5zVroxicR3cFRAYafRb09367RyFbqK7ssKZ2Q0ssJs8Nvq3Ex74ouXay65JaZZAb9m RIj9A1kIXYCDw== Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Hao, Thanks. Yes this works with my patch. I will send out a V2 for my patch shortly. For this patch you can add my ... Tested-by: Jon Hunter Reviewed-by: Jon Hunter Cheers Jon On 23/10/2020 03:52, Wu, Hao A wrote: > 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 >> >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3007 >> >> 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/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 = (UINT8) ((DEVICE_CONTEXT *) OutputContext)- >>> Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned >> successfully\n", DeviceAddress)); Xhc- >>> UsbDevContext[SlotId].XhciDevAddr = DeviceAddress;+ } else {+ DEBUG >> ((DEBUG_INFO, " Address %d assigned unsuccessfully\n"));+ >> XhcDisableSlotCmd (Xhc, SlotId); } return Status;@@ -2489,7 +2492,11 @@ >> XhcInitializeDeviceSlot64 ( >> DeviceAddress = (UINT8) ((DEVICE_CONTEXT_64 *) OutputContext)- >>> Slot.DeviceAddress; DEBUG ((EFI_D_INFO, " Address %d assigned >> successfully\n", DeviceAddress)); Xhc- >>> UsbDevContext[SlotId].XhciDevAddr = DeviceAddress;+ } else {+ DEBUG >> ((DEBUG_INFO, " Address %d assigned unsuccessfully\n"));+ >> XhcDisableSlotCmd64 (Xhc, SlotId); }+ return Status; } -- >> 2.24.0.windows.2 > -- nvpublic