projects
/
users
/
dwmw2
/
linux.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c18bb2b
)
vfio/virqfd: Drain events from eventfd in virqfd_wakeup()
author
David Woodhouse <dwmw@amazon.co.uk>
Tue, 27 Oct 2020 13:42:29 +0000
(13:42 +0000)
committer
David Woodhouse <dwmw@amazon.co.uk>
Wed, 28 Oct 2020 15:32:49 +0000
(15:32 +0000)
Don't allow the events to accumulate in the eventfd counter, drain them
as they are handled.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
drivers/vfio/virqfd.c
patch
|
blob
|
history
diff --git
a/drivers/vfio/virqfd.c
b/drivers/vfio/virqfd.c
index 997cb5d0a657cb1cb795ca609704f886c7ffc276..414e98d82b02e561d5423910d0cb572b7c4ea7d3 100644
(file)
--- a/
drivers/vfio/virqfd.c
+++ b/
drivers/vfio/virqfd.c
@@
-46,6
+46,9
@@
static int virqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void
__poll_t flags = key_to_poll(key);
if (flags & EPOLLIN) {
+ u64 cnt;
+ eventfd_ctx_do_read(virqfd->eventfd, &cnt);
+
/* An event has been signaled, call function */
if ((!virqfd->handler ||
virqfd->handler(virqfd->opaque, virqfd->data)) &&