Commit b1dd2aac authored by Christoph Hellwig's avatar Christoph Hellwig

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Acked-by: default avatarJens Axboe <axboe@kernel.dk>
Reported-by: default avatarMeelis Roos <mroos@linux.ee>
Tested-by: default avatarMeelis Roos <mroos@linux.ee>
Cc: stable@vger.kernel.org
parent e999dbc2
...@@ -1893,6 +1893,11 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req, ...@@ -1893,6 +1893,11 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,
blk_mq_start_request(req); blk_mq_start_request(req);
} }
if (blk_queue_tagged(q))
req->cmd_flags |= REQ_QUEUED;
else
req->cmd_flags &= ~REQ_QUEUED;
scsi_init_cmd_errh(cmd); scsi_init_cmd_errh(cmd);
cmd->scsi_done = scsi_mq_done; cmd->scsi_done = scsi_mq_done;
......
...@@ -67,8 +67,9 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) ...@@ -67,8 +67,9 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
if (!sdev->tagged_supported) if (!sdev->tagged_supported)
return; return;
if (!shost_use_blk_mq(sdev->host) && if (shost_use_blk_mq(sdev->host))
!blk_queue_tagged(sdev->request_queue)) queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue);
else if (!blk_queue_tagged(sdev->request_queue))
blk_queue_init_tags(sdev->request_queue, depth, blk_queue_init_tags(sdev->request_queue, depth,
sdev->host->bqt); sdev->host->bqt);
...@@ -81,8 +82,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) ...@@ -81,8 +82,7 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
**/ **/
static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
{ {
if (!shost_use_blk_mq(sdev->host) && if (blk_queue_tagged(sdev->request_queue))
blk_queue_tagged(sdev->request_queue))
blk_queue_free_tags(sdev->request_queue); blk_queue_free_tags(sdev->request_queue);
scsi_adjust_queue_depth(sdev, 0, depth); scsi_adjust_queue_depth(sdev, 0, depth);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment