scsi: hisi_sas: free slots after hardreset
authorXiang Chen <chenxiang66@hisilicon.com>
Wed, 22 Mar 2017 17:25:28 +0000 (01:25 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 23 Mar 2017 15:12:02 +0000 (11:12 -0400)
After hardreset, we clear up IOs of remote disks, so we need to free
those slots in LLDD.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 19f28927e768cfe74c4f81b4bbd007daccd522b0..49cac22a83bdb3f1e22d90609f1b4cdbba50c4a6 100644 (file)
@@ -1028,11 +1028,12 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
 
        rc = hisi_sas_debug_I_T_nexus_reset(device);
 
-       spin_lock_irqsave(&hisi_hba->lock, flags);
-       hisi_sas_release_task(hisi_hba, device);
-       spin_unlock_irqrestore(&hisi_hba->lock, flags);
-
-       return 0;
+       if (rc == TMF_RESP_FUNC_COMPLETE) {
+               spin_lock_irqsave(&hisi_hba->lock, flags);
+               hisi_sas_release_task(hisi_hba, device);
+               spin_unlock_irqrestore(&hisi_hba->lock, flags);
+       }
+       return rc;
 }
 
 static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)