From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 08517740045 for ; Wed, 7 Feb 2024 21:00:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=R1HGlMHrZeVOqei2/q+fa46HM6nagd7/8mO3aNXyzDE=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1707339628; v=1; b=xLzdHsaDYKJbENmbjVdQiX9daZsMHhATR+Q7VMbRQwi115JCKQSXaR9qB2rmqc+quLbRGs+y dGqt4GNokQ5yV/kX4uG5AmyKK5DC0SuhrWtRXcRG+iChrqMgILlxpU/fknXbHephWZ75eRlneZ6 sbciSALp61u0EmVVu3jkcye8= X-Received: by 127.0.0.2 with SMTP id OwrHYY7687511xXRRf6hBSN1; Wed, 07 Feb 2024 13:00:28 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.1305.1707339628050051253 for ; Wed, 07 Feb 2024 13:00:28 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-180-E4vm3yOjOaCXyYoJu9ON5g-1; Wed, 07 Feb 2024 16:00:21 -0500 X-MC-Unique: E4vm3yOjOaCXyYoJu9ON5g-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FDDE85A58E; Wed, 7 Feb 2024 21:00:20 +0000 (UTC) X-Received: from [10.39.195.126] (unknown [10.39.195.126]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D76BAC1E; Wed, 7 Feb 2024 21:00:19 +0000 (UTC) Message-ID: <0a5162ef-d2ab-a15b-af54-93ceaf656949@redhat.com> Date: Wed, 7 Feb 2024 22:00:18 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/XhciDxe: Non-zero start/stop values in XhcGetElapsedTicks To: devel@edk2.groups.io, patrick.henz@hpe.com Cc: hao.a.wu@intel.com, ray.ni@intel.com, Michael Kinney , "Liming Gao (Byosoft address)" References: <00c1038dda20f983fdcd6aab19dffc82324b6ad4.1707232975.git.patrick.henz@hpe.com> From: "Laszlo Ersek" In-Reply-To: <00c1038dda20f983fdcd6aab19dffc82324b6ad4.1707232975.git.patrick.henz@hpe.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: gpmxepgpEtf9vx7wLbBz1SZUx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=xLzdHsaD; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Patrick, (CC Liming, Mike) On 2/6/24 16:29, Henz, Patrick wrote: > From: Patrick Henz >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D4578 >=20 > The implementation of XhcGetElapsedTicks did not account for > non-zero start and stop values for the performance counter > timer, potentially resulting in an incorrect elapsed tick > count getting returned to the caller. Account for non-zero > start and stop values when calculating the elapsed tick > count. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Patrick Henz > Reviewed-by: > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) How does this patch differ from your v1, from October last year: https://edk2.groups.io/g/devel/message/110434 message-id: That version was: Acked-by: Hao A Wu Reviewed-by: Laszlo Ersek If this patch is the same (effectively a repost), then I have two comments: - the Reviewed-by line on v2 is incomplete, plus the patch is missing Hao's Acked-by - I'm really sorry that your v1 patch didn't get merged. I think we should just apply v1, with the feedback tags given back then. IMO the patch certainly qualifies for the feature freeze (even the hard one), because it is a bugfix. At this development phase, I can't merge your v1, but Liming or Mike could. Mike, Liming: can you git-am Patrick's v1, and pick up the feedback tags, for merging? Thanks! Laszlo >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/X= hciDxe/Xhci.c > index f4e61d223c..ff641d0130 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -2389,7 +2389,7 @@ XhcGetElapsedTicks ( > // Counter counts upwards, check for an overflow condition > // > if (*PreviousTick > CurrentTick) { > - Delta =3D (mXhciPerformanceCounterEndValue - *PreviousTick) + Curr= entTick; > + Delta =3D (CurrentTick - mXhciPerformanceCounterStartValue) + (mXh= ciPerformanceCounterEndValue - *PreviousTick); > } else { > Delta =3D CurrentTick - *PreviousTick; > } > @@ -2398,7 +2398,7 @@ XhcGetElapsedTicks ( > // Counter counts downwards, check for an underflow condition > // > if (*PreviousTick < CurrentTick) { > - Delta =3D (mXhciPerformanceCounterStartValue - CurrentTick) + *Pre= viousTick; > + Delta =3D (mXhciPerformanceCounterStartValue - CurrentTick) + (*Pr= eviousTick - mXhciPerformanceCounterEndValue); > } else { > Delta =3D *PreviousTick - CurrentTick; > } -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115253): https://edk2.groups.io/g/devel/message/115253 Mute This Topic: https://groups.io/mt/104199605/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-