diff options
author | Sreekanth Reddy <sreekanth.reddy@avagotech.com> | 2015-11-12 13:10:37 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-13 15:25:11 -0500 |
commit | 15de0de29f7ba5cce9699a8cc2344ca137beb25a (patch) | |
tree | f7f7bdf881752c6cc272accbf30f2c3c047d69ef | |
parent | 2c5d16d6a9e7218e57b716e4fd9d77c776d21471 (diff) |
mpt3sas: Fix use sas_is_tlr_enabled API before enabling MPI2_SCSIIO_CONTROL_TLR_ON flag
Before enabling MPI2_SCSIIO_CONTROL_TLR_ON flag in MPI SCSI IO request
message, check whether TLR is enabled on the drive using
'sas_is_tlr_enabled' API.
Actually in the driver code, driver is using below API's
1. sas_enable_tlr() - to enable the TLR
2. sas_disable_tlr() - to disable the TLR
3. sas_is_tlr_enabled() - to check whether TLR is enabled or not.
but in scsih_qcmd() we have missed to use sas_is_tlr_enabled() API,
instead we checking for TLR bit from flag field of driver's 'struct
MPT3SAS_DEVIC' structure. which is corrected with this patch.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index d95206b7e116..9ab77b06434d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | |||
@@ -3905,8 +3905,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd) | |||
3905 | * We do not expose raid functionality to upper layer for warpdrive. | 3905 | * We do not expose raid functionality to upper layer for warpdrive. |
3906 | */ | 3906 | */ |
3907 | if (!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev) | 3907 | if (!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev) |
3908 | && (sas_device_priv_data->flags & MPT_DEVICE_TLR_ON) && | 3908 | && sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32) |
3909 | scmd->cmd_len != 32) | ||
3910 | mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON; | 3909 | mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON; |
3911 | 3910 | ||
3912 | smid = mpt3sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd); | 3911 | smid = mpt3sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd); |