aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/53c700.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-03 14:15:14 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:19:43 -0500
commitc8b09f6fb67df7fc1b51ced1037fa9b677428149 (patch)
tree87527c3e17a7539c0ffa9f64fbd85ec2ad3dabf1 /drivers/scsi/53c700.c
parent2ecb204d07ac8debe3893c362415919bc78bebd6 (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/53c700.c')
-rw-r--r--drivers/scsi/53c700.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 497cbb1efd4b..d7557b932113 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -902,8 +902,10 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata
902 /* we're done negotiating */ 902 /* we're done negotiating */
903 NCR_700_set_tag_neg_state(SCp->device, NCR_700_FINISHED_TAG_NEGOTIATION); 903 NCR_700_set_tag_neg_state(SCp->device, NCR_700_FINISHED_TAG_NEGOTIATION);
904 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); 904 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp));
905
905 SCp->device->tagged_supported = 0; 906 SCp->device->tagged_supported = 0;
906 scsi_adjust_queue_depth(SCp->device, 0, host->cmd_per_lun); 907 scsi_adjust_queue_depth(SCp->device, host->cmd_per_lun);
908 scsi_set_tag_type(SCp->device, 0);
907 } else { 909 } else {
908 shost_printk(KERN_WARNING, host, 910 shost_printk(KERN_WARNING, host,
909 "(%d:%d) Unexpected REJECT Message %s\n", 911 "(%d:%d) Unexpected REJECT Message %s\n",
@@ -2050,12 +2052,10 @@ NCR_700_slave_configure(struct scsi_device *SDp)
2050 2052
2051 /* to do here: allocate memory; build a queue_full list */ 2053 /* to do here: allocate memory; build a queue_full list */
2052 if(SDp->tagged_supported) { 2054 if(SDp->tagged_supported) {
2053 scsi_adjust_queue_depth(SDp, MSG_ORDERED_TAG, NCR_700_DEFAULT_TAGS); 2055 scsi_adjust_queue_depth(SDp, NCR_700_DEFAULT_TAGS);
2054 NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); 2056 NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION);
2055 } else {
2056 /* initialise to default depth */
2057 scsi_adjust_queue_depth(SDp, 0, SDp->host->cmd_per_lun);
2058 } 2057 }
2058
2059 if(hostdata->fast) { 2059 if(hostdata->fast) {
2060 /* Find the correct offset and period via domain validation */ 2060 /* Find the correct offset and period via domain validation */
2061 if (!spi_initial_dv(SDp->sdev_target)) 2061 if (!spi_initial_dv(SDp->sdev_target))
@@ -2083,7 +2083,7 @@ NCR_700_change_queue_depth(struct scsi_device *SDp, int depth, int reason)
2083 if (depth > NCR_700_MAX_TAGS) 2083 if (depth > NCR_700_MAX_TAGS)
2084 depth = NCR_700_MAX_TAGS; 2084 depth = NCR_700_MAX_TAGS;
2085 2085
2086 scsi_adjust_queue_depth(SDp, scsi_get_tag_type(SDp), depth); 2086 scsi_adjust_queue_depth(SDp, depth);
2087 return depth; 2087 return depth;
2088} 2088}
2089 2089
@@ -2101,15 +2101,16 @@ static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type)
2101 if (change_tag) 2101 if (change_tag)
2102 scsi_target_quiesce(SDp->sdev_target); 2102 scsi_target_quiesce(SDp->sdev_target);
2103 2103
2104 scsi_set_tag_type(SDp, tag_type);
2104 if (!tag_type) { 2105 if (!tag_type) {
2105 /* shift back to the default unqueued number of commands 2106 /* shift back to the default unqueued number of commands
2106 * (the user can still raise this) */ 2107 * (the user can still raise this) */
2107 scsi_adjust_queue_depth(SDp, 0, SDp->host->cmd_per_lun); 2108 scsi_adjust_queue_depth(SDp, SDp->host->cmd_per_lun);
2108 hostdata->tag_negotiated &= ~(1 << sdev_id(SDp)); 2109 hostdata->tag_negotiated &= ~(1 << sdev_id(SDp));
2109 } else { 2110 } else {
2110 /* Here, we cleared the negotiation flag above, so this 2111 /* Here, we cleared the negotiation flag above, so this
2111 * will force the driver to renegotiate */ 2112 * will force the driver to renegotiate */
2112 scsi_adjust_queue_depth(SDp, tag_type, SDp->queue_depth); 2113 scsi_adjust_queue_depth(SDp, SDp->queue_depth);
2113 if (change_tag) 2114 if (change_tag)
2114 NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); 2115 NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION);
2115 } 2116 }