]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwrng: virtio - always add a pending request
authorLaurent Vivier <lvivier@redhat.com>
Thu, 28 Oct 2021 10:11:11 +0000 (12:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:37:17 +0000 (08:37 +0200)
commitb70315e44f03fe271a871ba87ae7083e042c5e15
treef37b19e3305a0184943c4f219f1e8ed3feafddeb
parent102a354d52ca46cbe1497ff8349752ca59e3458c
hwrng: virtio - always add a pending request

[ Upstream commit 9a4b612d675b03f7fc9fa1957ca399c8223f3954 ]

If we ensure we have already some data available by enqueuing
again the buffer once data are exhausted, we can return what we
have without waiting for the device answer.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Link: https://lore.kernel.org/r/20211028101111.128049-5-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