提交 4031826b 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

libata: fix assigned IRQ reporting

host->irq and host->irq2 should be set before ata_host_register() for
IRQ reporting to work.  Move up host->irq assignment in
ata_host_activate() and add it to ata_pci_init_one() native path and
pata_cs5520.

The port info printing in ata_host_register() doesn't fit all the
different controllers.  It should probably be moved out to LLDs with
some helpers in the future.
Signed-off-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 aa2e09da
...@@ -6423,14 +6423,14 @@ int ata_host_activate(struct ata_host *host, int irq, ...@@ -6423,14 +6423,14 @@ int ata_host_activate(struct ata_host *host, int irq,
if (rc) if (rc)
return rc; return rc;
/* Used to print device info at probe */
host->irq = irq;
rc = ata_host_register(host, sht); rc = ata_host_register(host, sht);
/* if failed, just free the IRQ and leave ports alone */ /* if failed, just free the IRQ and leave ports alone */
if (rc) if (rc)
devm_free_irq(host->dev, irq, host); devm_free_irq(host->dev, irq, host);
/* Used to print device info at probe */
host->irq = irq;
return rc; return rc;
} }
......
...@@ -1065,10 +1065,11 @@ int ata_pci_init_one(struct pci_dev *pdev, ...@@ -1065,10 +1065,11 @@ 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) {
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);
else { host->irq = pdev->irq;
} else {
irq_handler_t handler[2] = { host->ops->irq_handler, irq_handler_t handler[2] = { host->ops->irq_handler,
host->ops->irq_handler }; host->ops->irq_handler };
unsigned int irq_flags[2] = { IRQF_SHARED, IRQF_SHARED }; unsigned int irq_flags[2] = { IRQF_SHARED, IRQF_SHARED };
......
...@@ -284,6 +284,11 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi ...@@ -284,6 +284,11 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
ata_interrupt, 0, DRV_NAME, host); ata_interrupt, 0, DRV_NAME, host);
if (rc) if (rc)
return rc; return rc;
if (i == 0)
host->irq = irq[0];
else
host->irq2 = irq[1];
} }
return ata_host_register(host, &cs5520_sht); return ata_host_register(host, &cs5520_sht);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册