[PATCH v8 4/8] time: Add driver cross timestamp interface for higher precision time synchronization

2016-02-22 Thread Christopher S. Hall
hich is exactly related to TSC through a known frequency ratio. The ART is routed to devices on the system and is used to precisely and simultaneously capture the device clock with the ART. Signed-off-by: Christopher S. Hall [jstultz: Reworked to remove extra structures and simplify calling] Signed-off-

[PATCH v8 1/8] time: Add cycles to nanoseconds translation

2016-02-22 Thread Christopher S. Hall
nanosecond value from a cycle count that can be added to tk_read_base.base value yielding the current system time. This allows clocksource cycle values external to the timekeeping code to provide a cycle count that can be transformed to system time. Signed-off-by: Christopher S. Hall Signed-off-by: John

[PATCH v8 6/8] x86: tsc: Always Running Timer (ART) correlated clocksource

2016-02-22 Thread Christopher S. Hall
of an interface to adjust k. See 17.14.4 of the Intel SDM for more details] Signed-off-by: Christopher S. Hall [jstultz: Tweaked to fix build issue, also reworked math for 64bit division on 32bit systems] Signed-off-by: John Stultz --- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/

[PATCH v8 7/8] ptp: Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping

2016-02-22 Thread Christopher S. Hall
timestamping. Acked-by: Richard Cochran Signed-off-by: Christopher S. Hall [jstultz: Commit subject tweaks] Signed-off-by: John Stultz --- Documentation/ptp/testptp.c | 6 -- drivers/ptp/ptp_chardev.c| 27 +++ include/linux/ptp_clock_kernel.h | 8

[PATCH v8 5/8] time: Add history to cross timestamp interface supporting slower devices

2016-02-22 Thread Christopher S. Hall
using ktime_get_snapshot() and must be called before the counter values are read. Signed-off-by: Christopher S. Hall Signed-off-by: John Stultz --- include/linux/timekeeper_internal.h | 2 + include/linux/timekeeping.h | 5 ++ kernel/time/timekeeping.c | 173 +++

[PATCH v8 2/8] time: Add timekeeping snapshot code capturing system time and counter

2016-02-22 Thread Christopher S. Hall
In the current timekeeping code there isn't any interface to atomically capture the current relationship between the system counter and system time. ktime_get_snapshot() returns this triple (counter, monotonic raw, realtime) in the system_time_snapshot struct. Signed-off-by: Christopher S.

[PATCH v8 8/8] net: e1000e: Adds hardware supported cross timestamp on e1000e nic

2016-02-22 Thread Christopher S. Hall
get_system_device_crosststamp(). The hardware cross-timestamp result is made available to applications through the PTP_SYS_OFFSET_PRECISE ioctl which calls e1000e_phc_getcrosststamp(). Signed-off-by: Christopher S. Hall [jstultz: Reworked to use new interface, commit message tweaks] Signed-off-by: John Stultz

[PATCH v8 3/8] time: Remove duplicated code in ktime_get_raw_and_real()

2016-02-22 Thread Christopher S. Hall
(). A side effect of this is that the raw and real results of pps_get_ts() correspond to exactly the same clock cycle. Previously these values represented separate reads of the system clock. Signed-off-by: Christopher S. Hall Signed-off-by: John Stultz --- include/linux/pps_kernel.h | 17

[PATCH v8 0/8] Patchset enabling hardware based cross-timestamps for next gen Intel platforms

2016-02-22 Thread Christopher S. Hall
an array where the history is stored. Christopher S. Hall (8): time: Add cycles to nanoseconds translation time: Add timekeeping snapshot code capturing system time and counter time: Remove duplicated code in ktime_get_raw_and_real() time: Add driver cross timestamp interface for higher

[PATCH v7 0/8] Patchset enabling hardware based cross-timestamps for next gen Intel platforms

2016-02-12 Thread Christopher S. Hall
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 (8): time: Add cycles to nanoseconds translation time: Add timekeeping snapshot code capt

[PATCH v7 2/8] time: Add timekeeping snapshot code capturing system time and counter

2016-02-12 Thread Christopher S. Hall
In the current timekeeping code there isn't any interface to atomically capture the current relationship between the system counter and system time. ktime_get_snapshot() returns this triple (counter, monotonic raw, realtime) in the system_time_snapshot struct. Signed-off-by: Christopher S.

[PATCH v7 1/8] time: Add cycles to nanoseconds translation

2016-02-12 Thread Christopher S. Hall
nanosecond value from a cycle count that can be added to tk_read_base.base value yielding the current system time. This allows clocksource cycle values external to the timekeeping code to provide a cycle count that can be transformed to system time. Signed-off-by: Christopher S. Hall Signed-off-by: John

