Commit 277d72a3 authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik

libata-sff: PCI IRQ handling fix

It is legitimate (although annoying and silly) for a PCI IDE controller
not to be assigned an interrupt and to be polled. The libata-sff code
should therefore not try and request IRQ 0 in this case.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent b14dabcd
...@@ -806,7 +806,10 @@ int ata_pci_init_one(struct pci_dev *pdev, ...@@ -806,7 +806,10 @@ int ata_pci_init_one(struct pci_dev *pdev,
if (rc) if (rc)
goto err_out; goto err_out;
if (!legacy_mode) { if (!legacy_mode && pdev->irq) {
/* We may have no IRQ assigned in which case we can poll. This
shouldn't happen on a sane system but robustness is cheap
in this case */
rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler, rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler,
IRQF_SHARED, DRV_NAME, host); IRQF_SHARED, DRV_NAME, host);
if (rc) if (rc)
...@@ -814,7 +817,7 @@ int ata_pci_init_one(struct pci_dev *pdev, ...@@ -814,7 +817,7 @@ int ata_pci_init_one(struct pci_dev *pdev,
ata_port_desc(host->ports[0], "irq %d", pdev->irq); ata_port_desc(host->ports[0], "irq %d", pdev->irq);
ata_port_desc(host->ports[1], "irq %d", pdev->irq); ata_port_desc(host->ports[1], "irq %d", pdev->irq);
} else { } else if (legacy_mode) {
if (!ata_port_is_dummy(host->ports[0])) { if (!ata_port_is_dummy(host->ports[0])) {
rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev), rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev),
pi->port_ops->irq_handler, pi->port_ops->irq_handler,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment