git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[BNX2]: Update firmware to support S/G RX buffers.
[safe/jmp/linux-2.6]
/
drivers
/
char
/
hw_random
/
intel-rng.c
diff --git
a/drivers/char/hw_random/intel-rng.c
b/drivers/char/hw_random/intel-rng.c
index
753f460
..
5cc651e
100644
(file)
--- a/
drivers/char/hw_random/intel-rng.c
+++ b/
drivers/char/hw_random/intel-rng.c
@@
-29,6
+29,7
@@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/stop_machine.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/stop_machine.h>
+#include <linux/delay.h>
#include <asm/io.h>
#include <asm/io.h>
@@
-162,11
+163,19
@@
static inline u8 hwstatus_set(void __iomem *mem,
return hwstatus_get(mem);
}
return hwstatus_get(mem);
}
-static int intel_rng_data_present(struct hwrng *rng)
+static int intel_rng_data_present(struct hwrng *rng
, int wait
)
{
void __iomem *mem = (void __iomem *)rng->priv;
{
void __iomem *mem = (void __iomem *)rng->priv;
-
- return !!(readb(mem + INTEL_RNG_STATUS) & INTEL_RNG_DATA_PRESENT);
+ int data, i;
+
+ for (i = 0; i < 20; i++) {
+ data = !!(readb(mem + INTEL_RNG_STATUS) &
+ INTEL_RNG_DATA_PRESENT);
+ if (data || !wait)
+ break;
+ udelay(10);
+ }
+ return data;
}
static int intel_rng_data_read(struct hwrng *rng, u32 *data)
}
static int intel_rng_data_read(struct hwrng *rng, u32 *data)