提交 acec09e6 编写于 作者: J Jim Harris 提交者: Greg Kroah-Hartman

uio/uio_pci_generic: don't fail probe if pdev->irq == NULL

Some userspace drivers and frameworks only poll and do not
require interrupts to be available and enabled on the
PCI device.  So remove the requirement that an IRQ is
assigned.  If an IRQ is not assigned and a userspace
driver tries to read()/write(), the generic uio
framework will just return -EIO.

This allows binding uio_pci_generic to devices which
cannot get an IRQ assigned, such as an NVMe controller
behind Intel Volume Management Device (VMD), since VMD
does not support INTx interrupts.
Signed-off-by: NJim Harris <james.r.harris@intel.com>
Acked-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 98e959d4
...@@ -66,14 +66,7 @@ static int probe(struct pci_dev *pdev, ...@@ -66,14 +66,7 @@ static int probe(struct pci_dev *pdev,
return err; return err;
} }
if (!pdev->irq) { if (pdev->irq && !pci_intx_mask_supported(pdev)) {
dev_warn(&pdev->dev, "No IRQ assigned to device: "
"no support for interrupts?\n");
pci_disable_device(pdev);
return -ENODEV;
}
if (!pci_intx_mask_supported(pdev)) {
err = -ENODEV; err = -ENODEV;
goto err_verify; goto err_verify;
} }
...@@ -86,10 +79,15 @@ static int probe(struct pci_dev *pdev, ...@@ -86,10 +79,15 @@ static int probe(struct pci_dev *pdev,
gdev->info.name = "uio_pci_generic"; gdev->info.name = "uio_pci_generic";
gdev->info.version = DRIVER_VERSION; gdev->info.version = DRIVER_VERSION;
gdev->info.irq = pdev->irq;
gdev->info.irq_flags = IRQF_SHARED;
gdev->info.handler = irqhandler;
gdev->pdev = pdev; gdev->pdev = pdev;
if (pdev->irq) {
gdev->info.irq = pdev->irq;
gdev->info.irq_flags = IRQF_SHARED;
gdev->info.handler = irqhandler;
} else {
dev_warn(&pdev->dev, "No IRQ assigned to device: "
"no support for interrupts?\n");
}
err = uio_register_device(&pdev->dev, &gdev->info); err = uio_register_device(&pdev->dev, &gdev->info);
if (err) if (err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册