> On Mon, Dec 09, 2013 at 01:55:53PM +1000, David Gwynne wrote:
> > this is a demonstration of using TIMEOUT_INITIALIZED().
> > 
> > because we know the timeout is always set up correctly, we dont
> > have to test for it all over the place.
> > 
> 
> [a bit of snipping...]
> 
> > -   if (timeout_initialized(&rnd_timeout))
> > -           nanotime(&ts);
> > +   nanotime(&ts);
> 
> I'm not sure you can do this; check revision 1.132 of this file:
> 
>     be more careful with nanotime() calls in early entropy storage, since
>     at least sparc may not have the clock mapped (found by miod).
>     while here, protect some more timeout_*() calls with timeout_initialized()
> 
> Which reversed a diff that did much of what you're doing here.
> 
> So calling nanotime without knowing that your clocks are fully wired up
> appears to be a possibility (or at least was, at one point).

Before the meme becomes "this is about sparc", let's keep it simple.

The initialization of the timeout is used as a flag, to allow the
random subsystem to get entered via multiple paths at any and every
stage of the boot sequence.

It isn't about sparc, it is much bigger than that.

Reply via email to