Skip to content

Commit 13c28be

Browse files
SEO HOYOUNGmartinkpetersen
authored andcommitted
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/[email protected]/ Signed-off-by: SEO HOYOUNG <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent a33a502 commit 13c28be

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,16 +3041,7 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba,
30413041
*/
30423042
bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd)
30433043
{
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;
30543045
}
30553046

30563047
/*

0 commit comments

Comments
 (0)