]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwrng: timeriomem - Improve performance for sub-jiffie update periods
authorRick Altherr <raltherr@google.com>
Wed, 5 Apr 2017 23:21:00 +0000 (16:21 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 10 Apr 2017 11:17:25 +0000 (19:17 +0800)
commitca3bff70ab320a9132c5524c495455526df4b078
tree822f437139abfa0ab2e3f26a75688ae32a6ece32
parent5ab693e63a93c387171b4f7834b2f7bfe9b55f35
hwrng: timeriomem - Improve performance for sub-jiffie update periods

Some hardware RNGs provide a single register for obtaining random data.
Instead of signaling when new data is available, the reader must wait a
fixed amount of time between reads for new data to be generated.
timeriomem_rng implements this scheme with the period specified in
platform data or device tree.  While the period is specified in
microseconds, the implementation used a standard timer which has a
minimum delay of 1 jiffie and caused a significant bottleneck for
devices that can update at 1us.  By switching to an hrtimer, 1us periods
now only delay at most 2us per read.

Signed-off-by: Rick Altherr <raltherr@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/timeriomem-rng.c