From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.1677.1599029363839506159 for ; Tue, 01 Sep 2020 23:49:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XJ8fiX+A; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599029362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BsRvFLJvz8/9oJDSshthR7DGeqdmFeBL+u8AjfrJUOI=; b=XJ8fiX+A/+kdvhSPnh8EHQrpaYWzhvY6Y3yHED7qxRmHMj5Ld/ZHrwAvFzUKyuh1Zlp7x3 fpy1ugOGxBDlSIitK1ZLBlPEtWSeGIHz4hcqIjSBA8Wc0J0gYDcubJ7II2kygFuMyfQ9rY x/Q4X4vBoP0G9u0NpOyvXSDlKRkfnVs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-555-AWvWU4DnOR-KNg_U-3eRSA-1; Wed, 02 Sep 2020 02:49:18 -0400 X-MC-Unique: AWvWU4DnOR-KNg_U-3eRSA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EF4D801AAE; Wed, 2 Sep 2020 06:49:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-14.ams2.redhat.com [10.36.113.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 659147EEAE; Wed, 2 Sep 2020 06:49:14 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 0/1] Fix XhciDxe Timeouts To: devel@edk2.groups.io, hao.a.wu@intel.com, "patrick.henz@hpe.com" Cc: "Wang, Jian J" , "Ni, Ray" , "Liming Gao (Byosoft address)" References: From: "Laszlo Ersek" Message-ID: <9af989ee-b360-34e0-8b1f-812a5778f960@redhat.com> Date: Wed, 2 Sep 2020 08:49:13 +0200 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US On 09/02/20 07:08, Wu, Hao A wrote: >> -----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 called. >> >> Example: >> >> XhcExecTransfer ( >> . >> . >> ) >> { >> . >> . >> static int do_once = 1; // test line >> . >> . >> do { >> Finished = XhcCheckUrbResult (Xhc, Urb); >> if (do_once) Finished = 0; // test line >> if (Finished) { >> break; >> } >> gBS->Stall (XHC_1_MICROSECOND); >> } while (!EFI_ERROR(TimerStatus) && EFI_ERROR(gBS->CheckEvent >> (TimeoutEvent))); >> >> do_once = 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. > > > 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 enhancement? > Thanks in advance. We're very close to the edk2-stable202008 tag deadline. This patch -- which in v2 is going to be a patch series -- is not aiming at the stable tag, does it? Thanks! Laszlo