diff options
| -rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 59ea821c2a3c..eb0215a2b5fa 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
| @@ -1107,8 +1107,33 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) | |||
| 1107 | struct Scsi_Host *shost = sdev->host; | 1107 | struct Scsi_Host *shost = sdev->host; |
| 1108 | int max_depth; | 1108 | int max_depth; |
| 1109 | int tag_type; | 1109 | int tag_type; |
| 1110 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | ||
| 1111 | struct MPT2SAS_DEVICE *sas_device_priv_data; | ||
| 1112 | struct MPT2SAS_TARGET *sas_target_priv_data; | ||
| 1113 | struct _sas_device *sas_device; | ||
| 1114 | unsigned long flags; | ||
| 1110 | 1115 | ||
| 1111 | max_depth = shost->can_queue; | 1116 | max_depth = shost->can_queue; |
| 1117 | |||
| 1118 | /* limit max device queue for SATA to 32 */ | ||
| 1119 | sas_device_priv_data = sdev->hostdata; | ||
| 1120 | if (!sas_device_priv_data) | ||
| 1121 | goto not_sata; | ||
| 1122 | sas_target_priv_data = sas_device_priv_data->sas_target; | ||
| 1123 | if (!sas_target_priv_data) | ||
| 1124 | goto not_sata; | ||
| 1125 | if ((sas_target_priv_data->flags & MPT_TARGET_FLAGS_VOLUME)) | ||
| 1126 | goto not_sata; | ||
| 1127 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | ||
| 1128 | sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc, | ||
| 1129 | sas_device_priv_data->sas_target->sas_address); | ||
| 1130 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | ||
| 1131 | if (sas_device && sas_device->device_info & | ||
| 1132 | MPI2_SAS_DEVICE_INFO_SATA_DEVICE) | ||
| 1133 | max_depth = MPT2SAS_SATA_QUEUE_DEPTH; | ||
| 1134 | |||
| 1135 | not_sata: | ||
| 1136 | |||
| 1112 | if (!sdev->tagged_supported) | 1137 | if (!sdev->tagged_supported) |
| 1113 | max_depth = 1; | 1138 | max_depth = 1; |
| 1114 | if (qdepth > max_depth) | 1139 | if (qdepth > max_depth) |
