From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.9630.1599123226140883738 for ; Thu, 03 Sep 2020 01:53:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=aDSioQh6; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: ray.ni@intel.com) IronPort-SDR: 1kG3EfzI5/oZ+QE3VC1i9f5zb1+VtUhEGBvz3Mb78YXTUwwMVz5s7L4E0s+PS0kWf08HL+Rfu7 4c9vFdBE6XBQ== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="157545236" X-IronPort-AV: E=Sophos;i="5.76,386,1592895600"; d="scan'208";a="157545236" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 01:53:44 -0700 IronPort-SDR: vgoRF5W4tm8HLVv48h5n/yMk1+kMsoM/yso3ytilltIQMxUTyiX/I0BZqylOYiECyo0SOXXPLr Z21jIcttq6IQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,386,1592895600"; d="scan'208";a="326138165" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP; 03 Sep 2020 01:53:44 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 3 Sep 2020 01:53:43 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 3 Sep 2020 01:53:43 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.52) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 3 Sep 2020 01:53:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UqMIfFckjoXHgJPk0xn6Zhms0FN6dRwJxYrCC8pP1N6c20TV7zgcuhVssdLd2LiejAQKSBnxZo/JhWE2XXS4uzWyZOqPXQElAZomqQ1XmgTTHQgAdIJAL0hjQ1QKMg6yFdNsHm3tGDxpT4CWIuzSQYskpORgvq7ewQQxsYLLm6oqZu0/WM4dfLp058YSSw8f9uDhod7gxk8Flhuq+nvvGI8A+/8axd+qZ1MOEyA3M8nefE2hDjbM6PQLRpCE0lO7CJEOwj8mDc9CXcFMTHJmFTPJkTDeVB8hehUtbmVh3CTg7zDXt0Pe/8s7eAg0qHhk2uc8CQrMiVKvAm9ShIJkew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RiZ9KH9H4rHtnfAe9S0+IJFkx43+hauZyIVQiOFNpC8=; b=ZSd59XrmbWnaXdmMrug9qQpftksPyv7mi9r7CFWh2Tk4Fr6ERdD9K2ZAdf85a3fz3lWDGQ+kxcLamww3+UdGJSi1ib1cOKkUHO1u3D5yuVcXvEVnMToQ7Awza7jQy/JcXtrM+KtcDApCRCmPIjK5cdWxC1CCGgxDd5W+/i6Qfzyh4EAW2+9bhqvCzLWrwRhqfMYVfuXW5DFv3ZjOxE6o/0RvqV1CcewDdkM21pKhe+5B5SaFvLLh/+yyXaxU4IKBuQgR8F7PL9IzsubB0eA4D3mXfNWkOG81hLkwQiwSrRvqoVtNKmrUUPex6cgXkB98tZpHFuFf2vA5hIlx39qbdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RiZ9KH9H4rHtnfAe9S0+IJFkx43+hauZyIVQiOFNpC8=; b=aDSioQh6bTTSg7BGtgaGfbQTBCJ3srMOAgZhKlz3Q8UX4E4lQeRP9n+5uUEkkaeLaXQzIY3FqO9wCAYwEDMVMTkTVOll13CeNBkqKS2SRQqDxYM4Ix/wrxDUq7p0QwJpLRkQIBctz4NcaceoWPHei6CbrsTodGnF26ePNfiePso= Received: from BY5PR11MB4007.namprd11.prod.outlook.com (2603:10b6:a03:189::28) by BYAPR11MB2534.namprd11.prod.outlook.com (2603:10b6:a02:c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16; Thu, 3 Sep 2020 08:53:41 +0000 Received: from BY5PR11MB4007.namprd11.prod.outlook.com ([fe80::889e:ec52:bb02:db78]) by BY5PR11MB4007.namprd11.prod.outlook.com ([fe80::889e:ec52:bb02:db78%3]) with mapi id 15.20.3326.025; Thu, 3 Sep 2020 08:53:41 +0000 From: "Ni, Ray" To: "Wu, Hao A" , "devel@edk2.groups.io" , "patrick.henz@hpe.com" CC: "Wang, Jian J" Subject: Re: [edk2-devel] [PATCH 0/1] Fix XhciDxe Timeouts Thread-Topic: [edk2-devel] [PATCH 0/1] Fix XhciDxe Timeouts Thread-Index: AQHWgJGuwF7IhsnfcESp3cE9qfeI4qlUzRgAgAEsQgCAAFFggIAAUvfQ Date: Thu, 3 Sep 2020 08:53:41 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d23b1671-564e-42a5-b966-08d84fe6db6b x-ms-traffictypediagnostic: BYAPR11MB2534: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /gDaXuZ4gKHPMIMOVaijgpsK95py9wHB9/YqER1+llSNxlAM+r6jWp36L6a3UpjTPhI51JIvfL0BSJD+sLYGn6blU73NNeFN/dVhDxMFLJyJb4U0++/jyVIfo48Bw6shpoli/bmFnjvFxu+9PHIPkxBq32eKfjg8KtpxEEoeGpibUmGDqUj/OJkSU7I9X3rs1WDXj9D4ujIg9wsNt3UuOMPOxu0yFjWIkIwy+aNkHUTFLTxEnjAJ2tHqqcU3Na2+uusML5nMbVBxi/ioMGPtZy5hD3Biiza1M+MaKc7NA9z4R8s6A8lkwDO1Xb7dUkZAg4Oxvx1npCaOlIoOpqtiUJFZA6BtMtEcYsmZm8UQ95D+OS1lsSRyagIN2WTqAJHODG7/ywZEueU8jXQGk7/khQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR11MB4007.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(71200400001)(53546011)(6506007)(33656002)(4326008)(2906002)(86362001)(52536014)(5660300002)(107886003)(26005)(66476007)(66556008)(64756008)(66446008)(66946007)(76116006)(110136005)(186003)(316002)(966005)(55016002)(9686003)(8936002)(7696005)(8676002)(83380400001)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: DZW/T+/k+XjRVmuv0d9Ahz6fpmCRYdom0a7FoDvw3vecp4QPWI8dki5tB24iIl/4LPwOSIqd0zLPXBlPQ3H9GA3Sz6WOcVRJi3SYuYZK4RWYt506GGTSnyBzRBsQy+azx2SxPggpFNm2WGrbSL1ApmDTbNPHQ6282UinGX1JUimp7iOxXP8+tsMhPNHtIXePvK6qSg74OQOhfnTRfGZ1a9mQEqHTnOjYcj3gTKoSF6GC96+64bJd3imDJNv5tQ+/JVkw7zpBKxy+pfUYM69wJmfBQ4dRIBIfrDu6CTMHeDcIFJNf4bqNtFblZUqu54phdhaipe8y2Uz/+tVodCIiqGa0a418fDqYz/RhltewlBd+bK4S4ngxLvX2C6V9PHItg7mKbKDrpy/4dIOL6VFNt59ksVJ9snKLlVOaViIKUCFXTIXv2nxFUJYZqG587RHly3/om9yocESLRKeA9ceRk8ysiKW1+9EDPlAKRTp2IueD7SdTQpuBBkrRo6TIQlcSrzTmY9id/BFe2m94PL+0IlDZQ0x2T6bCO5v1jgSr0H3vxZoY9wEYXPNl9CzziFZvRA6CjKaiZ52uJqt0ZQ5EBhzszSBr60av62I35TeSHL/ZtqiUmeuLyYedzoFDR1J9gOtVMK4IsC/aTCQHwpul/w== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4007.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d23b1671-564e-42a5-b966-08d84fe6db6b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Sep 2020 08:53:41.4008 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MWNYHcv8bSDWUCeAdmhA/KCpLKsypbvS6X0VXVMihAWp7BvtelptDB2s1G4ElJDRjwpbfOkXDvYspIPA6q/vIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2534 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Patrick, Please make sure unit test is done for the code you changed. If you cannot find environment to test the changes, I prefer to not make t= he change. Thanks, Ray > -----Original Message----- > From: Wu, Hao A > Sent: Thursday, September 3, 2020 11:55 AM > To: devel@edk2.groups.io; patrick.henz@hpe.com > Cc: Wang, Jian J ; Ni, Ray > Subject: RE: [edk2-devel] [PATCH 0/1] Fix XhciDxe Timeouts >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Henz, > > Patrick > > Sent: Thursday, September 3, 2020 7:03 AM > > To: Wu, Hao A ; devel@edk2.groups.io > > Cc: Wang, Jian J ; Ni, Ray > > Subject: Re: [edk2-devel] [PATCH 0/1] Fix XhciDxe Timeouts > > > > Hello Hao, > > > > Yes, I can provide patches for the UHCI and EHCI drivers. I haven't do= ne any > > of the work on either of these yet but will hopefully get to them in t= he next > > day or so. >=20 >=20 > Thanks Patrick, >=20 > Could you help to add the UHCI and EHCI changes together with the existi= ng > XHCI patch into one series for the next version? > That will make a series which include 3 patches. >=20 > Best Regards, > Hao Wu >=20 >=20 > > > > Thanks, > > Patrick Henz > > > > -----Original Message----- > > From: Wu, Hao A [mailto:hao.a.wu@intel.com] > > Sent: Wednesday, September 2, 2020 12:09 AM > > To: Henz, Patrick ; devel@edk2.groups.io > > Cc: Wang, Jian J ; Ni, Ray > > Subject: RE: [PATCH 0/1] Fix XhciDxe Timeouts > > > > > -----Original Message----- > > > From: patrick.henz@hpe.com > > > Sent: Wednesday, September 2, 2020 2:55 AM > > > To: devel@edk2.groups.io > > > Cc: henz ; Wang, Jian J ; > > > Wu, Hao A ; Ni, Ray > > > Subject: [PATCH 0/1] Fix XhciDxe Timeouts > > > > > > From: henz > > > > > > Timeouts in the XhciDxe driver are taking longer than expected due t= o > > > the timeout loops not accounting for code execution time. As en > > > example, 5 second timeouts have been observed to take around 36 > > seconds to complete. > > > Use SetTimer and Create/CheckEvent from Boot Services to determine > > > when timeout occurred. This patch was tested using forced timeouts a= nd > > > print statements with QEmu as well as phycial hardware. The forced > > > timeouts were implemented in code via static variables that guarante= ed > > > a timeout the first time the function with the broken timeout was ca= lled. > > > > > > Example: > > > > > > XhcExecTransfer ( > > > . > > > . > > > ) > > > { > > > . > > > . > > > static int do_once =3D 1; // test line > > > . > > > . > > > do { > > > Finished =3D XhcCheckUrbResult (Xhc, Urb); > > > if (do_once) Finished =3D 0; // test line > > > if (Finished) { > > > break; > > > } > > > gBS->Stall (XHC_1_MICROSECOND); > > > } while (!EFI_ERROR(TimerStatus) && EFI_ERROR(gBS->CheckEvent > > > (TimeoutEvent))); > > > > > > do_once =3D 0; // test line > > > > > > Using this forced timeout approach the correct timeouts were observe= d > > > on both hardware and in QEmu. > > > > > > Similar broken timeout loops have been found in the Uhci and Ehci > > > drivers. This patch does not fix those issues. > > > > > > Hello Patrick, > > > > Besides the comments made by Ray in patch 1, could you help to provide= 2 > > more patches for UHCI and EHCI drivers as well for complete enhancemen= t? > > Thanks in advance. > > > > Best Regards, > > Hao Wu > > > > > > > > > > Cc: Jian J Wang > > > Cc: Hao A Wu > > > Cc: Ray Ni > > > Signed-off-by: Patrick Henz > > > > > > Patrick Henz (1): > > > MdeModulePkg/XhciDxe: Fix Broken Timeouts > > > > > > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 28 ++++++++++++++++--- > > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 34 > > > +++++++++++++++++------- > > > 2 files changed, 49 insertions(+), 13 deletions(-) > > > > > > -- > > > 2.27.0 > > > > > >=20