scsi: mpt3sas: Fix nvme drives checking for tlr.
Check for NVMe drives before enabling or checking tlr. Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com> Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
45aa6a1a2c
commit
cd5897eda2
|
@ -2048,6 +2048,14 @@ scsih_is_raid(struct device *dev)
|
||||||
return (sdev->channel == RAID_CHANNEL) ? 1 : 0;
|
return (sdev->channel == RAID_CHANNEL) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
scsih_is_nvme(struct device *dev)
|
||||||
|
{
|
||||||
|
struct scsi_device *sdev = to_scsi_device(dev);
|
||||||
|
|
||||||
|
return (sdev->channel == PCIE_CHANNEL) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scsih_get_resync - get raid volume resync percent complete
|
* scsih_get_resync - get raid volume resync percent complete
|
||||||
* @dev the device struct object
|
* @dev the device struct object
|
||||||
|
@ -4833,7 +4841,8 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
||||||
/* Make sure Device is not raid volume.
|
/* Make sure Device is not raid volume.
|
||||||
* We do not expose raid functionality to upper layer for warpdrive.
|
* We do not expose raid functionality to upper layer for warpdrive.
|
||||||
*/
|
*/
|
||||||
if (!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev)
|
if (((!ioc->is_warpdrive && !scsih_is_raid(&scmd->device->sdev_gendev))
|
||||||
|
&& !scsih_is_nvme(&scmd->device->sdev_gendev))
|
||||||
&& sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32)
|
&& sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32)
|
||||||
mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON;
|
mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON;
|
||||||
|
|
||||||
|
@ -4879,8 +4888,8 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
||||||
|
|
||||||
raid_device = sas_target_priv_data->raid_device;
|
raid_device = sas_target_priv_data->raid_device;
|
||||||
if (raid_device && raid_device->direct_io_enabled)
|
if (raid_device && raid_device->direct_io_enabled)
|
||||||
mpt3sas_setup_direct_io(ioc, scmd, raid_device, mpi_request,
|
mpt3sas_setup_direct_io(ioc, scmd,
|
||||||
smid);
|
raid_device, mpi_request, smid);
|
||||||
|
|
||||||
if (likely(mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)) {
|
if (likely(mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)) {
|
||||||
if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) {
|
if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) {
|
||||||
|
@ -5410,9 +5419,10 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
|
||||||
le32_to_cpu(mpi_reply->ResponseInfo) & 0xFF;
|
le32_to_cpu(mpi_reply->ResponseInfo) & 0xFF;
|
||||||
if (!sas_device_priv_data->tlr_snoop_check) {
|
if (!sas_device_priv_data->tlr_snoop_check) {
|
||||||
sas_device_priv_data->tlr_snoop_check++;
|
sas_device_priv_data->tlr_snoop_check++;
|
||||||
if (!ioc->is_warpdrive &&
|
if ((!ioc->is_warpdrive &&
|
||||||
!scsih_is_raid(&scmd->device->sdev_gendev) &&
|
!scsih_is_raid(&scmd->device->sdev_gendev) &&
|
||||||
sas_is_tlr_enabled(scmd->device) &&
|
!scsih_is_nvme(&scmd->device->sdev_gendev))
|
||||||
|
&& sas_is_tlr_enabled(scmd->device) &&
|
||||||
response_code == MPI2_SCSITASKMGMT_RSP_INVALID_FRAME) {
|
response_code == MPI2_SCSITASKMGMT_RSP_INVALID_FRAME) {
|
||||||
sas_disable_tlr(scmd->device);
|
sas_disable_tlr(scmd->device);
|
||||||
sdev_printk(KERN_INFO, scmd->device, "TLR disabled\n");
|
sdev_printk(KERN_INFO, scmd->device, "TLR disabled\n");
|
||||||
|
|
Loading…
Reference in New Issue