diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-05-18 08:23:37 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-05-18 08:23:37 +0200 |
commit | 5a6cc82171dba297ceab49cda47f2bf5616f87b3 (patch) | |
tree | 1e12036476a4faf4b404a0a4e070d148efafc221 /drivers/vfio/vfio.c | |
parent | 09ea997677cd44ebe7f42573119aaf46b775c683 (diff) | |
parent | 7730c0b55043f6ff1c27e9cb45e13679995b2361 (diff) | |
download | linux-5a6cc82171dba297ceab49cda47f2bf5616f87b3.tar.gz linux-5a6cc82171dba297ceab49cda47f2bf5616f87b3.tar.bz2 linux-5a6cc82171dba297ceab49cda47f2bf5616f87b3.zip |
Merge tag 'asoc-fix-v4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.1
A few more fixes for v4.1, some driver fixes plus one core fix which
fixes registration of DAI links when adding prefixes to CODECs to
deuplicate in multi-CODEC systems.
Diffstat (limited to 'drivers/vfio/vfio.c')
-rw-r--r-- | drivers/vfio/vfio.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 0d336625ac71..e1278fe04b1e 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -710,6 +710,8 @@ void *vfio_del_group_dev(struct device *dev) void *device_data = device->device_data; struct vfio_unbound_dev *unbound; unsigned int i = 0; + long ret; + bool interrupted = false; /* * The group exists so long as we have a device reference. Get @@ -755,9 +757,22 @@ void *vfio_del_group_dev(struct device *dev) vfio_device_put(device); - } while (wait_event_interruptible_timeout(vfio.release_q, - !vfio_dev_present(group, dev), - HZ * 10) <= 0); + if (interrupted) { + ret = wait_event_timeout(vfio.release_q, + !vfio_dev_present(group, dev), HZ * 10); + } else { + ret = wait_event_interruptible_timeout(vfio.release_q, + !vfio_dev_present(group, dev), HZ * 10); + if (ret == -ERESTARTSYS) { + interrupted = true; + dev_warn(dev, + "Device is currently in use, task" + " \"%s\" (%d) " + "blocked until device is released", + current->comm, task_pid_nr(current)); + } + } + } while (ret <= 0); vfio_group_put(group); |