netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms
@ 2016-01-13 12:12 Christopher S. Hall
  2016-01-13 12:12 ` [PATCH v6 1/9] Add cycles to nanoseconds translation Christopher S. Hall
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Christopher S. Hall @ 2016-01-13 12:12 UTC (permalink / raw)
  To: tglx, richardcochran, mingo, john.stultz, hpa, jeffrey.t.kirsher
  Cc: Christopher S. Hall, x86, linux-kernel, intel-wired-lan, netdev,
	kevin.b.stanton

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.

Changelog:

Changes from v5 to v6:

*	Pulled supporting code for snapshotting, correlated
	clocksource, and cycles to nanoseconds translation to separate
	patches. Added patches are marked as NEW below. There is,
	however, very little *actually* new code, just reorganized
	code
*	Renamed and moved clocksource change sequence to timekeeper
	struct (out of tk_read_base)
*	Renamed structs for system counter and synced device time
	callback to system_counterval_t and sync_device_time_cb,
	respectively
*	Changed PTP cross-timestamp callback name to getcrosststamp
	for consistency with the timekeeping code - corresponding
	function name changes in e1000e driver
*	Simplified PTP time calculations making use of ktime_to_* code

Changes from v4 to v5:

*	Changes the history mechanism to interpolate system time using
	a single historic system time pair (monotonic raw, realtime)
	rather than implementing a precise history using shadow
	timekeeper (see v4 changes). The advantage of this approach is
	that the history can be arbitrarily long. This approach may
	also be simpler in terms of coding. The major disadvantage is
	that the realtime clock can be adjusted.  When adjusted, the
	realtime clock time (when interpolating from history) is
	always approximate. In general, the longer the interpolation
	period the larger the potential error. There isn't any error
	interpolating the monotonic raw clock time.
*	This patchset also addresses objections to the previous
	patchsets overly complex correlated timestamp structure. This
	patchset splits that structure into several smaller
	structures.  The correlated timestamp interface is renamed
	cross timestamp to avoid any confusion with the correlated
	clocksource.
*	The correlated clocksource is separated from the cross
	timestamp mechanism.
*	Add monotonic raw to the PTP user interface
*	Add e1000e driver configuration option that wraps Intel PCH
	specific code

Changes v3 to v4: 

*	Adds a history mechanism to accomodate slower devices. In this
	case the response time for timestamp reads to the Intel DSP
	are too slow to be accomodated by the original correlated time
	mechanism. The history mechanism turns shadow timekeeper into
	an array where the history is stored.

Christopher S. Hall (9):
  Add cycles to nanoseconds translation (NEW)
  Add driver cross timestamp interface for higher precision time
    synchronization
  Add correlated clocksource relating aliased auxiliary and system
    clocks (NEW)
  Always Running Timer (ART) correlated clocksource
  Add timekeeping snapshot code capturing system time and counter (NEW)
  Add history to cross timestamp interface supporting slower devices
  Remove duplicated code in ktime_get_raw_and_real()
  Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping
  Adds hardware supported cross timestamp

 Documentation/ptp/testptp.c                 |   6 +-
 arch/x86/include/asm/cpufeature.h           |   2 +-
 arch/x86/include/asm/tsc.h                  |   2 +
 arch/x86/kernel/tsc.c                       |  46 ++++++
 drivers/net/ethernet/intel/Kconfig          |   9 +
 drivers/net/ethernet/intel/e1000e/defines.h |   5 +
 drivers/net/ethernet/intel/e1000e/ptp.c     |  88 ++++++++++
 drivers/net/ethernet/intel/e1000e/regs.h    |   4 +
 drivers/ptp/ptp_chardev.c                   |  27 +++
 include/linux/clocksource.h                 |  43 +++++
 include/linux/pps_kernel.h                  |  17 +-
 include/linux/ptp_clock_kernel.h            |   8 +
 include/linux/timekeeper_internal.h         |   2 +
 include/linux/timekeeping.h                 |  42 +++++
 include/uapi/linux/ptp_clock.h              |  13 +-
 kernel/time/timekeeping.c                   | 247 +++++++++++++++++++++++++---
 16 files changed, 521 insertions(+), 40 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-01-15 10:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 12:12 [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 1/9] Add cycles to nanoseconds translation Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 2/9] Add driver cross timestamp interface for higher precision time synchronization Christopher S. Hall
2016-01-13 21:30   ` Richard Cochran
2016-01-13 12:12 ` [PATCH v6 3/9] Add correlated clocksource relating aliased auxiliary and system clocks Christopher S. Hall
2016-01-15  0:24   ` John Stultz
2016-01-15 10:29     ` Thomas Gleixner
2016-01-13 12:12 ` [PATCH v6 4/9] Always Running Timer (ART) correlated clocksource Christopher S. Hall
2016-01-14 22:00   ` John Stultz
2016-01-13 12:12 ` [PATCH v6 5/9] Add timekeeping snapshot code capturing system time and counter Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 6/9] Add history to cross timestamp interface supporting slower devices Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 7/9] Remove duplicated code in ktime_get_raw_and_real() Christopher S. Hall
2016-01-13 12:12 ` [PATCH v6 8/9] Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping Christopher S. Hall
2016-01-13 21:31   ` Richard Cochran
2016-01-13 12:12 ` [PATCH v6 9/9] Adds hardware supported cross timestamp Christopher S. Hall
2016-01-15  0:49 ` [PATCH v6 0/9] Patchset enabling hardware based cross-timestamps for next gen Intel platforms John Stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).