UPSTREAM: scsi: ufs: core: Fix task management request completion timeout

ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn = ufshcd_compl_tm()),
but since blk_mq_tagset_busy_iter() only iterates over all reserved tags
and requests which are not in IDLE state, ufshcd_compl_tm() never gets a
chance to run. Thus, TMR always ends up with completion timeout. Fix it by
calling blk_mq_start_request() in __ufshcd_issue_tm_cmd().

Link: https://lore.kernel.org/r/[email protected]
Fixes: 69a6c269c097 ("scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs")
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Can Guo <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
(cherry picked from commit 1235fc569e0bf541ddda0a1224d4c6fa6d914890)
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I2e8e7cf02c83e8264689670b3d08f37ef6ce11d5
This commit is contained in:
Can Guo 2021-04-01 00:39:08 -07:00 • committed by Greg Kroah-Hartman
commit fd312c1d55

View file

@ -6269,6 +6269,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,
spin_lock_irqsave(host->host_lock, flags);
task_tag = hba->nutrs + free_slot;
blk_mq_start_request(req);
treq->req_header.dword_0 |= cpu_to_be32(task_tag);