summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/st-rng.c
diff options
context:
space:
mode:
authorLee Jones2015-10-07 14:23:29 +0200
committerHerbert Xu2015-10-08 15:42:25 +0200
commit9ad92bdff7062d9925754607f5a92b4f651fc7d3 (patch)
treed8a4da2305e7118015828cdd77b7036f7083bade /drivers/char/hw_random/st-rng.c
parenthwrng: st - Use real-world device timings for timeout (diff)
downloadkernel-qcow2-linux-9ad92bdff7062d9925754607f5a92b4f651fc7d3.tar.gz
kernel-qcow2-linux-9ad92bdff7062d9925754607f5a92b4f651fc7d3.tar.xz
kernel-qcow2-linux-9ad92bdff7062d9925754607f5a92b4f651fc7d3.zip
hwrng: st - Improve FIFO size/depth description
The original representation of FIFO size in the driver coupled with the ambiguity in the documentation meant that it was easy to confuse readers. This lead to a false positive BUG-find and subsequently time wastage debugging this phantom issue. Hopefully this patch can prevent future readers from falling into the same trap. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random/st-rng.c')
-rw-r--r--drivers/char/hw_random/st-rng.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c
index 17f0a092bf24..1d35363d23c5 100644
--- a/drivers/char/hw_random/st-rng.c
+++ b/drivers/char/hw_random/st-rng.c
@@ -29,8 +29,9 @@
#define ST_RNG_STATUS_BAD_ALTERNANCE BIT(1)
#define ST_RNG_STATUS_FIFO_FULL BIT(5)
-#define ST_RNG_FIFO_SIZE 8
#define ST_RNG_SAMPLE_SIZE 2 /* 2 Byte (16bit) samples */
+#define ST_RNG_FIFO_DEPTH 4
+#define ST_RNG_FIFO_SIZE (ST_RNG_FIFO_DEPTH * ST_RNG_SAMPLE_SIZE)
/*
* Samples are documented to be available every 0.667us, so in theory