Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfio-v4.1-rc3' of git://github.com/awilliam/linux-vfio

Pull vfio fixes from Alex Williamson:
"Fix some undesirable behavior with the vfio device request interface:

- increase verbosity of device request channel (Alex Williamson)

- fix runaway interruptible timeout (Alex Williamson)"

* tag 'vfio-v4.1-rc3' of git://github.com/awilliam/linux-vfio:
vfio: Fix runaway interruptible timeout
vfio-pci: Log device requests more verbosely

+25 -4
+7 -1
drivers/vfio/pci/vfio_pci.c
··· 907 907 mutex_lock(&vdev->igate); 908 908 909 909 if (vdev->req_trigger) { 910 - dev_dbg(&vdev->pdev->dev, "Requesting device from user\n"); 910 + if (!(count % 10)) 911 + dev_notice_ratelimited(&vdev->pdev->dev, 912 + "Relaying device request to user (#%u)\n", 913 + count); 911 914 eventfd_signal(vdev->req_trigger, 1); 915 + } else if (count == 0) { 916 + dev_warn(&vdev->pdev->dev, 917 + "No device request channel registered, blocked until released by user\n"); 912 918 } 913 919 914 920 mutex_unlock(&vdev->igate);
+18 -3
drivers/vfio/vfio.c
··· 710 710 void *device_data = device->device_data; 711 711 struct vfio_unbound_dev *unbound; 712 712 unsigned int i = 0; 713 + long ret; 714 + bool interrupted = false; 713 715 714 716 /* 715 717 * The group exists so long as we have a device reference. Get ··· 757 755 758 756 vfio_device_put(device); 759 757 760 - } while (wait_event_interruptible_timeout(vfio.release_q, 761 - !vfio_dev_present(group, dev), 762 - HZ * 10) <= 0); 758 + if (interrupted) { 759 + ret = wait_event_timeout(vfio.release_q, 760 + !vfio_dev_present(group, dev), HZ * 10); 761 + } else { 762 + ret = wait_event_interruptible_timeout(vfio.release_q, 763 + !vfio_dev_present(group, dev), HZ * 10); 764 + if (ret == -ERESTARTSYS) { 765 + interrupted = true; 766 + dev_warn(dev, 767 + "Device is currently in use, task" 768 + " \"%s\" (%d) " 769 + "blocked until device is released", 770 + current->comm, task_pid_nr(current)); 771 + } 772 + } 773 + } while (ret <= 0); 763 774 764 775 vfio_group_put(group); 765 776