Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271065
b: refs/heads/master
c: 97a1420
h: refs/heads/master
i:
  271063: 15093c1
v: v3
  • Loading branch information
Dan Williams authored and James Bottomley committed Oct 2, 2011
1 parent a798903 commit 3feafad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 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: f6e67035a9edd79b8b202c159d5bec560bb9c358
refs/heads/master: 97a1420d127ca1db2fd665707bf4e9501758147c
39 changes: 18 additions & 21 deletions trunk/drivers/scsi/libsas/sas_scsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,7 @@ int sas_target_alloc(struct scsi_target *starget)
return 0;
}

#define SAS_DEF_QD 32
#define SAS_MAX_QD 64
#define SAS_DEF_QD 256

int sas_slave_configure(struct scsi_device *scsi_dev)
{
Expand Down Expand Up @@ -805,31 +804,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE;
}

int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,
int reason)
int sas_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
{
struct domain_device *dev = sdev_to_domain_dev(scsi_dev);
int res = min(new_depth, SAS_MAX_QD);
struct domain_device *dev = sdev_to_domain_dev(sdev);

if (dev_is_sata(dev))
return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev,
new_depth, reason);

if (reason != SCSI_QDEPTH_DEFAULT)
return __ata_change_queue_depth(dev->sata_dev.ap, sdev, depth,
reason);

switch (reason) {
case SCSI_QDEPTH_DEFAULT:
case SCSI_QDEPTH_RAMP_UP:
if (!sdev->tagged_supported)
depth = 1;
scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
break;
case SCSI_QDEPTH_QFULL:
scsi_track_queue_full(sdev, depth);
break;
default:
return -EOPNOTSUPP;

if (scsi_dev->tagged_supported)
scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev),
res);
else {
sas_printk("device %llx LUN %x queue depth changed to 1\n",
SAS_ADDR(dev->sas_addr),
scsi_dev->lun);
scsi_adjust_queue_depth(scsi_dev, 0, 1);
res = 1;
}

return res;
return depth;
}

int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)
Expand Down

0 comments on commit 3feafad

Please sign in to comment.