summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-18 17:22:45 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-18 17:22:45 +0400
commit5b1f6d81e4c63ae30d92678cc35081001add7674 (patch)
tree8980816357cfe8df56ca9735da73b75c1ed6d235 /drivers/char
parent8397c76a2c209997c7119bede2f26e51d8c786bc (diff)
parent84a1caf1453c3d44050bd22db958af4a7f99315c (diff)
downloadlinux-5b1f6d81e4c63ae30d92678cc35081001add7674.tar.xz
Merge 3.5-rc7 into char-misc-next.
This lets us pick up the mei driver changes that we need in order to handle future merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/atmel-rng.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index f518b99f53f5..731c9046cf7b 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -34,8 +34,15 @@ 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);
+ /*
+ ensure data ready is only set again AFTER the next data
+ word is ready in case it got set between checking ISR
+ and reading ODATA, so we don't risk re-reading the
+ same word
+ */
+ readl(trng->base + TRNG_ISR);
return 4;
} else
return 0;