[Intel-gfx] [PATCH 4/6] time: Expose current clocksource in use by timekeeping framework
Thomas Gleixner
tglx at linutronix.de
Thu Mar 16 08:10:19 UTC 2017
On Thu, 16 Mar 2017, sourab.gupta at intel.com wrote:
Please Cc LKML for patches which touch subsystems managed on LKML. Also
CC'ing people on the 0/N letter would be helpful, so we can see what this
is about.
> For the drivers to be able to use the cross timestamp framework,
> they need the information of current clocksource being used by the
> kernel timekeeping.
No.
> This is needed since the callback given by driver into the
> get_device_system_crosststamp(), in order to synchronously read the
> device time and system counter value, requires the knowledge of the
> clocksource being used to read system counter value (as a part of struct
> system_counterval_t).
Again you are saying WHAT you want but not WHY. The device callback does
not need to know anything about the timekeeping clocksource.
get_device_system_crosststamp() is for timestamps taken via a clock which
is directly correlated with the timekeeper clocksource.
ART and TSC are correlated via:
TSC = (ART * scale) + offset
get_device_system_crosststamp() invokes the device function which reads
ART, which is converted to CLOCK_MONOTONIC_RAW by the conversion above, and
then uses interpolation to map the CLOCK_MONOTONIC_RAW value to
CLOCK_MONOTONIC.
The device function does not know anything about TSC. All it knows about is
ART.
I have no idea what you are trying to do, but given the explanation above
it's wrong.
Thanks,
tglx
More information about the Intel-gfx
mailing list