From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.6527.1587877787139925814 for ; Sat, 25 Apr 2020 22:09:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: hao.a.wu@intel.com) IronPort-SDR: BSd12SJy7tAyqtC9bnGc5DV7Nsn0s3hrB74jrYF6lehca9k600OAlzmEmlFzOqeGd4GUPEmZau lUD59dPAQpFQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2020 22:09:46 -0700 IronPort-SDR: Xp5oxLBusr57FOIUpkG5vk2TXQaHGbOw059/wQpxiZCQRXAy5W59j31LTCIvXvvrERb+vFWF2O i7ZupTXKBPiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,318,1583222400"; d="scan'208";a="248504009" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 25 Apr 2020 22:09:46 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 25 Apr 2020 22:09:46 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 25 Apr 2020 22:09:46 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.225]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.191]) with mapi id 14.03.0439.000; Sun, 26 Apr 2020 13:09:43 +0800 From: "Wu, Hao A" To: "Jiang, Guomin" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Ni, Ray" Subject: Re: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table after Reset Device Thread-Topic: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table after Reset Device Thread-Index: AQHWGqH+6oJcz8EY40K8DVzwoZo6F6iK2sQg Date: Sun, 26 Apr 2020 05:09:42 +0000 Message-ID: References: <20200425013620.1159-1-guomin.jiang@intel.com> In-Reply-To: <20200425013620.1159-1-guomin.jiang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Jiang, Guomin > Sent: Saturday, April 25, 2020 9:36 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray > Subject: [PATCH] MdeModulePkg/UsbBusDxe: Rebuild the description table > after Reset Device >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2694 >=20 > When the USB fail and then Reset Device, it should rebuild description. >=20 > Signed-off-by: Guomin Jiang > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > --- > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > index 4b4915c019..9f2d2cc87f 100644 > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > @@ -869,6 +869,11 @@ UsbIoPortReset ( >=20 >=20 > DEBUG (( EFI_D_INFO, "UsbIoPortReset: device is now ADDRESSED > at %d\n", Dev->Address)); >=20 >=20 >=20 > + // >=20 > + // The description will be invalid after reset, should rebuild it as w= ell. >=20 > + // >=20 > + UsbBuildDescTable (Dev); Hello Guomin, Thanks for the proposed patch. Could you help to explain in more detail for the above fix with regard to t= he transfer ring not being set properly in the XHCI driver? Thanks. Also, judging from the function description comments in UsbBuildDescTable()= : |> /** |> Build the whole array of descriptors. This function must |> be called after UsbGetMaxPacketSize0 returns the max packet |> size correctly for endpoint 0. |> ... |> **/ |> EFI_STATUS |> UsbBuildDescTable ( |> IN USB_DEVICE *UsbDev |> ) Does function UsbGetMaxPacketSize0() need to be called before UsbBuildDescTable() in the proposed fix? Best Regards, Hao Wu >=20 > + >=20 > // >=20 > // Reset the current active configure, after this device >=20 > // is in CONFIGURED state. >=20 > -- > 2.25.1.windows.1