Commit 69278f79 authored by Jens Axboe's avatar Jens Axboe Committed by Tejun Heo

libata: don't clamp queue depth to ATA_MAX_QUEUE - 1

Use what the driver provides, which will still be ATA_MAX_QUEUE - 1
at most anyway.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 28361c40
...@@ -2286,7 +2286,7 @@ static int ata_dev_config_ncq(struct ata_device *dev, ...@@ -2286,7 +2286,7 @@ static int ata_dev_config_ncq(struct ata_device *dev,
return 0; return 0;
} }
if (ap->flags & ATA_FLAG_NCQ) { if (ap->flags & ATA_FLAG_NCQ) {
hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE - 1); hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE);
dev->flags |= ATA_DFLAG_NCQ; dev->flags |= ATA_DFLAG_NCQ;
} }
...@@ -6408,7 +6408,7 @@ void ata_host_init(struct ata_host *host, struct device *dev, ...@@ -6408,7 +6408,7 @@ void ata_host_init(struct ata_host *host, struct device *dev,
{ {
spin_lock_init(&host->lock); spin_lock_init(&host->lock);
mutex_init(&host->eh_mutex); mutex_init(&host->eh_mutex);
host->n_tags = ATA_MAX_QUEUE - 1; host->n_tags = ATA_MAX_QUEUE;
host->dev = dev; host->dev = dev;
host->ops = ops; host->ops = ops;
} }
...@@ -6490,7 +6490,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) ...@@ -6490,7 +6490,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
{ {
int i, rc; int i, rc;
host->n_tags = clamp(sht->can_queue, 1, ATA_MAX_QUEUE - 1); host->n_tags = clamp(sht->can_queue, 1, ATA_MAX_QUEUE);
/* host must have been started */ /* host must have been started */
if (!(host->flags & ATA_HOST_STARTED)) { if (!(host->flags & ATA_HOST_STARTED)) {
......
...@@ -1319,7 +1319,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, ...@@ -1319,7 +1319,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
int depth; int depth;
depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
depth = min(ATA_MAX_QUEUE - 1, depth); depth = min(ATA_MAX_QUEUE, depth);
scsi_change_queue_depth(sdev, depth); scsi_change_queue_depth(sdev, depth);
} }
...@@ -1432,7 +1432,7 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, ...@@ -1432,7 +1432,7 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
/* limit and apply queue depth */ /* limit and apply queue depth */
queue_depth = min(queue_depth, sdev->host->can_queue); queue_depth = min(queue_depth, sdev->host->can_queue);
queue_depth = min(queue_depth, ata_id_queue_depth(dev->id)); queue_depth = min(queue_depth, ata_id_queue_depth(dev->id));
queue_depth = min(queue_depth, ATA_MAX_QUEUE - 1); queue_depth = min(queue_depth, ATA_MAX_QUEUE);
if (sdev->queue_depth == queue_depth) if (sdev->queue_depth == queue_depth)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment