From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Peter Korsgaard <jacmet@sunsite.dk>, <herbert@gondor.apana.org.au>
Cc: <jamie@jamieiles.com>, <linux-kernel@vger.kernel.org>,
<GPontis@z9.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH] hw_random: atmel-rng: fix data valid check
Date: Wed, 23 May 2012 15:00:53 +0200 [thread overview]
Message-ID: <4FBCDF85.5030707@atmel.com> (raw)
In-Reply-To: <1337776317-25679-1-git-send-email-jacmet@sunsite.dk>
On 05/23/2012 02:31 PM, Peter Korsgaard :
> Brown paper bag: Data valid is LSB of the ISR (status register), and NOT
> of ODATA (current random data word)!
>
> With this, rngtest is a lot happier. Before:
>
> rngtest 3
> Copyright (c) 2004 by Henrique de Moraes Holschuh
> This is free software; see the source for copying conditions. There is NO warr.
>
> rngtest: starting FIPS tests...
> rngtest: bits received from input: 20000032
> rngtest: FIPS 140-2 successes: 3
> rngtest: FIPS 140-2 failures: 997
> rngtest: FIPS 140-2(2001-10-10) Monobit: 604
> rngtest: FIPS 140-2(2001-10-10) Poker: 996
> rngtest: FIPS 140-2(2001-10-10) Runs: 36
> rngtest: FIPS 140-2(2001-10-10) Long run: 0
> rngtest: FIPS 140-2(2001-10-10) Continuous run: 117
> rngtest: input channel speed: (min=622.371; avg=23682.481; max=28224.350)Kibitss
> rngtest: FIPS tests speed: (min=12.361; avg=12.718; max=12.861)Mibits/s
> rngtest: Program run time: 2331696 microsecondsx
>
> After:
> rngtest 3
> Copyright (c) 2004 by Henrique de Moraes Holschuh
> This is free software; see the source for copying conditions. There is NO warr.
>
> rngtest: starting FIPS tests...
> rngtest: bits received from input: 20000032
> rngtest: FIPS 140-2 successes: 999
> rngtest: FIPS 140-2 failures: 1
> rngtest: FIPS 140-2(2001-10-10) Monobit: 0
> rngtest: FIPS 140-2(2001-10-10) Poker: 0
> rngtest: FIPS 140-2(2001-10-10) Runs: 1
> rngtest: FIPS 140-2(2001-10-10) Long run: 0
> rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
> rngtest: input channel speed: (min=777.363; avg=43588.270; max=47870.711)Kibitss
> rngtest: FIPS tests speed: (min=11.943; avg=12.716; max=12.844)Mibits/s
> rngtest: Program run time: 1955282 microseconds
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
> Reported-by: George Pontis <GPontis@z9.com>
Indeed, yes ;-)
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> drivers/char/hw_random/atmel-rng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
> index f518b99..d7ab920 100644
> --- a/drivers/char/hw_random/atmel-rng.c
> +++ b/drivers/char/hw_random/atmel-rng.c
> @@ -34,7 +34,7 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
> u32 *data = buf;
>
> /* data ready? */
> - if (readl(trng->base + TRNG_ODATA) & 1) {
> + if (readl(trng->base + TRNG_ISR) & 1) {
> *data = readl(trng->base + TRNG_ODATA);
> return 4;
> } else
--
Nicolas Ferre
next prev parent reply other threads:[~2012-05-23 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 12:31 [PATCH] hw_random: atmel-rng: fix data valid check Peter Korsgaard
2012-05-23 13:00 ` Nicolas Ferre [this message]
2012-06-11 16:15 ` Nicolas Ferre
2012-06-12 0:15 ` 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=4FBCDF85.5030707@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=GPontis@z9.com \
--cc=herbert@gondor.apana.org.au \
--cc=jacmet@sunsite.dk \
--cc=jamie@jamieiles.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).