lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 8 Sep 2016 21:06:25 +0200
From:   Richard Cochran <richardcochran@...il.com>
To:     Harini Katakam <harinikatakamlinux@...il.com>
Cc:     Andrei Pistirica <andrei.pistirica@...rochip.com>,
        netdev@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>, davem@...emloft.net,
        Nicolas Ferre <nicolas.ferre@...el.com>,
        Harini Katakam <harini.katakam@...inx.com>,
        Punnaiah Choudary Kalluri <punnaia@...inx.com>,
        "michals@...inx.com" <michals@...inx.com>,
        Anirudha Sarangi <anirudh@...inx.com>,
        Boris Brezillon <boris.brezillon@...e-electrons.com>,
        alexandre.belloni@...e-electrons.com, tbultel@...elsurmer.com
Subject: Re: [RFC PATCH 1/2] macb: Add 1588 support in Cadence GEM.

On Thu, Sep 08, 2016 at 10:22:43AM +0530, Harini Katakam wrote:
> >> +     /* 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