Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8082ac96 authored by Stanley Chu's avatar Stanley Chu Committed by Pranav Vashi
Browse files

scsi: ufs: fix broken hba->outstanding_tasks



Currently bits in hba->outstanding_tasks are cleared only after their
corresponding task management commands are successfully done by
__ufshcd_issue_tm_cmd().

If timeout happens in a task management command, its corresponding bit in
hba->outstanding_tasks will not be cleared until next task management
command with the same tag used successfully finishes.

This is wrong and can lead to some issues, like power issue.  For example,
ufshcd_release() and ufshcd_gate_work() will do nothing if
hba->outstanding_tasks is not zero even if both UFS host and devices are
actually idle.

Solution is referred from error handling of device commands: bits in
hba->outstanding_tasks shall be cleared regardless of their execution
results.

Change-Id: I92269b69da38f65b23355aa928869ff2f98c9120
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarChun-Hung Wu <chun-hung.wu@mediatek.com>
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Git-commit: b557217c8475f40bc765ee20ff6b3b9124c8a4fe
Git-repo: https://android.googlesource.com/kernel/common/


[nitirawa@codeaurora.org: Ported to 4.19 kernel]
Signed-off-by: default avatarNitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: default avatarAlexander Winkowski <dereference23@outlook.com>
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent 44b78b79
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment