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.web10.7594.1603355979187511861 for ; Thu, 22 Oct 2020 01:39:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=MPLbVo4L; 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 ; Thu, 22 Oct 2020 01:39:26 -0700 Received: from [10.26.45.122] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 22 Oct 2020 08:39:36 +0000 Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Retry device slot init on failure To: "Wu, Hao A" , "devel@edk2.groups.io" , "jbrasen@nvidia.com" CC: "Ni, Ray" , "Luo, Heng" References: From: Jon Hunter Message-ID: Date: Thu, 22 Oct 2020 09:39:33 +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: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603355966; bh=CxwyrQjtitH/yhEz6NDtck9tIE3+KEnyU4290I9uRqU=; 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=MPLbVo4LcMxVCfN/ftHCFHSA/2wCrfLs0/5EDl+OxWHTcbbLbpRQq62+gk7Mej3PV dHkTbAhry6ahCskzeBXKYzWLGqznzhK16r/BVmpyk2wYIDC9kX7S7OHwjqqH3jUhrg U0Qv0kPm9uIB6ZK4CDaNLihUm+3j3qndD3On+UiD4Jr97xGZAgWm2T0EHRKsEtpZ19 G6KN4f8RW7T5LrG/Z2ieYseK9aNhnc7162e1ro0R+IhZOaLlTJkHpcWp2MTzpvxmBy wAIlYKdqcJMNuqjR0nJOmqJxoEq9tQK7XBno4MwJ0xDXFoBM7QY3staGL4LvkIsLNV aSBdgEJpB9CAw== Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit On 22/10/2020 07:40, Wu, Hao A wrote: ... > Hello Jeff, > > Thanks a lot for the patch. > I found that there is another patch current on the mailing list that also > addresses an issue during device slot initialization: > https://bugzilla.tianocore.org/show_bug.cgi?id=3007 > > For the issue mentioned in BZ-3007, it will handle the case that: > a) The device slot initialization fails; > b) A call to XhcDisableSlotCmd(64) is needed. Otherwise, the initialization of > the next port will fail due to the content in 'Xhc->UsbDevContext' is not > cleared. > > The current resolution for BZ-3007 is to add XhcDisableSlotCmd(64) calls when > an error occurs in XhcInitializeDeviceSlot(64). > > Could you help to see if the patch provided at: > https://edk2.groups.io/g/devel/message/66529 > has any impact on your proposed patch? > I think the XhcDisableSlotCmd(64) calls can be moved out of the 'do-while' > loop in your proposed change. Thanks in advance. Hi Hao Wu, Thanks for the response. I have tried the above patch but it does not work for us. The problem is with the above patch is that it only disables the slot and does not retry the device initialisation again afterwards. Therefore, if we fail enumeration, we don't retry. The scenario that we are testing is booting an Linux OS distro from an USB mass storage device. The problem we see with some superspeed mass storage devices is ... 1. On the very first boot, USB mass storage is enumerated and we can boot the OS. 2. We then reboot the OS and on the next boot UEFI fails to enumerate the USB device and we can no longer boot the OS. With the proposed patch, I see that after the USB mass storage fails to enumerate, on the 2nd attempt we can enumerate it and boot successfully. > Also, please refer below for 1 inline comment: Yes we can take care of that. Thanks Jon -- nvpublic