kernel_optimize_test/drivers/char/hw_random
Michael S. Tsirkin fae29f135e hwrng: core - document the quality field
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: 0f734e6e76 ("hwrng: add per-device entropy derating")
Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-10-05 10:16:56 +08:00
..
amd-rng.c
atmel-rng.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
bcm2835-rng.c hwrng: bcm2835 - Handle deferred clock properly 2018-02-22 22:16:21 +08:00
cavium-rng-vf.c hwrng: cavium - make two functions static 2018-03-09 22:45:34 +08:00
cavium-rng.c hwrng: cavium - make two functions static 2018-03-09 22:45:34 +08:00
core.c hwrng: core - document the quality field 2018-10-05 10:16:56 +08:00
exynos-trng.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
geode-rng.c
hisi-rng.c
imx-rngc.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
intel-rng.c
iproc-rng200.c
ixp4xx-rng.c
Kconfig hwrng: msm - remove msm hw_random driver 2018-07-27 19:04:30 +08:00
ks-sa-rng.c hwrng: ks-sa - add hw_random driver 2018-03-23 23:40:08 +08:00
Makefile hwrng: msm - remove msm hw_random driver 2018-07-27 19:04:30 +08:00
meson-rng.c
mtk-rng.c hwrng: mediatek - Setup default RNG quality 2018-01-18 22:52:25 +11:00
mxc-rnga.c hwrng: mxc-rnga - add driver support on boards with device tree 2018-03-16 23:35:44 +08:00
n2-asm.S
n2-drv.c hwrng: n2 - fix spelling mistake: "restesting" -> "retesting" 2018-05-19 00:13:53 +08:00
n2rng.h
nomadik-rng.c
octeon-rng.c
omap-rng.c hwrng: omap - Fix clock resource by adding a register clock 2018-03-09 22:45:45 +08:00
omap3-rom-rng.c
pasemi-rng.c
pic32-rng.c
powernv-rng.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
pseries-rng.c
s390-trng.c
st-rng.c
stm32-rng.c hwrng: stm32 - fix pm_suspend issue 2018-05-05 14:52:49 +08:00
timeriomem-rng.c
tx4939-rng.c
via-rng.c hwrng: via - support new Centaur CPU 2018-04-21 00:59:03 +08:00
virtio-rng.c
xgene-rng.c