diff options
author | Christoph Hellwig <hch@lst.de> | 2014-11-03 08:09:02 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:43 -0500 |
commit | 2ecb204d07ac8debe3893c362415919bc78bebd6 (patch) | |
tree | eef99b324201b21de358dffdab8bfc0453358d5f /drivers/scsi/53c700.c | |
parent | e2eddf4d530df745019fded0fedfb78f6d3e33ca (diff) |
scsi: always assign block layer tags if enabled
Allow a driver to ask for block layer tags by setting .use_blk_tags in the
host template, in which case it will always see a valid value in
request->tag, similar to the behavior when using blk-mq. This means even
SCSI "untagged" commands will now have a tag, which is especially useful
when using a host-wide tag map.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/53c700.c')
-rw-r--r-- | drivers/scsi/53c700.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 1b36fd3a6e62..497cbb1efd4b 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c | |||
@@ -327,6 +327,7 @@ NCR_700_detect(struct scsi_host_template *tpnt, | |||
327 | tpnt->slave_alloc = NCR_700_slave_alloc; | 327 | tpnt->slave_alloc = NCR_700_slave_alloc; |
328 | tpnt->change_queue_depth = NCR_700_change_queue_depth; | 328 | tpnt->change_queue_depth = NCR_700_change_queue_depth; |
329 | tpnt->change_queue_type = NCR_700_change_queue_type; | 329 | tpnt->change_queue_type = NCR_700_change_queue_type; |
330 | tpnt->use_blk_tags = 1; | ||
330 | 331 | ||
331 | if(tpnt->name == NULL) | 332 | if(tpnt->name == NULL) |
332 | tpnt->name = "53c700"; | 333 | tpnt->name = "53c700"; |
@@ -902,7 +903,7 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata | |||
902 | 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); |
903 | hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); | 904 | hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); |
904 | SCp->device->tagged_supported = 0; | 905 | SCp->device->tagged_supported = 0; |
905 | scsi_deactivate_tcq(SCp->device, host->cmd_per_lun); | 906 | scsi_adjust_queue_depth(SCp->device, 0, host->cmd_per_lun); |
906 | } else { | 907 | } else { |
907 | shost_printk(KERN_WARNING, host, | 908 | shost_printk(KERN_WARNING, host, |
908 | "(%d:%d) Unexpected REJECT Message %s\n", | 909 | "(%d:%d) Unexpected REJECT Message %s\n", |
@@ -2049,8 +2050,7 @@ NCR_700_slave_configure(struct scsi_device *SDp) | |||
2049 | 2050 | ||
2050 | /* to do here: allocate memory; build a queue_full list */ | 2051 | /* to do here: allocate memory; build a queue_full list */ |
2051 | if(SDp->tagged_supported) { | 2052 | if(SDp->tagged_supported) { |
2052 | scsi_set_tag_type(SDp, MSG_ORDERED_TAG); | 2053 | scsi_adjust_queue_depth(SDp, MSG_ORDERED_TAG, NCR_700_DEFAULT_TAGS); |
2053 | scsi_activate_tcq(SDp, NCR_700_DEFAULT_TAGS); | ||
2054 | NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); | 2054 | NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); |
2055 | } else { | 2055 | } else { |
2056 | /* initialise to default depth */ | 2056 | /* initialise to default depth */ |
@@ -2094,8 +2094,6 @@ static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type) | |||
2094 | struct NCR_700_Host_Parameters *hostdata = | 2094 | struct NCR_700_Host_Parameters *hostdata = |
2095 | (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0]; | 2095 | (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0]; |
2096 | 2096 | ||
2097 | scsi_set_tag_type(SDp, tag_type); | ||
2098 | |||
2099 | /* We have a global (per target) flag to track whether TCQ is | 2097 | /* We have a global (per target) flag to track whether TCQ is |
2100 | * enabled, so we'll be turning it off for the entire target here. | 2098 | * enabled, so we'll be turning it off for the entire target here. |
2101 | * our tag algorithm will fail if we mix tagged and untagged commands, | 2099 | * our tag algorithm will fail if we mix tagged and untagged commands, |
@@ -2106,12 +2104,12 @@ static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type) | |||
2106 | if (!tag_type) { | 2104 | if (!tag_type) { |
2107 | /* shift back to the default unqueued number of commands | 2105 | /* shift back to the default unqueued number of commands |
2108 | * (the user can still raise this) */ | 2106 | * (the user can still raise this) */ |
2109 | scsi_deactivate_tcq(SDp, SDp->host->cmd_per_lun); | 2107 | scsi_adjust_queue_depth(SDp, 0, SDp->host->cmd_per_lun); |
2110 | hostdata->tag_negotiated &= ~(1 << sdev_id(SDp)); | 2108 | hostdata->tag_negotiated &= ~(1 << sdev_id(SDp)); |
2111 | } else { | 2109 | } else { |
2112 | /* Here, we cleared the negotiation flag above, so this | 2110 | /* Here, we cleared the negotiation flag above, so this |
2113 | * will force the driver to renegotiate */ | 2111 | * will force the driver to renegotiate */ |
2114 | scsi_activate_tcq(SDp, SDp->queue_depth); | 2112 | scsi_adjust_queue_depth(SDp, tag_type, SDp->queue_depth); |
2115 | if (change_tag) | 2113 | if (change_tag) |
2116 | NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); | 2114 | NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); |
2117 | } | 2115 | } |