Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9961c9bb authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen
Browse files

scsi: mpt3sas: check command status before attempting abort



When attempting a command abort we should check the command status prior
to sending the abort; the command might've been completed already.

Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 12e7c678
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -2771,6 +2771,14 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel,
		return (!rc) ? SUCCESS : FAILED;
		return (!rc) ? SUCCESS : FAILED;
	}
	}


	if (type == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) {
		scsi_lookup = mpt3sas_get_st_from_smid(ioc, smid_task);
		if (!scsi_lookup)
			return FAILED;
		if (scsi_lookup->cb_idx == 0xFF)
			return SUCCESS;
	}

	smid = mpt3sas_base_get_smid_hpr(ioc, ioc->tm_cb_idx);
	smid = mpt3sas_base_get_smid_hpr(ioc, ioc->tm_cb_idx);
	if (!smid) {
	if (!smid) {
		pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n",
		pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n",
@@ -2778,9 +2786,6 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel,
		return FAILED;
		return FAILED;
	}
	}


	if (type == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK)
		scsi_lookup = mpt3sas_get_st_from_smid(ioc, smid_task);

	dtmprintk(ioc, pr_info(MPT3SAS_FMT
	dtmprintk(ioc, pr_info(MPT3SAS_FMT
		"sending tm: handle(0x%04x), task_type(0x%02x), smid(%d)\n",
		"sending tm: handle(0x%04x), task_type(0x%02x), smid(%d)\n",
		ioc->name, handle, type, smid_task));
		ioc->name, handle, type, smid_task));