From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: kernel@stlinux.com, herbert@gondor.apana.org.au,
linux-crypto@vger.kernel.org, peter@korsgaard.com,
festevam@gmail.com, pankaj.dev@st.com,
daniel.thompson@linaro.org, Lee Jones <lee.jones@linaro.org>
Subject: [RESEND 2/3] hwrng: st: Use real-world device timings for timeout
Date: Tue, 6 Oct 2015 17:12:50 +0100 [thread overview]
Message-ID: <1444147971-25778-2-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1444147971-25778-1-git-send-email-lee.jones@linaro.org>
Samples are documented to be available every 0.667us, so in theory
the 8 sample deep FIFO should take 5.336us to fill. However, during
thorough testing, it became apparent that filling the FIFO actually
takes closer to 12us.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/char/hw_random/st-rng.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c
index 8c8a435..a1ff080 100644
--- a/drivers/char/hw_random/st-rng.c
+++ b/drivers/char/hw_random/st-rng.c
@@ -32,8 +32,13 @@
#define ST_RNG_FIFO_SIZE 8
#define ST_RNG_SAMPLE_SIZE 2 /* 2 Byte (16bit) samples */
-/* Samples are available every 0.667us, which we round to 1us */
-#define ST_RNG_FILL_FIFO_TIMEOUT (1 * (ST_RNG_FIFO_SIZE / ST_RNG_SAMPLE_SIZE))
+/*
+ * Samples are documented to be available every 0.667us, so in theory
+ * the 8 sample deep FIFO should take 5.336us to fill. However, during
+ * thorough testing, it became apparent that filling the FIFO actually
+ * takes closer to 12us.
+ */
+#define ST_RNG_FILL_FIFO_TIMEOUT 12
struct st_rng_data {
void __iomem *base;
--
1.9.1
next prev parent reply other threads:[~2015-10-06 16:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 16:12 [RESEND 1/3] hwrng: st: dt: Fix trivial typo in node address Lee Jones
2015-10-06 16:12 ` Lee Jones [this message]
2015-10-06 16:12 ` [RESEND 3/3] hwrng: st: Report correct FIFO size Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444147971-25778-2-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=daniel.thompson@linaro.org \
--cc=festevam@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pankaj.dev@st.com \
--cc=peter@korsgaard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).