lkml.org 
[lkml]   [2015]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch v4 21/23] x86/PCI: Refine the way to release PCI IRQ resources
From
Date
On Wed, 2015-03-04 at 09:06 -0700, Alex Williamson wrote:
> Hi,
>
> I'm getting a regression from this patch when using VFIO for device
> assignment to a QEMU VM. I have a device initially bound to the nouveau
> driver, which is unbound from that driver and bound to vfio-pci for use
> by userspace. vfio-pci calls pci_enable_device, but when userspace
> attempts to setup the legacy INTx interrupt, pci_dev->irq is zero and
> vfio-pci errors with -ENODEV.
>
> Where is pci_dev->irq supposed to be getting re-initialized in this
> case? Am I missing an important initialization step in vfio-pci? I
> certainly don't think I should be calling request_irq(pci_dev->irq, ...
> when pci_dev->irq is zero. Thanks,

It looks like the imbalance is in pci_dev->enable_cnt. Any call to
pci_disable_device() will clear pci_dev->irq, but pci_enable_device()
does effectively nothing unless it's called with enable_cnt == zero. So
I'm at the mercy of the previous driver behaving relatively sanely in
order to re-enable legacy interrupts for a device :-\ Maybe the unbound
notifier needs to do some sanitizing of the device? Thanks,

Alex



\
 
 \ /
  Last update: 2015-03-05 01:01    [W:0.086 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site