[SCSI] mpt2sas: Early return from function if shost is in recovery.
authorKashyap, Desai <kashyap.desai@lsi.com>
Wed, 17 Mar 2010 10:53:36 +0000 (16:23 +0530)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 11 Apr 2010 14:23:57 +0000 (09:23 -0500)
Aded checks for shost_recovery flag for early return from function.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c

index 9ad4b48a9b621cc8dd243bd9d860090a8dfd168d..b7b6285a3061aa596548c74dddab918f028e4580 100644 (file)
@@ -3521,7 +3521,9 @@ mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc)
            __func__));
 
        _base_mask_interrupts(ioc);
+       ioc->shost_recovery = 1;
        _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET);
+       ioc->shost_recovery = 0;
        if (ioc->pci_irq) {
                synchronize_irq(pdev->irq);
                free_irq(ioc->pci_irq, ioc);
index f3ce9b1825b17002164b9318ad80d236b6fd9141..61199759f8d11b2c7559ab8d29abe39b46100c05 100644 (file)
@@ -1979,7 +1979,7 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun,
                return;
        }
 
-       if (ioc->shost_recovery) {
+       if (ioc->shost_recovery || ioc->remove_host) {
                printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n",
                    __func__, ioc->name);
                return;
@@ -4246,7 +4246,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
                _scsih_sas_topology_change_event_debug(ioc, event_data);
 #endif
 
-       if (ioc->shost_recovery)
+       if (ioc->shost_recovery || ioc->remove_host)
                return;
 
        if (!ioc->sas_hba.num_phys)
@@ -4285,7 +4285,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
                            "expander event\n", ioc->name));
                        return;
                }
-               if (ioc->shost_recovery)
+               if (ioc->shost_recovery || ioc->remove_host)
                        return;
                phy_number = event_data->StartPhyNum + i;
                reason_code = event_data->PHY[i].PhyStatus &