diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-11 09:31:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-11 09:31:52 -0400 |
commit | 4e3c8a1b1c63482403e9d5e3148dee1a711e4b91 (patch) | |
tree | 513410a63a617436c94373fa5cf6273c3a85c47c /drivers/char | |
parent | b0a4c6f2e3fce088eb597d4b9ee2075cb6399ee1 (diff) | |
parent | 7c8d51848a88aafdb68f42b6b650c83485ea2f84 (diff) |
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.c | 7 |
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, | |||
36 | /* data ready? */ | 36 | /* data ready? */ |
37 | if (readl(trng->base + TRNG_ODATA) & 1) { | 37 | if (readl(trng->base + TRNG_ODATA) & 1) { |
38 | *data = readl(trng->base + TRNG_ODATA); | 38 | *data = readl(trng->base + TRNG_ODATA); |
39 | /* | ||
40 | ensure data ready is only set again AFTER the next data | ||
41 | word is ready in case it got set between checking ISR | ||
42 | and reading ODATA, so we don't risk re-reading the | ||
43 | same word | ||
44 | */ | ||
45 | readl(trng->base + TRNG_ISR); | ||
39 | return 4; | 46 | return 4; |
40 | } else | 47 | } else |
41 | return 0; | 48 | return 0; |