summary refs log tree commit diff
path: root/drivers/scsi/stex.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-03 14:09:02 +0100
committerChristoph Hellwig <hch@lst.de>2014-11-12 11:19:43 +0100
commit2ecb204d07ac8debe3893c362415919bc78bebd6 (patch)
treeeef99b324201b21de358dffdab8bfc0453358d5f /drivers/scsi/stex.c
parente2eddf4d530df745019fded0fedfb78f6d3e33ca (diff)
downloadlinux-2ecb204d07ac8debe3893c362415919bc78bebd6.tar.gz
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/stex.c')
-rw-r--r--drivers/scsi/stex.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 713af13b858e..b5eae4f6ba46 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -549,7 +549,7 @@ stex_slave_alloc(struct scsi_device *sdev)
 	/* Cheat: usually extracted from Inquiry data */
 	sdev->tagged_supported = 1;
 
-	scsi_activate_tcq(sdev, sdev->host->can_queue);
+	scsi_adjust_queue_depth(sdev, 0, sdev->host->can_queue);
 
 	return 0;
 }
@@ -565,12 +565,6 @@ stex_slave_config(struct scsi_device *sdev)
 	return 0;
 }
 
-static void
-stex_slave_destroy(struct scsi_device *sdev)
-{
-	scsi_deactivate_tcq(sdev, 1);
-}
-
 static int
 stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 {
@@ -1390,10 +1384,10 @@ static struct scsi_host_template driver_template = {
 	.queuecommand			= stex_queuecommand,
 	.slave_alloc			= stex_slave_alloc,
 	.slave_configure		= stex_slave_config,
-	.slave_destroy			= stex_slave_destroy,
 	.eh_abort_handler		= stex_abort,
 	.eh_host_reset_handler		= stex_reset,
 	.this_id			= -1,
+	.use_blk_tags			= 1,
 };
 
 static struct pci_device_id stex_pci_tbl[] = {