From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.577.1599023336862282107 for ; Tue, 01 Sep 2020 22:08:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=A/JJdWi2; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: hao.a.wu@intel.com) IronPort-SDR: YqlVe5K7vVLUM4rkcqGHxtBY+SHvjLDWRXCX38b8dbjrxGg5xpKxs28Ousx6VK9jIrUSsaraVn lFU3BU1lKtPg== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="175369882" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="175369882" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 22:08:49 -0700 IronPort-SDR: m4H8knil7iIH0Yt8qcDkUBP1vCR8UShcqvfiMeKKtBw4z+4nzidJprQMyo4lzXO51Ef2+PyRsP fCGwfRWx4Ovw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="314989923" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2020 22:08:49 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 1 Sep 2020 22:08:48 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Sep 2020 22:08:48 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 1 Sep 2020 22:08:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eetEjuEpmFT3E8kZ6p4kM5szdJUa4WroNp1UCqsOnnkEmy1Z1zRwDqSjUxMy4e0qnQGsgz63mXD9Gux1P3k2drXMXtT4lyknzm6hXjrwZuLNqG4JS2hD8y9KttRje8QugpND4/baPvkdTyqIUQXyC1cSsaRZQ0aa8zEnw+5nWc6u0MuAW1b//35oxxHyi8pt9y0pIrBE5n1qlvAK5go7BAz2qt4JY7akAc/JX7DMlSYNtO5v6dDzDcv5IZ46fhnzNzkZQ6gd9kVntvwRCL5Uk1tEsGIISk/WPGP0PJ5VQhoUWYP5Ovr/fPb2iOoezMvwV82lxsGYScQ0nJGHi08gVg== 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=3wIVqtnC9yMekLOFW6qPk8h6Qd5yrHayrfmBxIeGyU0=; b=a/INW97izGg9lQ2l9ZG1miEPqBqkIeUbosLKpuGxkley/H9jUJlq8H90LLTas1fjB6ORGIRCULnB4yChp0vPrTQEFVp9j7afk7xqXhizpCXvB71t0l96dj/gDfOxu20WWM1vLI2mu1QPIkBdr9FGN+Dh2PORHMXXt+H7w714VamCTVy1TeA1hXLrzZjayPXZR7Je83SeB9aAZOYDXt67p5duxU1R3SS6f/Yiyu6GBBhxuAJZhIKOamwMPvaOoAfhUMvqTWO2bePoScjfiz5n+20BD91fFZkMH5E56woKYxdC3ZAgPp6flevWsibsqPOSYzNr6hhcEgGMrueSBFYo6w== 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=3wIVqtnC9yMekLOFW6qPk8h6Qd5yrHayrfmBxIeGyU0=; b=A/JJdWi2lk2ROs2ajzO04DTiBo4HsSQR/IpEraPGgYGP/ZrEfF55IaAKgkckb/3II5i2OSwRKujTzV9tKKrfLsE2p24iyP6PV2Wdwubr+rUnsYgB67HvD+17pu9/dDxEHVbNzoVCrGi6PHw0lFjaK3r/dEJ34PRNp8Jm3YL/gno= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB3986.namprd11.prod.outlook.com (2603:10b6:405:77::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Wed, 2 Sep 2020 05:08:39 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::78b6:7108:8852:7536]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::78b6:7108:8852:7536%7]) with mapi id 15.20.3326.025; Wed, 2 Sep 2020 05:08:38 +0000 From: "Wu, Hao A" To: "patrick.henz@hpe.com" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Ni, Ray" Subject: Re: [PATCH 0/1] Fix XhciDxe Timeouts Thread-Topic: [PATCH 0/1] Fix XhciDxe Timeouts Thread-Index: AQHWgJGunLcC0LJtkUS8JbnIP7kRK6lUy/tg Date: Wed, 2 Sep 2020 05:08:38 +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: hpe.com; dkim=none (message not signed) header.d=none;hpe.com; 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: a186c265-8119-4317-de9a-08d84efe40de x-ms-traffictypediagnostic: BN6PR11MB3986: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3J51b1wyvv5NYbF/lkmQml5J6Av1N974JOlMzE6YInjZxHU4HPt6auH8Ejrd6NvpJ2zPbdq+oRhEdeeI2d3h8zJHESdVxer9/AaTQsgQB8G1v5HEUb6l2TmOjDrO2/KPWTniAQDLZuiW6XWaiXqhAepxMoLPKzfYUAwky2YIkh46I4Xu1E4BTyeniLQ6w+BhfFP/GiBiPku8/Zey+otl6dcdrIw200vqRI1eOYoDLAM6BF1yCTYTELM+7YcJJAPYD/JuzgF0nUyP41qRKrpunAg/P/MZgh9YbSaQ7n7FVj8VturIzgIcRxrdyzdpd5SXHpCrICkx6a0y89aRzQJjyQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(366004)(376002)(39860400002)(136003)(346002)(54906003)(296002)(110136005)(7696005)(316002)(2906002)(83380400001)(6506007)(53546011)(55016002)(76116006)(71200400001)(9686003)(26005)(8936002)(107886003)(186003)(8676002)(52536014)(4326008)(64756008)(66446008)(66946007)(86362001)(5660300002)(66556008)(478600001)(33656002)(66476007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: gKxI9iFLBsqpYHxY6NPz9p9t4UWW8TINhLAfa8k6Bjo6XGXhUKTXj/uqP1QNR9vnxeF0MePHEkRGruk2vpuUfNblYdRHMcTZ7vbqyW+cTG84qsfm57snLVIhBXL8YAB4x2P2VTl4Qgp7bvPQvt6cb53c28QNtppDJvk4kxzbKvI8I6v0Gh8o76ZntzoUMrJ3blMBeCkIxJJ/bcj9ywOxqX2sjYVTioUc1V5ZJM2ft0eJstDi6n5/tXZEqCMp29TAUCb4K25aYfbuRrSZ9H8KUKj6qVv4zhszfAUqvXt5Iquaps6TuQX8gWyP/2mKqb1oBixW0dd9KiKw/hQY/VScplojxR4QQ4KNf9Kb5EsJ2JbREys3ZivCTjyY7a/qXzH2umrvHg0duWHGpqkGImBCw3tv4+ehCmfhvXySLUhDJMjb5A1VozGrInJTICyV5d2hMPWHwZTIa3VjlJdRRY9TIfIfansSKqiGEGAqZeKlM85bk9kamvLQQJu6ZP3bJqae7V/AbdZ1nnN8EwxjfNq31DWACAscXHYUHwBCnV9PJRGeDp+JrTgv389CyqxzFEmyftQYS9fzvqciJS4TVLStaJwppPqhBd1dAYj5HokM69az0J7GQYQvE2M0yKLT8urXLlAhGhNw+HvpIjlXUMEzwQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a186c265-8119-4317-de9a-08d84efe40de X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2020 05:08:38.9183 (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: 0XIGFEkXFoygKZfXpqwiuyI/1JER+7O8VM3Bn7QxI8svuJZVaNlYbik9wNekzGGphq1IuXegtwOXgZunZ/qdKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3986 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: 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 >=20 > From: henz >=20 > 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 se= cond > 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 wer= e > implemented in code via static variables that guaranteed a timeout the fi= rst time > the function with the broken timeout was called. >=20 > Example: >=20 > 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))); >=20 > do_once =3D 0; // test line >=20 > Using this forced timeout approach the correct timeouts were observed on = both > hardware and in QEmu. >=20 > 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 mo= re patches for UHCI and EHCI drivers as well for complete enhancement? Thanks in advance. Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Patrick Henz >=20 > Patrick Henz (1): > MdeModulePkg/XhciDxe: Fix Broken Timeouts >=20 > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 28 ++++++++++++++++--- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 34 +++++++++++++++++------- > 2 files changed, 49 insertions(+), 13 deletions(-) >=20 > -- > 2.27.0