From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by mx.groups.io with SMTP id smtpd.web09.8208.1603458258689893945 for ; Fri, 23 Oct 2020 06:04:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=JdBYoQju; 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.143, mailfrom: jonathanh@nvidia.com) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 23 Oct 2020 06:02:43 -0700 Received: from [10.26.45.125] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 23 Oct 2020 13:04:12 +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> <0aa621c2-e20d-67a0-e2b8-2ef205410f7d@nvidia.com> From: Jon Hunter Message-ID: <6d3c1517-fb70-7698-0920-9eb01b374b2d@nvidia.com> Date: Fri, 23 Oct 2020 14:04:10 +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: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603458163; bh=KBFGC5gSAuB/9znHRY8f7ipBQxXPXE+PPgYDfc8sx+Y=; 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=JdBYoQjuIzTD42YSe0YMzSUoYgtlmtM2u6YVpvaXinPD9cMsh+MZTJ47lkIsBI1bb OLKwZYc4Ac+Y7UHvbq5zFg7O1DhhvRFgLH9SGnRLt9rIA7K/uAEfUAA5+rfbHzeWp2 DLC8emDqkQKf/QwmuENFG9DRDLuy1lazbKr5CwAXDIwUYhlsn7ytuRy2AVI2r/rSDW 1iNc7SX12hlWFrAXZC/bo56gDg2AH75CC+RDbsPElnBP5DVoyR9hm5JWxbWDfxexUl PrCOl9reLLV8HOE7UQWrGYATFX1I369nlqhq38uoBewnPOyPDNWaN9o8FgSTcvSuDy cTICf9qDPCmEA== Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Hao, No problem, next week is fine. Thanks Jon On 23/10/2020 13:44, Wu, Hao A wrote: > Hello Jon, > > Thanks for the testing effort. > If you patch is not urgent, could you hold your v2 patch until I merge Heng's > patch into the codebase? > > I will do it early next week and will inform you as soon as it is done. > Does it sound good to you? Sorry for the inconvenience. > > Best Regards, > Hao Wu > >> -----Original Message----- >> From: Jon Hunter >> Sent: Friday, October 23, 2020 5:50 PM >> To: Wu, Hao A ; Luo, Heng ; >> devel@edk2.groups.io; jbrasen@nvidia.com >> Cc: Ni, Ray >> Subject: Re: [Patch V4] MdeModulePkg/XhciDxe: Error handle for USB slot >> initialization failure >> >> 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 -- nvpublic