Commit 089f5b64 authored by Asutosh Das's avatar Asutosh Das Committed by Martin K. Petersen

scsi: ufs: full reinit upon resume if link was off

During suspend, if the link is put to off, it would require a full
initialization during resume. This patch resets and restores both the host
and the card during initialization, otherwise host-only reset and restore
would fail occasionally.

Link: https://lore.kernel.org/r/1586844892-22720-1-git-send-email-cang@codeaurora.orgReviewed-by: default avatarBean Huo <beanhuo@micron.com>
Reviewed-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Acked-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Acked-by: default avatarAvri Altman <Avri.Altman@wdc.com>
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9ae58380
......@@ -8055,9 +8055,13 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
else
goto vendor_suspend;
} else if (ufshcd_is_link_off(hba)) {
ret = ufshcd_host_reset_and_restore(hba);
/*
* ufshcd_host_reset_and_restore() should have already
* A full initialization of the host and the device is
* required since the link was put to off during suspend.
*/
ret = ufshcd_reset_and_restore(hba);
/*
* ufshcd_reset_and_restore() should have already
* set the link state as active
*/
if (ret || !ufshcd_is_link_active(hba))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment