From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.1822.1599087802453500878 for ; Wed, 02 Sep 2020 16:03:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=lUNutl5o; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=051440aaa7=patrick.henz@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 082N1qMv018079 for ; Wed, 2 Sep 2020 23:03:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=3OXYdJj7tc1JqeSPRXbw42rnsy8RF2xT8R4je5IK1e0=; b=lUNutl5oSPEjJwPAKFICcyodF7MZHEx3T0uYfbJG8VQG4d83BcQ41icpmCX63M/5zZ49 upwEjDtw1qYxXU9XDZ1I2f2u/I0elAPuljGCiMVOfQRAfHuf1idrvc3SaXIMx+A8ZFpv G+t4wSMF042OesVc7TI0YryyBw1EKlQWHPH816wVGB1aGqAW/c1FCYEjPoJDHtTUN3pY FHswf7iB2Wa94kqMbR0Ne5eChOvYaeWR1PE22MXx5HFmSGPg9SKvemE5Z9vWKsumzo3K WN5IbmvGH+C0tdXOpIPvuwpt8UHgHDvNmOk67jZadqG66xXuK3MqNliCOP6EOE58XI1T Mg== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 3380cxx9hu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 02 Sep 2020 23:03:21 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id 0088A56 for ; Wed, 2 Sep 2020 23:03:20 +0000 (UTC) Received: from G4W9333.americas.hpqcorp.net (16.208.32.119) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Sep 2020 23:03:20 +0000 Received: from G9W9210.americas.hpqcorp.net (2002:10dc:429b::10dc:429b) by G4W9333.americas.hpqcorp.net (2002:10d0:2077::10d0:2077) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Sep 2020 23:03:20 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (15.241.52.12) by G9W9210.americas.hpqcorp.net (16.220.66.155) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 2 Sep 2020 23:03:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nTJW2y7WHv0rNU0H/P1ZlPOeV4vFXX5zJdgeVWCNzb2a6pQbg3VbVR7NZ7F6g++vbHey3GA+d+5H6P0lqi4XoEsXoyvgKZX3afWNqR4ng7xxmrFz9liRGcepl2xedRsy6QOfhg2X6y7PDJXkiuHCufg7ZH4AepymzW4F5FXnv4xulCiykcOMvci8tVdspu8l8s+JyboBNi1yG6d6rRmQzTTYK39gCtDphQF2sT/Nb9tTprixDFzPXymO877q2JCBFlWGb3eY/382IQVc4siLZApzNYhDVldM5DRL/RuCgrfprGmis2rECdEVyec6S7woE2ktAVrmy9/3GOgFLBCIRw== 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=3OXYdJj7tc1JqeSPRXbw42rnsy8RF2xT8R4je5IK1e0=; b=UTsdkb87iEXwLHirtDewdOBlJ+OJCjIaxvA1vbgRjn0Wfnm0F3gYDbdu9TsthgaRLSUlBKOkWgeP8gMThCi57EEtR1rxwP2wt9Wqa/gixrtLaBffiBfAr7zjwUvfnIUTtSv0Lx1PjOlMvnW2OgklKrkr3tQRGAWhT6YuyUCj0p8ez4VNSDH+MFZcRBxqR0QPlvWvqXKwvRx6mXgf17n6TNK8hSOU85fvuY4SC3qe3d971XZaeZJ9MngWjRW7dbUVCcmFhoryev9gnuHcdyzep/JyW3oZcQtEyakmH2gxQUFPme1JUail4ick46HF252042SNbGw/1EtVTNiyokSlqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from TU4PR8401MB0478.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7709::19) by TU4PR8401MB1278.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7716::23) 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 23:03:18 +0000 Received: from TU4PR8401MB0478.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4968:3a88:e4a6:5cea]) by TU4PR8401MB0478.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4968:3a88:e4a6:5cea%8]) with mapi id 15.20.3348.015; Wed, 2 Sep 2020 23:03:18 +0000 From: patrick.henz@hpe.com To: "Wu, Hao A" , "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: AQHWgJFytgF8z8UrWk64fPqPBoa4O6lUzRgAgAErj4A= Date: Wed, 2 Sep 2020 23:03:18 +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=hpe.com; x-originating-ip: [76.17.188.158] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ed235bd8-b97b-462c-c4f1-08d84f9461e5 x-ms-traffictypediagnostic: TU4PR8401MB1278: 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: YdObWAylCJeFEu6RIXw51x//5196QwxmoHoXblM2irYgpwHXyaoTDxt+HCfrepzFSQgVPWlV+kl6vGDwdKBded+ZGvT65Tlujckqgf1RnvmE2NKN0VGrY017UhDnC2jWaNFVyOO0aZg05RUeyOl2nxczIitV2bIf/9QMFlxeatv1zMzT1xgd+20naqULXgItGS5Ju1CVi9Yh+Y4FohuDbFS8y+yRshspU/kWBJV9ywRcgD3sfjverYQwTGlBA505Rk0QRuMIwf0U6Wqs12gROg06j51sIdzc6jGQwuEL/BQLJJ8fZEm5Yb/+6E6hoFc9M3dZr0F4IZj0hGs4wYMUYw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TU4PR8401MB0478.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(396003)(366004)(136003)(346002)(376002)(39860400002)(110136005)(54906003)(316002)(2906002)(76116006)(53546011)(83380400001)(7696005)(55016002)(6506007)(9686003)(5660300002)(26005)(66476007)(186003)(8676002)(33656002)(478600001)(8936002)(4326008)(66446008)(64756008)(66946007)(71200400001)(86362001)(52536014)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 2w85x1aYbtvxqvjKXhtGeJEo/aHnu/BxA+ocIpsO89dzOSetaV1jsWwGjODxamXA8oxpIWtlFSmwMICb2N6EhpN2Wvc2Y0ZEFSykPrCja03FQpsMxUjN+MrqGEXfwC0pudXlmkGkWgGxx+58qOiCLExmcTqM+l8r4yWr43zr2Ab8mMnNygiGVR8dw3ly1Dlu99Y12IWEpSeD8yFkE44JZO0/LxGNFIQL7I45NJjeZhNE1MKLJHdzbAh23G48Bx5WZ1xgYbDvAasQQlq/3r0V9uEnNvBW+i5S3fchamBkneHuJal2ZuimO8IG8N7hQbFEOPwGDZiS773zRoXYHw/24OIUULh+BUwtX6Q57KRuCue9f0V3NDsECRUruHW1fQRjxaXUj4v4pzsA691AAruTy3S6zs/dtrXTcAJB7oX9QmvqD7hdbo9SPWisNgYOCaKD/xZyKzMI0wST/4szR1gEmf+vwRNCLT/Atitm03fPSSGGup/InhXRnTaimqTbtFy0bOQgyMI6wKoc27qwLdRV6ZhpbDqskJHQC8sgy5BldxwaHQn5Ab3ZY+aXTqnq4CVmFZBKyM1Y6EGjINSzwsp+3rKm59NOC8iMqgeCB1/itBiO+eUNx2dQM4l7+0hN1GTGyiTR4yPpweQXfdGyBz+jTQ== x-ms-exchange-transport-forked: True X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TU4PR8401MB0478.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: ed235bd8-b97b-462c-c4f1-08d84f9461e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2020 23:03:18.7048 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eY81DL7eC0xTkOcXYZHIKWqHBGwswxdHr7MIeXKwy4kAvByrSMR/7yupxHvHfsxnju+B1Lte+Y9sjiWGVJSfvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TU4PR8401MB1278 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-02_17:2020-09-02,2020-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009020214 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Hao, Yes, I can provide patches for the UHCI and EHCI drivers. I haven't done an= y of the work on either of these yet but will hopefully get to them in the = next day or so. Thanks, Patrick Henz -----Original Message----- From: Wu, Hao A [mailto:hao.a.wu@intel.com]=20 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 ;=20 > 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=20 > the timeout loops not accounting for code execution time. As en=20 > example, 5 second timeouts have been observed to take around 36 seconds t= o complete. > Use SetTimer and Create/CheckEvent from Boot Services to determine=20 > when timeout occurred. This patch was tested using forced timeouts and=20 > print statements with QEmu as well as phycial hardware. The forced=20 > timeouts were implemented in code via static variables that guaranteed=20 > a timeout the first 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=20 > (TimeoutEvent))); >=20 > do_once =3D 0; // test line >=20 > Using this forced timeout approach the correct timeouts were observed=20 > on both hardware and in QEmu. >=20 > Similar broken timeout loops have been found in the Uhci and Ehci=20 > 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=20 > +++++++++++++++++------- > 2 files changed, 49 insertions(+), 13 deletions(-) >=20 > -- > 2.27.0