]> git.baikalelectronics.ru Git - kernel.git/commit
hwrng: core - move add_early_randomness() out of rng_mutex
authorLaurent Vivier <lvivier@redhat.com>
Thu, 12 Sep 2019 13:30:22 +0000 (15:30 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Oct 2019 12:36:31 +0000 (23:36 +1100)
commit74f6bc58df8d2eca7bcebec80a879dbd47761f88
tree75eb8010d01d55bfe0b67aa4688cbcba7e613f39
parent637b1437a7b96242e596415785851ff00736cfcc
hwrng: core - move add_early_randomness() out of rng_mutex

add_early_randomness() is called every time a new rng backend is added
and every time it is set as the current rng provider.

add_early_randomness() is called from functions locking rng_mutex,
and if it hangs all the hw_random framework hangs: we can't read sysfs,
add or remove a backend.

This patch move add_early_randomness() out of the rng_mutex zone.
It only needs the reading_mutex.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c