dp83640: Adjust ptp event timestamps
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Fri, 11 Jul 2014 06:18:26 +0000 (08:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jul 2014 21:05:15 +0000 (14:05 -0700)
  Event timestamp values should be adjusted by 3*reference clock period +
  11 ns = 35 ns to compensate for input path and synchronization delays.

So subtract 35ns from event timestamps.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83640.c

index 53bd1af68422f53e9d831d0e07319ec154bbcf55..76fbd3948736568e4b318d7e9f20e4abd88dd8d1 100644 (file)
@@ -755,6 +755,9 @@ static int decode_evnt(struct dp83640_private *dp83640,
        event.type = PTP_CLOCK_EXTTS;
        event.timestamp = phy2txts(&dp83640->edata);
 
+       /* Compensate for input path and synchronization delays */
+       event.timestamp -= 35;
+
        for (i = 0; i < N_EXT_TS; i++) {
                if (ext_status & exts_chan_to_edata(i)) {
                        event.index = i;