[PATCH v7 5/8] time: Add history to cross timestamp interface supporting slower devices

2016-02-12 Thread Christopher S. Hall
using ktime_get_snapshot() and must be called before the counter values are read. Signed-off-by: Christopher S. Hall Signed-off-by: John Stultz --- include/linux/timekeeper_internal.h | 2 + include/linux/timekeeping.h | 5 ++ kernel/time/timekeeping.c | 172 +++

[PATCH v7 4/8] time: Add driver cross timestamp interface for higher precision time synchronization

2016-02-12 Thread Christopher S. Hall
hich is exactly related to TSC through a known frequency ratio. The ART is routed to devices on the system and is used to precisely and simultaneously capture the device clock with the ART. Signed-off-by: Christopher S. Hall [jstultz: Reworked to remove extra structures and simplify calling] Signed-off-

[PATCH v7 7/8] ptp: Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping

2016-02-12 Thread Christopher S. Hall
timestamping. Acked-by: Richard Cochran Signed-off-by: Christopher S. Hall [jstultz: Commit subject tweaks] Signed-off-by: John Stultz --- Documentation/ptp/testptp.c | 6 -- drivers/ptp/ptp_chardev.c| 27 +++ include/linux/ptp_clock_kernel.h | 8

[PATCH v7 6/8] x86: tsc: Always Running Timer (ART) correlated clocksource

2016-02-12 Thread Christopher S. Hall
of an interface to adjust k. See 17.14.4 of the Intel SDM for more details] Signed-off-by: Christopher S. Hall [jstultz: Tweaked to fix build issue, also reworked math for 64bit division on 32bit systems] Signed-off-by: John Stultz --- arch/x86/include/asm/cpufeature.h | 3 ++- arch/x86/include/

[PATCH v7 8/8] net: e1000e: Adds hardware supported cross timestamp on e1000e nic

2016-02-12 Thread Christopher S. Hall
get_system_device_crosststamp(). The hardware cross-timestamp result is made available to applications through the PTP_SYS_OFFSET_PRECISE ioctl which calls e1000e_phc_getcrosststamp(). Signed-off-by: Christopher S. Hall [jstultz: Reworked to use new interface, commit message tweaks] Signed-off-by: John Stultz

[PATCH v7 3/8] time: Remove duplicated code in ktime_get_raw_and_real()

2016-02-12 Thread Christopher S. Hall
(). A side effect of this is that the raw and real results of pps_get_ts() correspond to exactly the same clock cycle. Previously these values represented separate reads of the system clock. Signed-off-by: Christopher S. Hall Signed-off-by: John Stultz --- include/linux/pps_kernel.h | 17

[RFC v5 4/6] Remove duplicate code from ktime_get_raw_and_real code

2016-01-04 Thread Christopher S. Hall
counter twice. Signed-off-by: Christopher S. Hall --- kernel/time/timekeeping.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5a7f784..a0f096c 100644 --- a/kernel/time/timekeeping.c +++ b

[RFC v5 0/6] Patchset enabling hardware based cross-timestamps for next gen Intel platforms

2016-01-04 Thread Christopher S. Hall
s. 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 (6): Timeke

[RFC v5 5/6] Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping

2016-01-04 Thread Christopher S. Hall
timestamping. Signed-off-by: Christopher S. Hall --- Documentation/ptp/testptp.c | 6 -- drivers/ptp/ptp_chardev.c| 31 +++ include/linux/ptp_clock_kernel.h | 8 include/uapi/linux/ptp_clock.h | 13 - 4 files changed, 55 insertions

[RFC v5 3/6] Add history to cross timestamp interface supporting slower devices

2016-01-04 Thread Christopher S. Hall
hanges) to the time, the error can be very large. Signed-off-by: Christopher S. Hall --- include/linux/clocksource.h | 16 include/linux/timekeeper_internal.h | 4 + include/linux/timekeeping.h | 9 +- kernel/time/timekeeping.c | 162 +

[RFC v5 2/6] Always Running Timer (ART) correlated clocksource

2016-01-04 Thread Christopher S. Hall
of an interface to adjust k. See 17.14.4 of the Intel SDM for more details] Signed-off-by: Christopher S. Hall --- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/asm/tsc.h| 2 ++ arch/x86/kernel/tsc.c | 46 +++ 3 files changed,

[RFC v5 1/6] Timekeeping cross timestamp interface for device drivers

2016-01-04 Thread Christopher S. Hall
e current clock source to calculate the system time. The correlated clocksource adds a means to transform a clock (in this case ART) exactly to the system clock (TSC clocksource) that is used to calculate system time. Signed-off-by: Christopher S. Hall --- include/linux/clocksource.h | 27 ++

