netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] dp83640: Adjust ptp event timestamps
@ 2014-07-09 10:22 Stefan Sørensen
  2014-07-09 17:41 ` Richard Cochran
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Sørensen @ 2014-07-09 10:22 UTC (permalink / raw)
  To: richardcochran; +Cc: netdev, Stefan Sørensen

From the dp86340 Software Development Guide:
  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>
---
 drivers/net/phy/dp83640.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 53bd1af..76fbd39 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -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;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH net-next] dp83640: Adjust ptp event timestamps
@ 2014-07-11  6:18 Stefan Sørensen
  2014-07-11 21:05 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Sørensen @ 2014-07-11  6:18 UTC (permalink / raw)
  To: davem; +Cc: richardcochran, netdev, Stefan Sørensen

From the dp86340 Software Development Guide:
  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>
---
 drivers/net/phy/dp83640.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 53bd1af..76fbd39 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -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;
-- 
1.9.3

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

end of thread, other threads:[~2014-07-11 21:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-09 10:22 [PATCH net-next] dp83640: Adjust ptp event timestamps Stefan Sørensen
2014-07-09 17:41 ` Richard Cochran
2014-07-10  9:13   ` Sørensen, Stefan
2014-07-10 17:34     ` Richard Cochran
2014-07-10 17:35 ` Richard Cochran
2014-07-10 17:38 ` Richard Cochran
  -- strict thread matches above, loose matches on Subject: below --
2014-07-11  6:18 Stefan Sørensen
2014-07-11 21:05 ` David Miller

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).