]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwrng: virtio - don't wait on cleanup
authorLaurent Vivier <lvivier@redhat.com>
Thu, 28 Oct 2021 10:11:09 +0000 (12:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:37:17 +0000 (08:37 +0200)
commitf2a7dfd35f0c925f6b3963d7823369e4122855f3
treeae978a388671d0c6af8b89053ddae09b259baed3
parent6fe732764a58d3729bd22dde789f11bf3a645be6
hwrng: virtio - don't wait on cleanup

[ Upstream commit 2bb31abdbe55742c89f4dc0cc26fcbc8467364f6 ]

When virtio-rng device was dropped by the hwrng core we were forced
to wait the buffer to come back from the device to not have
remaining ongoing operation that could spoil the buffer.

But now, as the buffer is internal to the virtio-rng we can release
the waiting loop immediately, the buffer will be retrieve and use
when the virtio-rng driver will be selected again.

This avoids to hang on an rng_current write command if the virtio-rng
device is blocked by a lack of entropy. This allows to select
another entropy source if the current one is empty.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Link: https://lore.kernel.org/r/20211028101111.128049-3-lvivier@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Stable-dep-of: ac52578d6e8d ("hwrng: virtio - Fix race on data_avail and actual data")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/hw_random/virtio-rng.c