[RFC v5 6/6] Adds hardware supported cross timestamp

2016-01-04 Thread Christopher S. Hall
get_device_system_crosststamp(). The hardware cross-timestamp result is made available to applications through the PTP_SYS_OFFSET_PRECISE ioctl which call e1000e_phc_getsynctime(). Signed-off-by: Christopher S. Hall --- drivers/net/ethernet/intel/Kconfig | 9 +++ drivers/net/ethernet/intel/e1000e/defines.h

[PATCH v4 1/4] Produce system time from correlated clocksource

2015-10-12 Thread Christopher S. Hall
amp value is too old, an error is returned Signed-off-by: Christopher S. Hall --- include/linux/clocksource.h | 33 +++ include/linux/timekeeping.h | 4 + kernel/time/timekeeping.c | 203 ++-- 3 files changed, 235 insertions(+), 5 deletions(-) di

[PATCH v4 0/4] Patchset enabling hardware based cross-timestamps for next gen Intel platforms

2015-10-12 Thread Christopher S. Hall
"slow" device) to perform cross-timestamping. Christopher S. Hall (4): Produce system time from correlated clocksource Always running timer correlated clocksource Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping Adds hardware supported cross timestamp Documentation/ptp

[PATCH v4 3/4] Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping

2015-10-12 Thread Christopher S. Hall
timestamping. Signed-off-by: Christopher S. Hall --- Documentation/ptp/testptp.c | 6 -- drivers/ptp/ptp_chardev.c| 26 ++ include/linux/ptp_clock_kernel.h | 6 ++ include/uapi/linux/ptp_clock.h | 12 +++- 4 files changed, 47 insertions(+), 3

[PATCH v4 4/4] Adds hardware supported cross timestamp

2015-10-12 Thread Christopher S. Hall
hardware cross-timestamp result is made available to applications through the PTP_SYS_OFFSET_PRECISE ioctl. Signed-off-by: Christopher S. Hall --- drivers/net/ethernet/intel/e1000e/defines.h | 5 ++ drivers/net/ethernet/intel/e1000e/ptp.c | 77 + drivers/net/ethernet

[PATCH v4 2/4] Always running timer correlated clocksource

2015-10-12 Thread Christopher S. Hall
an example of an interface to adjust k. See 17.14.4 of the Intel SDM for more details] Signed-off-by: Christopher S. Hall --- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/asm/tsc.h| 2 ++ arch/x86/kernel/tsc.c | 48 ++- 3 fi

[PATCH v3 2/4] Added ART correlated clocksource and ART CPU feature

2015-08-21 Thread Christopher S. Hall
ver conversion of ART to TSC Signed-off-by: Christopher S. Hall --- arch/x86/include/asm/cpufeature.h | 3 ++- arch/x86/include/asm/tsc.h| 2 ++ arch/x86/kernel/tsc.c | 54 +++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/arch/

[PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-08-21 Thread Christopher S. Hall
-off-by: Christopher S. Hall --- include/linux/clocksource.h | 33 +++ include/linux/timekeeping.h | 4 +++ kernel/time/timekeeping.c | 65 + 3 files changed, 102 insertions(+) diff --git a/include/linux/clocksource.h b/include

[PATCH v3 4/4] Enabling hardware supported PTP system/device crosstimestamping

2015-08-21 Thread Christopher S. Hall
ime reporting cross timestamp to PTP driver Signed-off-by: Christopher S. Hall --- drivers/net/ethernet/intel/e1000e/defines.h | 5 ++ drivers/net/ethernet/intel/e1000e/ptp.c | 88 + drivers/net/ethernet/intel/e1000e/regs.h| 4 ++ 3 files changed,

[PATCH v3 3/4] Add support for driver cross-timestamp to PTP_SYS_OFFSET ioctl

2015-08-21 Thread Christopher S. Hall
to ensure precise correlation Modified PTP_SYS_OFFSET ioctl in PTP clock driver to use the above callback if it's available Added capability (PTP_CLOCK_GETCAPS) for checking whether driver supports cross timestamping Added check for cross timestamping flag to testptp.c Signed-off-by: Chri

[PATCH v3 0/4] Patchset enabling hardware based cross-timestamps for next gen Intel platforms

2015-08-21 Thread Christopher S. Hall
upport for driver cross-timestamp to PTP_SYS_OFFSET ioctl Enabling hardware supported PTP system/device crosstimestamping Christopher S. Hall (2): Add correlated clocksource deriving system time from an auxiliary clocksource Added ART correlated clocksource and ART CPU feature Documen