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:Asutosh Das <asutoshd@codeaurora.org> Signed-off-by:
Subhash Jadavani <subhashj@codeaurora.org> [cang@codeaurora.org: resolved trivial merge conflicts] Signed-off-by:
Can Guo <cang@codeaurora.org>
Loading
Please register or sign in to comment