mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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, pankaj.dev@st.com,
	daniel.thompson@linaro.org, linux@arm.linux.org.uk,
	Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v2 3/3] hwrng: st: Improve FIFO size/depth description
Date: Wed,  7 Oct 2015 13:23:29 +0100	[thread overview]
Message-ID: <1444220609-31251-4-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1444220609-31251-1-git-send-email-lee.jones@linaro.org>

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>
---
 drivers/char/hw_random/st-rng.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c
index 17f0a09..1d35363 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
-- 
1.9.1


  parent reply	other threads:[~2015-10-07 12:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 12:23 [PATCH v2 0/3] hwrng: st: Couple of improvements Lee Jones
2015-10-07 12:23 ` [PATCH v2 1/3] hwrng: st: dt: Fix trivial typo in node address Lee Jones
2015-10-07 12:23 ` [PATCH v2 2/3] hwrng: st: Use real-world device timings for timeout Lee Jones
2015-10-07 12:23 ` Lee Jones [this message]
2015-10-08 14:23 ` [PATCH v2 0/3] hwrng: st: Couple of improvements Herbert Xu
2015-10-09  7:24   ` 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=1444220609-31251-4-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=daniel.thompson@linaro.org \
    --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=linux@arm.linux.org.uk \
    --cc=pankaj.dev@st.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

all inboxes | Powered by JetHome®