public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: jamie@jamieiles.com (Jamie Iles)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] hwrng: add support for picoxcell TRNG
Date: Mon, 17 Jan 2011 10:23:30 +0000	[thread overview]
Message-ID: <20110117102330.GB2622@pulham.picochip.com> (raw)
In-Reply-To: <20110115004416.GA19686@gondor.apana.org.au>

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

  reply	other threads:[~2011-01-17 10:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 16:10 [PATCH] hwrng: add support for picoxcell TRNG Jamie Iles
2011-01-14 17:49 ` Matt Mackall
2011-01-14 18:16   ` Jamie Iles
2011-01-14 18:44     ` [PATCHv2] " Jamie Iles
2011-01-14 18:48       ` Matt Mackall
2011-01-14 20:45       ` Alexander Clouter
2011-01-14 21:48         ` Jamie Iles
2011-01-15  0:44       ` Herbert Xu
2011-01-17 10:23         ` Jamie Iles [this message]
2011-01-23  8:00           ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110117102330.GB2622@pulham.picochip.com \
    --to=jamie@jamieiles.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox