diff options
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 1d5c6fbbfaae..f80b702730ad 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -749,12 +749,6 @@ static void qla4xxx_timer(struct scsi_qla_host *ha) | |||
749 | if (!pci_channel_offline(ha->pdev)) | 749 | if (!pci_channel_offline(ha->pdev)) |
750 | pci_read_config_word(ha->pdev, PCI_VENDOR_ID, &w); | 750 | pci_read_config_word(ha->pdev, PCI_VENDOR_ID, &w); |
751 | 751 | ||
752 | if (test_bit(AF_HBA_GOING_AWAY, &ha->flags)) { | ||
753 | DEBUG2(ql4_printk(KERN_INFO, ha, "%s exited. HBA GOING AWAY\n", | ||
754 | __func__)); | ||
755 | return; | ||
756 | } | ||
757 | |||
758 | if (is_qla8022(ha)) { | 752 | if (is_qla8022(ha)) { |
759 | qla4_8xxx_watchdog(ha); | 753 | qla4_8xxx_watchdog(ha); |
760 | } | 754 | } |
@@ -1063,7 +1057,6 @@ void qla4xxx_dead_adapter_cleanup(struct scsi_qla_host *ha) | |||
1063 | 1057 | ||
1064 | /* Disable the board */ | 1058 | /* Disable the board */ |
1065 | ql4_printk(KERN_INFO, ha, "Disabling the board\n"); | 1059 | ql4_printk(KERN_INFO, ha, "Disabling the board\n"); |
1066 | set_bit(AF_HBA_GOING_AWAY, &ha->flags); | ||
1067 | 1060 | ||
1068 | qla4xxx_abort_active_cmds(ha, DID_NO_CONNECT << 16); | 1061 | qla4xxx_abort_active_cmds(ha, DID_NO_CONNECT << 16); |
1069 | qla4xxx_mark_all_devices_missing(ha); | 1062 | qla4xxx_mark_all_devices_missing(ha); |
@@ -1255,11 +1248,6 @@ static void qla4xxx_do_dpc(struct work_struct *work) | |||
1255 | goto do_dpc_exit; | 1248 | goto do_dpc_exit; |
1256 | } | 1249 | } |
1257 | 1250 | ||
1258 | /* HBA is in the process of being permanently disabled. | ||
1259 | * Don't process anything */ | ||
1260 | if (test_bit(AF_HBA_GOING_AWAY, &ha->flags)) | ||
1261 | return; | ||
1262 | |||
1263 | if (is_qla8022(ha)) { | 1251 | if (is_qla8022(ha)) { |
1264 | if (test_bit(DPC_HA_UNRECOVERABLE, &ha->dpc_flags)) { | 1252 | if (test_bit(DPC_HA_UNRECOVERABLE, &ha->dpc_flags)) { |
1265 | qla4_8xxx_idc_lock(ha); | 1253 | qla4_8xxx_idc_lock(ha); |
@@ -1824,6 +1812,44 @@ probe_disable_device: | |||
1824 | } | 1812 | } |
1825 | 1813 | ||
1826 | /** | 1814 | /** |
1815 | * qla4xxx_prevent_other_port_reinit - prevent other port from re-initialize | ||
1816 | * @ha: pointer to adapter structure | ||
1817 | * | ||
1818 | * Mark the other ISP-4xxx port to indicate that the driver is being removed, | ||
1819 | * so that the other port will not re-initialize while in the process of | ||
1820 | * removing the ha due to driver unload or hba hotplug. | ||
1821 | **/ | ||
1822 | static void qla4xxx_prevent_other_port_reinit(struct scsi_qla_host *ha) | ||
1823 | { | ||
1824 | struct scsi_qla_host *other_ha = NULL; | ||
1825 | struct pci_dev *other_pdev = NULL; | ||
1826 | int fn = ISP4XXX_PCI_FN_2; | ||
1827 | |||
1828 | /*iscsi function numbers for ISP4xxx is 1 and 3*/ | ||
1829 | if (PCI_FUNC(ha->pdev->devfn) & BIT_1) | ||
1830 | fn = ISP4XXX_PCI_FN_1; | ||
1831 | |||
1832 | other_pdev = | ||
1833 | pci_get_domain_bus_and_slot(pci_domain_nr(ha->pdev->bus), | ||
1834 | ha->pdev->bus->number, PCI_DEVFN(PCI_SLOT(ha->pdev->devfn), | ||
1835 | fn)); | ||
1836 | |||
1837 | /* Get other_ha if other_pdev is valid and state is enable*/ | ||
1838 | if (other_pdev) { | ||
1839 | if (atomic_read(&other_pdev->enable_cnt)) { | ||
1840 | other_ha = pci_get_drvdata(other_pdev); | ||
1841 | if (other_ha) { | ||
1842 | set_bit(AF_HA_REMOVAL, &other_ha->flags); | ||
1843 | DEBUG2(ql4_printk(KERN_INFO, ha, "%s: " | ||
1844 | "Prevent %s reinit\n", __func__, | ||
1845 | dev_name(&other_ha->pdev->dev))); | ||
1846 | } | ||
1847 | } | ||
1848 | pci_dev_put(other_pdev); | ||
1849 | } | ||
1850 | } | ||
1851 | |||
1852 | /** | ||
1827 | * qla4xxx_remove_adapter - calback function to remove adapter. | 1853 | * qla4xxx_remove_adapter - calback function to remove adapter. |
1828 | * @pci_dev: PCI device pointer | 1854 | * @pci_dev: PCI device pointer |
1829 | **/ | 1855 | **/ |
@@ -1833,7 +1859,8 @@ static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev) | |||
1833 | 1859 | ||
1834 | ha = pci_get_drvdata(pdev); | 1860 | ha = pci_get_drvdata(pdev); |
1835 | 1861 | ||
1836 | set_bit(AF_HBA_GOING_AWAY, &ha->flags); | 1862 | if (!is_qla8022(ha)) |
1863 | qla4xxx_prevent_other_port_reinit(ha); | ||
1837 | 1864 | ||
1838 | /* remove devs from iscsi_sessions to scsi_devices */ | 1865 | /* remove devs from iscsi_sessions to scsi_devices */ |
1839 | qla4xxx_free_ddb_list(ha); | 1866 | qla4xxx_free_ddb_list(ha); |