diff options
author | SEO HOYOUNG <hy50.seo@samsung.com> | 2024-04-11 09:14:44 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2024-04-12 03:54:22 +0200 |
commit | 13c28be58c2bdb12e554e01b0e35621060068b11 (patch) | |
tree | abe535a28e4bd35e93a87717a140573715aa94db | |
parent | scsi: ufs: Remove support for old UFSHCI versions (diff) | |
download | linux-13c28be58c2bdb12e554e01b0e35621060068b11.tar.xz linux-13c28be58c2bdb12e554e01b0e35621060068b11.zip |
scsi: ufs: core: Changing the status to check inflight
ufshcd_cmd_inflight() is used to check whether or not a command is in
progress. Make it skip commands that have already completed by changing
the !blk_mq_request_started(rq) check into blk_mq_rq_state(rq) !=
MQ_RQ_IN_FLIGHT. We cannot rely on lrbp->cmd since lrbp->cmd is not
cleared when a command completes.
Link: https://lore.kernel.org/linux-scsi/20230517223157.1068210-3-bvanassche@acm.org/
Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
Link: https://lore.kernel.org/r/20240411071444.51873-1-hy50.seo@samsung.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/ufs/core/ufshcd.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index c72ef87ea867..392fc1098988 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -3041,16 +3041,7 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba, */ bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd) { - struct request *rq; - - if (!cmd) - return false; - - rq = scsi_cmd_to_rq(cmd); - if (!blk_mq_request_started(rq)) - return false; - - return true; + return cmd && blk_mq_rq_state(scsi_cmd_to_rq(cmd)) == MQ_RQ_IN_FLIGHT; } /* |