Re: [PATCHv2] hwrng: add support for picoxcell TRNG

From: Herbert Xu
Date: Fri Jan 14 2011 - 19:45:04 EST


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

Thanks!
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/