aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_ctl.c
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-03-17 06:55:59 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:24:00 -0400
commit8ed9a03ad4c1b6c5ae163e5e9f140852be0273a1 (patch)
tree67b6a1e7f59ad5eab7fd75ae025c845544d8b360 /drivers/scsi/mpt2sas/mpt2sas_ctl.c
parente94f67472106e5a0e97c79090211c551e69e889b (diff)
[SCSI] mpt2sas: removed use of tm_cmds.mutex in IOCTL branch.
Removed all the mutex's for ioc->tm_cmds.mutex, then created one single mutex inside the function mpt2sas_scsih_issue_tm. This is the single function used when sending task management. Also the sanity checks required for scsi mid layer escalation were moved to inside the same function because these checks need to be done while the mutex is held. The ioc->tm_cmds.mutex inside the IOCTL branch is really not required since there is another mutex in this code called for ctl_cmds handling this sync. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_ctl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index ae55a912baf4..9860e7edd442 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -753,6 +753,10 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc,
753 Mpi2SCSITaskManagementRequest_t *tm_request = 753 Mpi2SCSITaskManagementRequest_t *tm_request =
754 (Mpi2SCSITaskManagementRequest_t *)mpi_request; 754 (Mpi2SCSITaskManagementRequest_t *)mpi_request;
755 755
756 dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "TASK_MGMT: "
757 "handle(0x%04x), task_type(0x%02x)\n", ioc->name,
758 le16_to_cpu(tm_request->DevHandle), tm_request->TaskType));
759
756 if (tm_request->TaskType == 760 if (tm_request->TaskType ==
757 MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK || 761 MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK ||
758 tm_request->TaskType == 762 tm_request->TaskType ==
@@ -763,7 +767,6 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc,
763 } 767 }
764 } 768 }
765 769
766 mutex_lock(&ioc->tm_cmds.mutex);
767 mpt2sas_scsih_set_tm_flag(ioc, le16_to_cpu( 770 mpt2sas_scsih_set_tm_flag(ioc, le16_to_cpu(
768 tm_request->DevHandle)); 771 tm_request->DevHandle));
769 mpt2sas_base_put_smid_hi_priority(ioc, smid); 772 mpt2sas_base_put_smid_hi_priority(ioc, smid);
@@ -819,7 +822,6 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc,
819 if (mpi_request->Function == MPI2_FUNCTION_SCSI_TASK_MGMT) { 822 if (mpi_request->Function == MPI2_FUNCTION_SCSI_TASK_MGMT) {
820 Mpi2SCSITaskManagementRequest_t *tm_request = 823 Mpi2SCSITaskManagementRequest_t *tm_request =
821 (Mpi2SCSITaskManagementRequest_t *)mpi_request; 824 (Mpi2SCSITaskManagementRequest_t *)mpi_request;
822 mutex_unlock(&ioc->tm_cmds.mutex);
823 mpt2sas_scsih_clear_tm_flag(ioc, le16_to_cpu( 825 mpt2sas_scsih_clear_tm_flag(ioc, le16_to_cpu(
824 tm_request->DevHandle)); 826 tm_request->DevHandle));
825 } else if ((mpi_request->Function == MPI2_FUNCTION_SMP_PASSTHROUGH || 827 } else if ((mpi_request->Function == MPI2_FUNCTION_SMP_PASSTHROUGH ||
@@ -900,12 +902,11 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc,
900 "= (0x%04x)\n", ioc->name, 902 "= (0x%04x)\n", ioc->name,
901 le16_to_cpu(mpi_request->FunctionDependent1)); 903 le16_to_cpu(mpi_request->FunctionDependent1));
902 mpt2sas_halt_firmware(ioc); 904 mpt2sas_halt_firmware(ioc);
903 mutex_lock(&ioc->tm_cmds.mutex);
904 mpt2sas_scsih_issue_tm(ioc, 905 mpt2sas_scsih_issue_tm(ioc,
905 le16_to_cpu(mpi_request->FunctionDependent1), 0, 906 le16_to_cpu(mpi_request->FunctionDependent1), 0, 0,
906 MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 10); 907 0, MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 10,
908 NULL);
907 ioc->tm_cmds.status = MPT2_CMD_NOT_USED; 909 ioc->tm_cmds.status = MPT2_CMD_NOT_USED;
908 mutex_unlock(&ioc->tm_cmds.mutex);
909 } else 910 } else
910 mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP, 911 mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
911 FORCE_BIG_HAMMER); 912 FORCE_BIG_HAMMER);