15 Jul, 2019
1 commit
-
There are lots of documents that belong to the admin-guide but
are on random places (most under Documentation root dir).Move them to the admin guide.
Signed-off-by: Mauro Carvalho Chehab
Acked-by: Alexandre Belloni
Acked-by: Bartlomiej Zolnierkiewicz
05 Oct, 2018
1 commit
-
quality field is currently documented as being 'per mill'. In fact the
math involved is:add_hwgenerator_randomness((void *)rng_fillbuf, rc,
rc * current_quality * 8 >> 10);thus the actual definition is "bits of entropy per 1024 bits of input".
The current documentation seems to have confused multiple people
in the past, let's fix the documentation to match code.An alternative is to change core to match driver expectations, replacing
rc * current_quality * 8 >> 10
with
rc * current_quality / 1000
but that has performance costs, so probably isn't a good option.Fixes: 0f734e6e768 ("hwrng: add per-device entropy derating")
Reported-by: "Dr. David Alan Gilbert"
Signed-off-by: Michael S. Tsirkin
Signed-off-by: Herbert Xu
21 Nov, 2016
1 commit
-
As hw_random core calls ->read with max > 32 or more, make it explicit.
Also remove checks involving 'max' being less than 8.Signed-off-by: PrasannaKumar Muralidharan
Signed-off-by: Herbert Xu
24 Aug, 2016
1 commit
-
Currently, very few RNG drivers support single byte reads using the
->read() interface. Of the 14 drivers in drivers/char/hw_random that
support this interface only three of these actually support max == 1.
The other behaviours vary between return 0, return 2, return 4 and return
-EIO).This is not a problem in practice because the core hw_random code never
performs a read shorter than 16 bytes. The documentation for this function
already contrains the alignment of the buffer pointer, so let's also
guarantee that the buffer is at least as large as its alignment.This constraint is intended to be the weakest guarantee neccessary to
allow driver writers to safely simplify their code.Signed-off-by: Daniel Thompson
Signed-off-by: Herbert Xu
16 Mar, 2015
1 commit
-
This change adds devm_hwrng_register and devm_hwrng_unregister which
use can simplify error unwinding and unbinding code paths in device
drivers.Signed-off-by: Dmitry Torokhov
Signed-off-by: Herbert Xu
26 Dec, 2014
1 commit
-
There is no point in doing a manual completion for cleanup_done
when struct completion fits in perfectly.Signed-off-by: Herbert Xu
22 Dec, 2014
2 commits
-
The previous patch added one potential problem: we can still be
reading from a hwrng when it's unregistered. Add a wait for zero
in the hwrng_unregister path.Signed-off-by: Rusty Russell
Signed-off-by: Amos Kong
Signed-off-by: Herbert Xu -
current_rng holds one reference, and we bump it every time we want
to do a read from it.This means we only hold the rng_mutex to grab or drop a reference,
so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn't
block on read of /dev/hwrng.Using a kref is overkill (we're always under the rng_mutex), but
a standard pattern.This also solves the problem that the hwrng_fillfn thread was
accessing current_rng without a lock, which could change (eg. to NULL)
underneath it.Signed-off-by: Rusty Russell
Signed-off-by: Amos Kong
Signed-off-by: Herbert Xu
15 Jul, 2014
2 commits
-
This patch introduces a derating factor to struct hwrng for
the random bits going into the kernel input pool, and a common
default derating for drivers which do not specify one.Signed-off-by: Torsten Duwe
Signed-off-by: Theodore Ts'o
Acked-by: H. Peter Anvin -
This patch adds an interface to the random pool for feeding entropy
in-kernel.Signed-off-by: Torsten Duwe
Signed-off-by: Theodore Ts'o
Acked-by: H. Peter Anvin
25 May, 2011
1 commit
-
Cc: Herbert Xu
Cc: Matt Mackall
Signed-off-by: Sasha Levin
Signed-off-by: Jiri Kosina
01 Dec, 2009
1 commit
-
This patch implements a new method by which hw_random hardware drivers
can pass data to the core more efficiently, using a shared buffer.The old methods have been retained as a compatability layer until all the
drivers have been updated.Signed-off-by: Ian Molton
Acked-by: Matt Mackall
Acked-by: Rusty Russell
Signed-off-by: Herbert Xu
30 Apr, 2008
1 commit
-
Remove the "#ifdef __KERNEL__" tests from unexported header files in
linux/include whose entire contents are wrapped in that preprocessor
test.Signed-off-by: Robert P. J. Day
Cc: David Woodhouse
Cc: Sam Ravnborg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Apr, 2008
1 commit
-
After 2.6.24 there was a plan to make the PM core acquire all device
semaphores during a suspend/hibernation to protect itself from
concurrent operations involving device objects. That proved to be
too heavy-handed and we found a better way to achieve the goal, but
before it happened, we had introduced the functions
device_pm_schedule_removal() and destroy_suspended_device() to allow
drivers to "safely" destroy a suspended device and we had adapted some
drivers to use them. Now that these functions are no longer necessary,
it seems reasonable to remove them and modify their users to use the
normal device unregistration instead.Signed-off-by: Rafael J. Wysocki
Acked-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman
06 Feb, 2008
1 commit
-
Make it possible to unregister a Hardware Random Number Generator
device object in a safe way during a suspend/resume cycle.Signed-off-by: Rafael J. Wysocki
Acked-by: Michael Buesch
Cc: Michael Buesch
Cc: Pavel Machek
Cc: "John W. Linville"
Cc: Alan Stern
Cc: Len Brown
Cc: Greg KH
Cc: Kay Sievers
Cc: Richard Purdie
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jan, 2008
1 commit
-
Handle waiting for new random within the drivers themselves, this allows to
use better suited timeouts for the individual rngs.Signed-off-by: Patrick McHardy
Acked-by: Michael Buesch
Signed-off-by: Herbert Xu
27 Jun, 2006
1 commit
-
Signed-off-by: Michael Buesch
Cc: Jeff Garzik
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds