Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226765
b: refs/heads/master
c: a93c6b4
h: refs/heads/master
i:
  226763: d45e8a7
v: v3
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Dec 21, 2010
1 parent 96096b8 commit bc113eb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90d2a672250b9d6e5c700f2d2c07c19d6fad064a
refs/heads/master: a93c6b45df57332b1703e0dc6f99a1bafc17f5e3
37 changes: 26 additions & 11 deletions trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,28 +1102,24 @@ _scsih_build_scatter_gather(struct MPT2SAS_ADAPTER *ioc,
}

/**
* _scsih_change_queue_depth - setting device queue depth
* _scsih_adjust_queue_depth - setting device queue depth
* @sdev: scsi device struct
* @qdepth: requested queue depth
* @reason: calling context
*
* Returns queue depth.
*
* Returns nothing
*/
static int
_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
static void
_scsih_adjust_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;

if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;

max_depth = shost->can_queue;

/* limit max device queue for SATA to 32 */
Expand All @@ -1149,8 +1145,27 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
max_depth = 1;
if (qdepth > max_depth)
qdepth = max_depth;
tag_type = (qdepth == 1) ? 0 : MSG_SIMPLE_TAG;
scsi_adjust_queue_depth(sdev, tag_type, qdepth);
scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth);
}

/**
* _scsih_change_queue_depth - setting device queue depth
* @sdev: scsi device struct
* @qdepth: requested queue depth
* @reason: SCSI_QDEPTH_DEFAULT/SCSI_QDEPTH_QFULL/SCSI_QDEPTH_RAMP_UP
* (see include/scsi/scsi_host.h for definition)
*
* Returns queue depth.
*/
static int
_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
{
if (reason == SCSI_QDEPTH_DEFAULT || reason == SCSI_QDEPTH_RAMP_UP)
_scsih_adjust_queue_depth(sdev, qdepth);
else if (reason == SCSI_QDEPTH_QFULL)
scsi_track_queue_full(sdev, qdepth);
else
return -EOPNOTSUPP;

if (sdev->inquiry_len > 7)
sdev_printk(KERN_INFO, sdev, "qdepth(%d), tagged(%d), "
Expand Down

0 comments on commit bc113eb

Please sign in to comment.