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

Commit 9cb812b9 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by Can Guo
Browse files

scsi: ufs: fix race between hibern8 failure recovery and error handler



If Hibern8 enter/exit fails and we also see some UIC errors at the same
time, we would see following 2 recovery paths running in parallel to
restore the host and device communication.
Context-1: ufshcd_uic_hibern8_exit() -> ufshcd_link_recovery() ->
	   ufshcd_reset_and_restore()
Context-2: ufshcd_err_handler()->ufshcd_reset_and_restore()

This change fixes this race by making the ufshcd_link_recovery() to wait
for the already scheduled ufshcd_err_handler() to finish running and then
schedule the error handler again to make sure that host-device link is
reestablished.

While we are fixing the above race, similar race could happen between
ufshcd_eh_host_reset_handler() and ufshcd_err_handler() hence fix the
error handling in ufshcd_eh_host_reset_handler() same way as fixed in
ufshcd_link_recovery().

CRs-fixed: 1037647
Change-Id: Ic7a17a907e70122968c324e3cbe6e0421c28a2c9
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
[cang@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 558ab211
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