[PATCHv2] hwrng: add support for picoxcell TRNG

Jamie Iles jamie at jamieiles.com
Mon Jan 17 05:23:30 EST 2011


On Sat, Jan 15, 2011 at 11:44:16AM +1100, Herbert Xu wrote:
> On Fri, Jan 14, 2011 at 06:44:21PM +0000, Jamie Iles wrote:
> >
> > +	/* Wait for some data to become available. */
> > +	while (__raw_readl(csr) & CSR_OUT_EMPTY_MASK) {
> > +		if (!wait)
> > +			return 0;
> > +		cpu_relax();
> > +	}
> 
> This has the potential to loop indefinitely.  Please add a time-out
> to prevent that (see existing RNG drivers for example).

Ok, that's a fair point!  Here's an updated version with a timeout.  
I've also added in support for the fault detection which I previously 
overlooked.

Jamie

8<--------



More information about the linux-arm-kernel mailing list