Thread (11 messages) 11 messages, 3 authors, 2016-09-09

Re: [RFC PATCH 1/2] macb: Add 1588 support in Cadence GEM.

flat view

From: Richard Cochran <richardcochran@gmail.com>
Date: 2016-09-08 19:06:32
Also in: linux-arm-kernel, lkml

On Thu, Sep 08, 2016 at 10:22:43AM +0530, Harini Katakam wrote:
quoted
quoted
+     /* get GEM internal time */
+     sech = gem_readl(bp, TSH);
+     secl = gem_readl(bp, TSL);
Does reading TSH latch the time?  The TRM is silent about that, and
most other designs latch on reading the LSB.
No, it does not latch the time.
When doing a read + adjust + write, this will
mean there's room for some error.
It also means that you will have to handle when the TSL value
overflows into TSH.  That means reading TSH twice, once before and
once after reading TSL and retrying if needed.

The code as written above will produce apparent jumps backwards in
time, whenever the overflow occurs between the two read operations.

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help