Commit dd77d5a3 authored by Can Guo's avatar Can Guo Committed by Todd Kjos
Browse files

BACKPORT: FROMGIT: scsi: ufs: Abort tasks before clearing them from doorbell

To recover non-fatal errors, no full reset is required, err_handler only
clears those pending TRs/TMRs so that SCSI layer can re-issue them. In
current err_handler, TRs are directly cleared from UFS host's doorbell but
not aborted from device side. However, according to the UFSHCI JEDEC spec,
the host software shall use UTP Transfer Request List Clear Register to
clear a task from UFS host's doorbell only when a UTP Transfer Request is
expected to not be completed, e.g. when the host software receives a
“FUNCTION COMPLETE” Task Management response which means a Transfer Request
was aborted. To follow the UFSHCI JEDEC spec, in err_handler, abort one TR
before clearing it from doorbell.

Link: https://lore.kernel.org/r/1598321228-21093-2-git-send-email-cang@codeaurora.org


Acked-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>

Bug: 168074492
(cherry picked from commit 307348f6
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git

 5.10/scsi-queue)
Change-Id: Id852ec693fcc7151072e349015c0127dd061d7b7
[can: Resolved minor conflict in ufshcd.c]
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent fb663831
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment