vfio: Fix runaway interruptible timeout
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 1 May 2015 22:31:41 +0000 (16:31 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 May 2015 16:55:07 +0000 (09:55 -0700)
commit30026d29b7a7c82846210f61a514513a2a2aeced
treedf1da778de9c0f054f69e8a51751f4f03f80a879
parent6eff668b18aa465bd4096bcae801364403308ae1
vfio: Fix runaway interruptible timeout

commit db7d4d7f40215843000cb9d441c9149fd42ea36b upstream.

Commit 13060b64b819 ("vfio: Add and use device request op for vfio
bus drivers") incorrectly makes use of an interruptible timeout.
When interrupted, the signal remains pending resulting in subsequent
timeouts occurring instantly.  This makes the loop spin at a much
higher rate than intended.

Instead of making this completely non-interruptible, we can change
this into a sort of interruptible-once behavior and use the "once"
to log debug information.  The driver API doesn't allow us to abort
and return an error code.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Fixes: 13060b64b819
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vfio/vfio.c