aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptbase.c88
1 files changed, 50 insertions, 38 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index a30084076ac..164375eea89 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1386,39 +1386,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1386 /* Set lookup ptr. */ 1386 /* Set lookup ptr. */
1387 list_add_tail(&ioc->list, &ioc_list); 1387 list_add_tail(&ioc->list, &ioc_list);
1388 1388
1389 ioc->pci_irq = -1;
1390 if (pdev->irq) {
1391 if (mpt_msi_enable && !pci_enable_msi(pdev))
1392 printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", ioc->name);
1393
1394 r = request_irq(pdev->irq, mpt_interrupt, SA_SHIRQ, ioc->name, ioc);
1395
1396 if (r < 0) {
1397#ifndef __sparc__
1398 printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %d!\n",
1399 ioc->name, pdev->irq);
1400#else
1401 printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %s!\n",
1402 ioc->name, __irq_itoa(pdev->irq));
1403#endif
1404 list_del(&ioc->list);
1405 iounmap(mem);
1406 kfree(ioc);
1407 return -EBUSY;
1408 }
1409
1410 ioc->pci_irq = pdev->irq;
1411
1412 pci_set_master(pdev); /* ?? */
1413 pci_set_drvdata(pdev, ioc);
1414
1415#ifndef __sparc__
1416 dprintk((KERN_INFO MYNAM ": %s installed at interrupt %d\n", ioc->name, pdev->irq));
1417#else
1418 dprintk((KERN_INFO MYNAM ": %s installed at interrupt %s\n", ioc->name, __irq_itoa(pdev->irq)));
1419#endif
1420 }
1421
1422 /* Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets. 1389 /* Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
1423 */ 1390 */
1424 mpt_detect_bound_ports(ioc, pdev); 1391 mpt_detect_bound_ports(ioc, pdev);
@@ -1428,11 +1395,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1428 printk(KERN_WARNING MYNAM 1395 printk(KERN_WARNING MYNAM
1429 ": WARNING - %s did not initialize properly! (%d)\n", 1396 ": WARNING - %s did not initialize properly! (%d)\n",
1430 ioc->name, r); 1397 ioc->name, r);
1431
1432 list_del(&ioc->list); 1398 list_del(&ioc->list);
1433 free_irq(ioc->pci_irq, ioc);
1434 if (mpt_msi_enable)
1435 pci_disable_msi(pdev);
1436 if (ioc->alt_ioc) 1399 if (ioc->alt_ioc)
1437 ioc->alt_ioc->alt_ioc = NULL; 1400 ioc->alt_ioc->alt_ioc = NULL;
1438 iounmap(mem); 1401 iounmap(mem);
@@ -1651,6 +1614,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1651 int handlers; 1614 int handlers;
1652 int ret = 0; 1615 int ret = 0;
1653 int reset_alt_ioc_active = 0; 1616 int reset_alt_ioc_active = 0;
1617 int irq_allocated = 0;
1654 1618
1655 printk(KERN_INFO MYNAM ": Initiating %s %s\n", 1619 printk(KERN_INFO MYNAM ": Initiating %s %s\n",
1656 ioc->name, reason==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery"); 1620 ioc->name, reason==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery");
@@ -1734,6 +1698,48 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1734 } 1698 }
1735 } 1699 }
1736 1700
1701 /*
1702 * Device is reset now. It must have de-asserted the interrupt line
1703 * (if it was asserted) and it should be safe to register for the
1704 * interrupt now.
1705 */
1706 if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) {
1707 ioc->pci_irq = -1;
1708 if (ioc->pcidev->irq) {
1709 if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev))
1710 printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
1711 ioc->name);
1712 rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
1713 SA_SHIRQ, ioc->name, ioc);
1714 if (rc < 0) {
1715#ifndef __sparc__
1716 printk(MYIOC_s_ERR_FMT "Unable to allocate "
1717 "interrupt %d!\n", ioc->name,
1718 ioc->pcidev->irq);
1719#else
1720 printk(MYIOC_s_ERR_FMT "Unable to allocate "
1721 "interrupt %s!\n", ioc->name,
1722 __irq_itoa(ioc->pcidev->irq));
1723#endif
1724 if (mpt_msi_enable)
1725 pci_disable_msi(ioc->pcidev);
1726 return -EBUSY;
1727 }
1728 irq_allocated = 1;
1729 ioc->pci_irq = ioc->pcidev->irq;
1730 pci_set_master(ioc->pcidev); /* ?? */
1731 pci_set_drvdata(ioc->pcidev, ioc);
1732#ifndef __sparc__
1733 dprintk((KERN_INFO MYNAM ": %s installed at interrupt "
1734 "%d\n", ioc->name, ioc->pcidev->irq));
1735#else
1736 dprintk((KERN_INFO MYNAM ": %s installed at interrupt "
1737 "%s\n", ioc->name,
1738 __irq_itoa(ioc->pcidev->irq)));
1739#endif
1740 }
1741 }
1742
1737 /* Prime reply & request queues! 1743 /* Prime reply & request queues!
1738 * (mucho alloc's) Must be done prior to 1744 * (mucho alloc's) Must be done prior to
1739 * init as upper addresses are needed for init. 1745 * init as upper addresses are needed for init.
@@ -1833,7 +1839,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1833 ret = mptbase_sas_persist_operation(ioc, 1839 ret = mptbase_sas_persist_operation(ioc,
1834 MPI_SAS_OP_CLEAR_NOT_PRESENT); 1840 MPI_SAS_OP_CLEAR_NOT_PRESENT);
1835 if(ret != 0) 1841 if(ret != 0)
1836 return -1; 1842 goto out;
1837 } 1843 }
1838 1844
1839 /* Find IM volumes 1845 /* Find IM volumes
@@ -1914,6 +1920,12 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1914 /* FIXME? Examine results here? */ 1920 /* FIXME? Examine results here? */
1915 } 1921 }
1916 1922
1923out:
1924 if ((ret != 0) && irq_allocated) {
1925 free_irq(ioc->pci_irq, ioc);
1926 if (mpt_msi_enable)
1927 pci_disable_msi(ioc->pcidev);
1928 }
1917 return ret; 1929 return ret;
1918} 1930}
1919 1931