diff options
author | Christoph Hellwig <hch@lst.de> | 2014-10-19 11:13:58 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-10-28 04:53:43 -0400 |
commit | b1dd2aac4cc0892b82ec60232ed37e3b0af776cc (patch) | |
tree | 393321bf7de6c136282ae8550cb8173f86b6b5a9 | |
parent | e999dbc254044e8d2a5818d92d205f65bae28f37 (diff) |
scsi: set REQ_QUEUE for the blk-mq case
To generate the right SPI tag messages we need to properly set
QUEUE_FLAG_QUEUED in the request_queue and mirror it to the
request.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 | ||||
-rw-r--r-- | include/scsi/scsi_tcq.h | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9eff8a375132..50a6e1ac8d9c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1893,6 +1893,11 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req, | |||
1893 | blk_mq_start_request(req); | 1893 | blk_mq_start_request(req); |
1894 | } | 1894 | } |
1895 | 1895 | ||
1896 | if (blk_queue_tagged(q)) | ||
1897 | req->cmd_flags |= REQ_QUEUED; | ||
1898 | else | ||
1899 | req->cmd_flags &= ~REQ_QUEUED; | ||
1900 | |||
1896 | scsi_init_cmd_errh(cmd); | 1901 | scsi_init_cmd_errh(cmd); |
1897 | cmd->scsi_done = scsi_mq_done; | 1902 | cmd->scsi_done = scsi_mq_done; |
1898 | 1903 | ||
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index e64583560701..56ed843969ca 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -67,8 +67,9 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
67 | if (!sdev->tagged_supported) | 67 | if (!sdev->tagged_supported) |
68 | return; | 68 | return; |
69 | 69 | ||
70 | if (!shost_use_blk_mq(sdev->host) && | 70 | if (shost_use_blk_mq(sdev->host)) |
71 | !blk_queue_tagged(sdev->request_queue)) | 71 | queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue); |
72 | else if (!blk_queue_tagged(sdev->request_queue)) | ||
72 | blk_queue_init_tags(sdev->request_queue, depth, | 73 | blk_queue_init_tags(sdev->request_queue, depth, |
73 | sdev->host->bqt); | 74 | sdev->host->bqt); |
74 | 75 | ||
@@ -81,8 +82,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
81 | **/ | 82 | **/ |
82 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) | 83 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) |
83 | { | 84 | { |
84 | if (!shost_use_blk_mq(sdev->host) && | 85 | if (blk_queue_tagged(sdev->request_queue)) |
85 | blk_queue_tagged(sdev->request_queue)) | ||
86 | blk_queue_free_tags(sdev->request_queue); | 86 | blk_queue_free_tags(sdev->request_queue); |
87 | scsi_adjust_queue_depth(sdev, 0, depth); | 87 | scsi_adjust_queue_depth(sdev, 0, depth); |
88 | } | 88 | } |