diff options
author | Christoph Hellwig <hch@lst.de> | 2014-11-13 14:27:41 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-24 14:45:26 +0100 |
commit | 1e6f2416044c062a56091ebf8d76760956dd5872 (patch) | |
tree | 53b83ab97cc475c37f957bb85167ae8cb2ccd550 /drivers/scsi/megaraid | |
parent | c40ecc12cfdb630332198a04e2832ae8218a61f1 (diff) | |
download | op-kernel-dev-1e6f2416044c062a56091ebf8d76760956dd5872.zip op-kernel-dev-1e6f2416044c062a56091ebf8d76760956dd5872.tar.gz |
scsi: don't allow setting of queue_depth bigger than can_queue
We won't ever queue more commands than the host allows. Instead of
letting drivers either reject or ignore this case handle it in
common code. Note that various driver use internal constant or
variables that are assigned to both shost->can_queue and checked
in ->change_queue_depth - I did remove those checks as well.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mbox.c | 2 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 6b077d8..d56eb9d 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -347,8 +347,6 @@ static int megaraid_change_queue_depth(struct scsi_device *sdev, int qdepth, if (reason != SCSI_QDEPTH_DEFAULT) return -EOPNOTSUPP; - if (qdepth > MBOX_MAX_SCSI_CMDS) - qdepth = MBOX_MAX_SCSI_CMDS; scsi_adjust_queue_depth(sdev, qdepth); return sdev->queue_depth; } diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 3ccfbec..69a9dd6 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -2597,8 +2597,6 @@ static int megasas_change_queue_depth(struct scsi_device *sdev, if (reason != SCSI_QDEPTH_DEFAULT) return -EOPNOTSUPP; - if (queue_depth > sdev->host->can_queue) - queue_depth = sdev->host->can_queue; scsi_adjust_queue_depth(sdev, queue_depth); return queue_depth; |