Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173550
b: refs/heads/master
c: e0077d6
h: refs/heads/master
v: v3
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Oct 29, 2009
1 parent 1a819f7 commit d91228d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8ebd76c49fa45d93a736ae0b0f192b554cc8c3f
refs/heads/master: e0077d607f716f68d15ab6fbf3d9f4c41434142d
25 changes: 25 additions & 0 deletions trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,33 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
struct Scsi_Host *shost = sdev->host;
int max_depth;
int tag_type;
struct MPT2SAS_ADAPTER *ioc = shost_priv(shost);
struct MPT2SAS_DEVICE *sas_device_priv_data;
struct MPT2SAS_TARGET *sas_target_priv_data;
struct _sas_device *sas_device;
unsigned long flags;

max_depth = shost->can_queue;

/* limit max device queue for SATA to 32 */
sas_device_priv_data = sdev->hostdata;
if (!sas_device_priv_data)
goto not_sata;
sas_target_priv_data = sas_device_priv_data->sas_target;
if (!sas_target_priv_data)
goto not_sata;
if ((sas_target_priv_data->flags & MPT_TARGET_FLAGS_VOLUME))
goto not_sata;
spin_lock_irqsave(&ioc->sas_device_lock, flags);
sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
sas_device_priv_data->sas_target->sas_address);
spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
if (sas_device && sas_device->device_info &
MPI2_SAS_DEVICE_INFO_SATA_DEVICE)
max_depth = MPT2SAS_SATA_QUEUE_DEPTH;

not_sata:

if (!sdev->tagged_supported)
max_depth = 1;
if (qdepth > max_depth)
Expand Down

0 comments on commit d91228d

Please sign in to comment.