Commit 28661c88 authored by Shivasharan S's avatar Shivasharan S Committed by Martin K. Petersen

scsi: megaraid_sas: Use SMID for Task abort case only

In TM code, smid_task is valid only in case of task aborts.
Signed-off-by: default avatarKashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: default avatarShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 91b3d9f0
...@@ -3760,7 +3760,7 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle, ...@@ -3760,7 +3760,7 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
struct megasas_cmd_fusion *cmd_fusion; struct megasas_cmd_fusion *cmd_fusion;
struct megasas_cmd *cmd_mfi; struct megasas_cmd *cmd_mfi;
union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc; union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc;
struct fusion_context *fusion; struct fusion_context *fusion = NULL;
struct megasas_cmd_fusion *scsi_lookup; struct megasas_cmd_fusion *scsi_lookup;
int rc; int rc;
struct MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply; struct MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply;
...@@ -3787,8 +3787,6 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle, ...@@ -3787,8 +3787,6 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
cmd_fusion->request_desc = req_desc; cmd_fusion->request_desc = req_desc;
req_desc->Words = 0; req_desc->Words = 0;
scsi_lookup = fusion->cmd_list[smid_task - 1];
mr_request = (struct MR_TASK_MANAGE_REQUEST *) cmd_fusion->io_request; mr_request = (struct MR_TASK_MANAGE_REQUEST *) cmd_fusion->io_request;
memset(mr_request, 0, sizeof(struct MR_TASK_MANAGE_REQUEST)); memset(mr_request, 0, sizeof(struct MR_TASK_MANAGE_REQUEST));
mpi_request = (struct MPI2_SCSI_TASK_MANAGE_REQUEST *) &mr_request->TmRequest; mpi_request = (struct MPI2_SCSI_TASK_MANAGE_REQUEST *) &mr_request->TmRequest;
...@@ -3835,6 +3833,8 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle, ...@@ -3835,6 +3833,8 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
rc = SUCCESS; rc = SUCCESS;
switch (type) { switch (type) {
case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK: case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK:
scsi_lookup = fusion->cmd_list[smid_task - 1];
if (scsi_lookup->scmd == NULL) if (scsi_lookup->scmd == NULL)
break; break;
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment