Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

SEO HOYOUNG and committed by
Martin K. Petersen
13c28be5 a33a502d

+1 -10
+1 -10
drivers/ufs/core/ufshcd.c
··· 3041 3041 */ 3042 3042 bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd) 3043 3043 { 3044 - struct request *rq; 3045 - 3046 - if (!cmd) 3047 - return false; 3048 - 3049 - rq = scsi_cmd_to_rq(cmd); 3050 - if (!blk_mq_request_started(rq)) 3051 - return false; 3052 - 3053 - return true; 3044 + return cmd && blk_mq_rq_state(scsi_cmd_to_rq(cmd)) == MQ_RQ_IN_FLIGHT; 3054 3045 } 3055 3046 3056 3047 /*