aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-10-05 10:41:30 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2020-10-07 21:48:28 -0400
commited7fb2d018fdda4fcf0e9a8602e5000c7f0d8851 (patch)
treeb9be0dff44a8538ff7575ed976542772f3ae4b2b /drivers/scsi
parentscsi: core: Remove scsi_setup_cmnd() and scsi_setup_fs_cmnd() (diff)
downloadlinux-dev-ed7fb2d018fdda4fcf0e9a8602e5000c7f0d8851.tar.xz
linux-dev-ed7fb2d018fdda4fcf0e9a8602e5000c7f0d8851.zip
scsi: core: Only start the request just before dispatching
This has no change in behavior, but improves the accounting a bit. Link: https://lore.kernel.org/r/20201005084130.143273-11-hch@lst.de Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 6bf043dbae83..6b0fccda9af2 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1557,8 +1557,6 @@ static blk_status_t scsi_prepare_cmd(struct request *req)
(struct scatterlist *)(cmd->prot_sdb + 1);
}
- blk_mq_start_request(req);
-
/*
* Special handling for passthrough commands, which don't go to the ULP
* at all:
@@ -1659,7 +1657,6 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
req->rq_flags |= RQF_DONTPREP;
} else {
clear_bit(SCMD_STATE_COMPLETE, &cmd->state);
- blk_mq_start_request(req);
}
cmd->flags &= SCMD_PRESERVED_FLAGS;
@@ -1672,6 +1669,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
cmd->scsi_done = scsi_mq_done;
+ blk_mq_start_request(req);
reason = scsi_dispatch_cmd(cmd);
if (reason) {
scsi_set_blocked(cmd, reason);