summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds2012-06-11 15:31:52 +0200
committerLinus Torvalds2012-06-11 15:31:52 +0200
commit4e3c8a1b1c63482403e9d5e3148dee1a711e4b91 (patch)
tree513410a63a617436c94373fa5cf6273c3a85c47c /drivers/char
parentMerge tag 'regmap-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broon... (diff)
parentcrypto: aesni-intel - fix unaligned cbc decrypt for x86-32 (diff)
downloadkernel-qcow2-linux-4e3c8a1b1c63482403e9d5e3148dee1a711e4b91.tar.gz
kernel-qcow2-linux-4e3c8a1b1c63482403e9d5e3148dee1a711e4b91.tar.xz
kernel-qcow2-linux-4e3c8a1b1c63482403e9d5e3148dee1a711e4b91.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This push fixes an unaligned fault on x86-32 with aesni-intel and an RNG failure with atmel-rng (repeated bits)." * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 hwrng: atmel-rng - fix race condition leading to repeated bits
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/atmel-rng.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index f518b99f53f5..6289f0eee24c 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -36,6 +36,13 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
/* data ready? */
if (readl(trng->base + TRNG_ODATA) & 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;