Re: [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms

From: John Stultz
Date: Thu Jan 14 2016 - 19:49:29 EST

On Wed, Jan 13, 2016 at 4:12 AM, Christopher S. Hall
<christopher.s.hall@xxxxxxxxx> wrote:
> Modern Intel hardware adds an Always Running Timer (ART) that allows the
> network and audio device clocks to precisely cross timestamp the device
> clock with the system clock. This allows a precise correlation of the
> device time and system time.
> This patchset adds interfaces to the timekeeping code allowing drivers
> to translate ART time to system time.

So thanks again for sending this out. Instead of sending you a bunch
of nitpicky changes as I've done in the past, I figured I'd try to
more directly help out and try to rework some of the patches to be
more to my own liking.

I've pushed them here: dev/xtimestamp

My main changes have been:
* Reordered the patches, putting all the timekeeping core changes
first, then the usage of those interfaces last.

* Implemented Richard's suggestion to drop one of the helper
structures that didn't provide much value

* Moved structures defined in clocksource.h but only used in
timekeeping.h to timekeeping.h

* Fixed a few build issues I caught (as well as some of the ones
kbuild bot found)

* Reworked the tsc logic to avoid 64bit divisions (which don't build
on 32bit systems)

I still have not:
* Done *any* testing at all with this. Please verify I didn't break anything. :)

* Fixed the 64bit div on 32bit systems build issue in

* Done another review/edit pass on the commit messages, as they've
gotten a bit long (I know, I know.. "be verbose" I said!), but they
can probably be tweaked to be better and more contextual to the

Still on the fence:
* Probably should zap the correlated_cs structure or move it to tsc.h,
as mentioned in my other email

Anyway, I'll let you take a look at this and feel free to integrate
and adapt these ideas as you please into your patchset. Look forward
to your next revision!