public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"mcb30@ipxe.org" <mcb30@ipxe.org>,
	"Henz, Patrick" <patrick.henz@hpe.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Use Performance Timer for XHCI Timeouts
Date: Thu, 6 Jul 2023 18:01:10 +0000	[thread overview]
Message-ID: <CO1PR11MB49294359845D44D0870D2F4CD22CA@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <010201892be2d5e6-35273df4-44c0-4ead-8898-1c94cbc6713d-000000@eu-west-1.amazonses.com>

There is a similar lib API for SMI handlers:

https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/SmmPeriodicSmiLib.h

/**
  This function returns the time in 100ns units since the periodic SMI
  handler function was called.  If the periodic SMI handler was resumed
  through PeriodicSmiYield(), then the time returned is the time in
  100ns units since PeriodicSmiYield() returned.

  @return  The actual time in 100ns units that the periodic SMI handler
           has been executing.  If this function is not called from within
           an enabled periodic SMI handler, then 0 is returned.

**/
UINT64
EFIAPI
PeriodicSmiExecutionTime (
  VOID
  );

https://github.com/tianocore/edk2/blob/96d691166f07b7ed422f9536832edadc0aea35c9/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c#L422


I agree that an elapsed time API based on the performance counter in the TimerLib
would be a good addition to the TimerLib and would provide a common implementation
of the feature.  May need an input parameter to pass in the start time to measure
from so it can work in BASE implementations that can not assume writable globals.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
> Brown
> Sent: Thursday, July 6, 2023 8:47 AM
> To: devel@edk2.groups.io; Henz, Patrick <patrick.henz@hpe.com>
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Use Performance
> Timer for XHCI Timeouts
> 
> On 06/07/2023 15:19, Henz, Patrick wrote:
> > I agree that XhcGetElapsedTime() would be better off in TimerLib, but I
> wasn't sure how the community would feel about adding to the interface.
> 
> My understanding is that the TimerLib API is not prescribed by any
> standards document, and that this change would add a new function
> without changing any existing functions and so would not break any
> existing users of TimerLib.  On that basis, I would be firmly in favour
> of extending TimerLib to include this functionality.
> 
> I will defer to actual EDK2 maintainers on this, however.  :)
> 
> Thanks,
> 
> Michael
> 
> 
> 
> 
> 


  reply	other threads:[~2023-07-06 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 20:15 [PATCH] MdeModulePkg/XhciDxe: Use Performance Timer for XHCI Timeouts Henz, Patrick
2023-07-06 13:02 ` [edk2-devel] " Michael Brown
2023-07-06 14:19   ` Henz, Patrick
2023-07-06 15:47     ` Michael Brown
2023-07-06 18:01       ` Michael D Kinney [this message]
2023-07-31  2:57 ` Wu, Hao A
2023-08-10 22:44   ` Henz, Patrick
2023-08-11  1:43     ` Wu, Hao A
2023-10-30 20:36       ` Henz, Patrick
2023-10-31  1:41         ` Wu, Hao A
2023-10-31 12:14           ` Laszlo Ersek
2023-10-31 12:16           ` Laszlo Ersek
2023-10-31 13:38             ` Henz, Patrick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB49294359845D44D0870D2F4CD22CA@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox