From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.6314.1599105281155316932 for ; Wed, 02 Sep 2020 20:54:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=DRVyNnHM; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: hao.a.wu@intel.com) IronPort-SDR: OygR7Qji0acsACACTcp0CWYd3vgI5TFlKyBcaHdXPxelboOmDPKvtG5PI5Nj7SBtgiurBxcSok kA49uuEU+FVQ== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="158500474" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="158500474" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 20:54:39 -0700 IronPort-SDR: LnJnft6KfLyyH/mk9f/vLnyuz5QIE96QJwfo5i5kQHw6edXrv669M68TtMnL9hNI0w7kCFbq4P Cts0lsckOn2w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="302066999" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 02 Sep 2020 20:54:39 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 2 Sep 2020 20:54:39 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 2 Sep 2020 20:54:39 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.58) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 2 Sep 2020 20:54:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZgHK6zlNSt7V4B6wx/EgljnsjqD6kYzdJFItFoyUrnXjWNf/tKCizAWV724H+mCQy6PjO15unc0zMIUnC5FtB9JNMSwHbKZllYvfmB/kxyhZZirF3CHwUNhXjAkXPHzkF1PgfW7z5FFlUTfuD3ug2BeEBwIbVk2zPp4N0M08rSujlVHrADCZyl/mr/UNK1PdMZN8PjG8vKjWZNuyMXnAnVXCkHPK7BEdCw91I1OYW2SN2OplWFBJUZu7Kxl2F+0apQW0+W1Xcy5cn+PX4TyDZwUaCiaoyqv/JbnleA4fnylfpKLSRL1xyrxgo3XhwSbkKdTOrYU+n9q7igCtnXAoVg== 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=csRFLwnVN9slDkKi26DCLZcAmhqNf16odLgZEvbbDf8=; b=Co9hEAsCCTW4HJQyK3LszM9bv2mTKkyPMNbjJ5H6pRY+9Zs2xPH1Hj0aDjQIA5j9WnuoohbSU1J0oGxx+OrI/sN5QGUt4otDxmueRRXepmLni+WqYPC7S6cJpVV+alDksUA8ft53wIk9DM/H+K4c/gKqzfMWcifGoUwT11cDmNloEvEYdTDuAmSJIxd86wDngkMGVugSu93z877wF/6EuIkcEHH1S7bePpEu8crKoDUJ0qq57wtgmjuyvSRY1XGnwM2D8euoL6IqORsWjQ8wmX9nDFn0QKQcmvGSma4XDw/oQ2Vd1InkpYPs4ZyDGkeFa+BGfUy5JG4MGVAHA8Z/DQ== 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=csRFLwnVN9slDkKi26DCLZcAmhqNf16odLgZEvbbDf8=; b=DRVyNnHMY9WvLSfOyiQVH/dW70bxkHFqnwLD/PoiIwKPY+E0N/ctaXmzuJ5fXs4tX823b/wS8gaZQ655K27IdEDtr0q52WpcjFivye4WqcmrErqqxu1T87LEZlA3a7nTvAc7rBc6gumBDh2Db+Icy9luusoWL0QTTC/KFRQGSHQ= Received: from DM6PR11MB3673.namprd11.prod.outlook.com (2603:10b6:5:145::26) by DM6PR11MB3980.namprd11.prod.outlook.com (2603:10b6:5:192::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Thu, 3 Sep 2020 03:54:34 +0000 Received: from DM6PR11MB3673.namprd11.prod.outlook.com ([fe80::5111:3ecb:21f:eeb6]) by DM6PR11MB3673.namprd11.prod.outlook.com ([fe80::5111:3ecb:21f:eeb6%7]) with mapi id 15.20.3326.025; Thu, 3 Sep 2020 03:54:34 +0000 From: "Wu, Hao A" 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 Thread-Topic: [edk2-devel] [PATCH 0/1] Fix XhciDxe Timeouts Thread-Index: AQHWgJGunLcC0LJtkUS8JbnIP7kRK6lUy/tggAEtXwCAADhQkA== Date: Thu, 3 Sep 2020 03:54:33 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 476ffabb-599e-464d-aef6-08d84fbd11e1 x-ms-traffictypediagnostic: DM6PR11MB3980: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m7inn9ULh3wy1J1nNuQrv8aTT3Wu9aKcXotebsuZwmEAkfn07HRt0RevD2VCe33umQzS34C6I28u4s4Aa2BYdVjXvZBNoVkI5k5uIIKaO6VdZXJDZL2nlR7idQ2rA2/DpQXV3alMdcbOamR8aCrlnWTZiiqr+TzRw7U0WxMBou+Oh+g6kML4RKBL+hDa/++ae6J3fthHD1/iYYBbosYcBXM4w20DY1lbgrXcf5pgDcf/L0ZRUYAvVqY1gJeBQ9sIz1AvK3avhRDQLgm8aBvSH511X+f16Tg6Vnk/HcfOGomoZEsU79lcx/hUrzm9UXlJiV24CHhHmTqoUyvno+OapqcRhSIeCUakm7iA5ibatWUq3q+tWEemowdlFxdooTsCJGSQimttNgozF3KzoyVyCA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3673.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(346002)(39860400002)(136003)(396003)(33656002)(8676002)(54906003)(83380400001)(8936002)(110136005)(2906002)(9686003)(52536014)(107886003)(55016002)(4326008)(478600001)(66946007)(86362001)(5660300002)(66556008)(66476007)(316002)(76116006)(71200400001)(66446008)(64756008)(186003)(966005)(53546011)(6506007)(26005)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: SQgAfRlG++Uuq5lhO38WFP4wEOkFZ6rD7U8BPtzO0okptTIx++/1KyNDNv35vlDRckDev9ErCxS+YLX/ty7U2w93N2gy5qtjDUKBSP8jwEzVwyEMS2+31FlrlxRwdlV5unWA8Dp3qasa9tOVAE/yZHCqT/pmY1nCs7OunsbOhu8ct5h2KDOZVLXMw8XBvzlv1sqXZeBYtUPWnz9uH8evmQ5QUN+nCj7PRge5dskBFckMP7SFlTNidb6yI1YyH0RPEPfPAsIpK9DX6AniHKntfS+D9y59+dkLT/s3LGzECS6eAHLXlTFW69eHwc7KPkqCU7C0qgY8JLDwOfsR27TZIbKC23NJ4nsU5WT11o8HKUVm+OW/2T8yYTaxRxtWAMzMz1uvKmrj2cvZD1Qw7vcB5V/6p2ZipHgxu2Bfv+Gb7gdUj07YbWez5biUSI5iIrXEh9B3X2r+8MZh2xD2HJ839cxiIBrNCRQN+8ck/dr6CFOlm19Aw8nHJSeW40W/0LXpYgi67m/8jLPA6ucEALxCrS4RVBV8UbDiQcXD6BFGFYJzuZ8pOYOkRouup68qAvscN9puRI+Jdk3nZ8FX+v9iuTKQcmbObEuDamntQG1T+pV4jzqF5/omvqZAaEUMfpLG2RKC56Gn8Ma7il3goCaOfQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3673.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 476ffabb-599e-464d-aef6-08d84fbd11e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Sep 2020 03:54:33.8032 (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: dvRKDlcnmkRJ0Y4KpgvnxRoZw5u50vN6LIvTdr9PtX2KG6SmIIa9L28uavUp7TFffsx52iwUIlEQG5c9SlPtXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3980 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----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 >=20 > Hello Hao, >=20 > Yes, I can provide patches for the UHCI and EHCI drivers. I haven't done= any > of the work on either of these yet but will hopefully get to them in the= next > day or so. Thanks Patrick, Could you help to add the UHCI and EHCI changes together with the existing= XHCI patch into one series for the next version? That will make a series which include 3 patches. Best Regards, Hao Wu >=20 > Thanks, > Patrick Henz >=20 > -----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 >=20 > > -----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 to > > 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 and > > print statements with QEmu as well as phycial hardware. The forced > > timeouts were implemented in code via static variables that guaranteed > > a timeout the first time the function with the broken timeout was call= ed. > > > > 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 observed > > 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. >=20 >=20 > Hello Patrick, >=20 > 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 enhancement? > Thanks in advance. >=20 > Best Regards, > Hao Wu >=20 >=20 > > > > 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 >=20 >=20