diff options
| author | Jason A. Donenfeld <[email protected]> | 2022-11-06 16:02:43 +0100 |
|---|---|---|
| committer | Jason A. Donenfeld <[email protected]> | 2022-11-18 02:18:10 +0100 |
| commit | db516da95ce458f0cab5e7ae2db93fd821484d7d (patch) | |
| tree | 7025999d032360dfcd0f5dc4c772f5206dff0fd0 /include/linux | |
| parent | 19258d05b619d26622bdcfa11eca1f457b69e4da (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 <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Dominik Brodowski <[email protected]>
Acked-by: Herbert Xu <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/random.h | 2 |
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) |