aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-09-23 08:00:22 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-10-29 13:03:13 -0400
commite0077d607f716f68d15ab6fbf3d9f4c41434142d (patch)
treeb121fea59b4b94836f14b52065b098b1312b36a1 /drivers/scsi/mpt2sas
parenta8ebd76c49fa45d93a736ae0b0f192b554cc8c3f (diff)
[SCSI] mpt2sas: Limit the max_depth to 32 for SATA devices which are not part of volume
Added sanity check in _scsih_change_queue_depth to limit the max_depth to 32 for SATA devices. This is only for physical devices not part of a volume. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c25
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)