Commit a5ac1f5d authored by Luo Jiaxing's avatar Luo Jiaxing Committed by Martin K. Petersen
Browse files

scsi: hisi_sas: Consolidate internal abort calls in LU reset operation



In hisi_sas_lu_reset(), we call internal abort for SAS and SATA device
codepaths -> consolidate into a single call.

Signed-off-by: default avatarLuo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e7513f66
Loading
Loading
Loading
Loading
+9 −17
Original line number Diff line number Diff line
@@ -1829,10 +1829,7 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)
	struct device *dev = hisi_hba->dev;
	int rc = TMF_RESP_FUNC_FAILED;

	if (dev_is_sata(device)) {
		struct sas_phy *phy;

		/* Clear internal IO and then hardreset */
	/* Clear internal IO and then lu reset */
	rc = hisi_sas_internal_task_abort(hisi_hba, device,
					  HISI_SAS_INT_ABT_DEV, 0);
	if (rc < 0) {
@@ -1841,6 +1838,9 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)
	}
	hisi_sas_dereg_device(hisi_hba, device);

	if (dev_is_sata(device)) {
		struct sas_phy *phy;

		phy = sas_get_local_phy(device);

		rc = sas_phy_reset(phy, 1);
@@ -1851,14 +1851,6 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)
	} else {
		struct hisi_sas_tmf_task tmf_task = { .tmf =  TMF_LU_RESET };

		rc = hisi_sas_internal_task_abort(hisi_hba, device,
						  HISI_SAS_INT_ABT_DEV, 0);
		if (rc < 0) {
			dev_err(dev, "lu_reset: internal abort failed\n");
			goto out;
		}
		hisi_sas_dereg_device(hisi_hba, device);

		rc = hisi_sas_debug_issue_ssp_tmf(device, lun, &tmf_task);
		if (rc == TMF_RESP_FUNC_COMPLETE)
			hisi_sas_release_task(hisi_hba, device);