diff options
author | Christoph Hellwig <hch@lst.de> | 2014-11-03 14:15:14 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:43 -0500 |
commit | c8b09f6fb67df7fc1b51ced1037fa9b677428149 (patch) | |
tree | 87527c3e17a7539c0ffa9f64fbd85ec2ad3dabf1 /drivers/scsi/pmcraid.c | |
parent | 2ecb204d07ac8debe3893c362415919bc78bebd6 (diff) |
scsi: don't set tagging state from scsi_adjust_queue_depth
Remove the tagged argument from scsi_adjust_queue_depth, and just let it
handle the queue depth. For most drivers those two are fairly separate,
given that most modern drivers don't care about the SCSI "tagged" status
of a command at all, and many old drivers allow queuing of multiple
untagged commands in the driver.
Instead we start out with the ->simple_tags flag set before calling
->slave_configure, which is how all drivers actually looking at
->simple_tags except for one worke anyway. The one other case looks
broken, but I've kept the behavior as-is for now.
Except for that we only change ->simple_tags from the ->change_queue_type,
and when rejecting a tag message in a single driver, so keeping this
churn out of scsi_adjust_queue_depth is a clear win.
Now that the usage of scsi_adjust_queue_depth is more obvious we can
also remove all the trivial instances in ->slave_alloc or ->slave_configure
that just set it to the cmd_per_lun default.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pmcraid.c')
-rw-r--r-- | drivers/scsi/pmcraid.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 71f9f59b13c6..d8b9ba251fbd 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c | |||
@@ -249,14 +249,11 @@ static int pmcraid_slave_configure(struct scsi_device *scsi_dev) | |||
249 | PMCRAID_VSET_MAX_SECTORS); | 249 | PMCRAID_VSET_MAX_SECTORS); |
250 | } | 250 | } |
251 | 251 | ||
252 | if (scsi_dev->tagged_supported && | 252 | /* |
253 | (RES_IS_GSCSI(res->cfg_entry) || RES_IS_VSET(res->cfg_entry))) { | 253 | * We never want to report TCQ support for these types of devices. |
254 | scsi_adjust_queue_depth(scsi_dev, MSG_SIMPLE_TAG, | 254 | */ |
255 | scsi_dev->host->cmd_per_lun); | 255 | if (!RES_IS_GSCSI(res->cfg_entry) && !RES_IS_VSET(res->cfg_entry)) |
256 | } else { | 256 | scsi_dev->tagged_supported = 0; |
257 | scsi_adjust_queue_depth(scsi_dev, 0, | ||
258 | scsi_dev->host->cmd_per_lun); | ||
259 | } | ||
260 | 257 | ||
261 | return 0; | 258 | return 0; |
262 | } | 259 | } |
@@ -302,35 +299,12 @@ static int pmcraid_change_queue_depth(struct scsi_device *scsi_dev, int depth, | |||
302 | if (depth > PMCRAID_MAX_CMD_PER_LUN) | 299 | if (depth > PMCRAID_MAX_CMD_PER_LUN) |
303 | depth = PMCRAID_MAX_CMD_PER_LUN; | 300 | depth = PMCRAID_MAX_CMD_PER_LUN; |
304 | 301 | ||
305 | scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev), depth); | 302 | scsi_adjust_queue_depth(scsi_dev, depth); |
306 | 303 | ||
307 | return scsi_dev->queue_depth; | 304 | return scsi_dev->queue_depth; |
308 | } | 305 | } |
309 | 306 | ||
310 | /** | 307 | /** |
311 | * pmcraid_change_queue_type - Change the device's queue type | ||
312 | * @scsi_dev: scsi device struct | ||
313 | * @tag: type of tags to use | ||
314 | * | ||
315 | * Return value: | ||
316 | * actual queue type set | ||
317 | */ | ||
318 | static int pmcraid_change_queue_type(struct scsi_device *scsi_dev, int tag) | ||
319 | { | ||
320 | struct pmcraid_resource_entry *res; | ||
321 | |||
322 | res = (struct pmcraid_resource_entry *)scsi_dev->hostdata; | ||
323 | if (res && scsi_dev->tagged_supported && | ||
324 | (RES_IS_GSCSI(res->cfg_entry) || RES_IS_VSET(res->cfg_entry))) | ||
325 | tag = scsi_change_queue_type(scsi_dev, tag); | ||
326 | else | ||
327 | tag = 0; | ||
328 | |||
329 | return tag; | ||
330 | } | ||
331 | |||
332 | |||
333 | /** | ||
334 | * pmcraid_init_cmdblk - initializes a command block | 308 | * pmcraid_init_cmdblk - initializes a command block |
335 | * | 309 | * |
336 | * @cmd: pointer to struct pmcraid_cmd to be initialized | 310 | * @cmd: pointer to struct pmcraid_cmd to be initialized |
@@ -4285,7 +4259,7 @@ static struct scsi_host_template pmcraid_host_template = { | |||
4285 | .slave_configure = pmcraid_slave_configure, | 4259 | .slave_configure = pmcraid_slave_configure, |
4286 | .slave_destroy = pmcraid_slave_destroy, | 4260 | .slave_destroy = pmcraid_slave_destroy, |
4287 | .change_queue_depth = pmcraid_change_queue_depth, | 4261 | .change_queue_depth = pmcraid_change_queue_depth, |
4288 | .change_queue_type = pmcraid_change_queue_type, | 4262 | .change_queue_type = scsi_change_queue_type, |
4289 | .can_queue = PMCRAID_MAX_IO_CMD, | 4263 | .can_queue = PMCRAID_MAX_IO_CMD, |
4290 | .this_id = -1, | 4264 | .this_id = -1, |
4291 | .sg_tablesize = PMCRAID_MAX_IOADLS, | 4265 | .sg_tablesize = PMCRAID_MAX_IOADLS, |