summaryrefslogtreecommitdiff
path: root/include/linux/random.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-11-06 16:02:43 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2022-11-18 02:18:10 +0100
commitdb516da95ce458f0cab5e7ae2db93fd821484d7d (patch)
tree7025999d032360dfcd0f5dc4c772f5206dff0fd0 /include/linux/random.h
parent19258d05b619d26622bdcfa11eca1f457b69e4da (diff)
hw_random: use add_hwgenerator_randomness() for early entropy
Rather than calling add_device_randomness(), the add_early_randomness() function should use add_hwgenerator_randomness(), so that the early entropy can be potentially credited, which allows for the RNG to initialize earlier without having to wait for the kthread to come up. This requires some minor API refactoring, by adding a `sleep_after` parameter to add_hwgenerator_randomness(), so that we don't hit a blocking sleep from add_early_randomness(). Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'include/linux/random.h')
-rw-r--r--include/linux/random.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 9455d93f5ba3..3b028c7ca065 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -17,7 +17,7 @@ void __init add_bootloader_randomness(const void *buf, size_t len);
void add_input_randomness(unsigned int type, unsigned int code,
unsigned int value) __latent_entropy;
void add_interrupt_randomness(int irq) __latent_entropy;
-void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy);
+void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy, bool sleep_after);
#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
static inline void add_latent_entropy(void)