summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs
diff options
context:
space:
mode:
authorAsutosh Das <asutoshd@codeaurora.org>2020-04-14 09:14:48 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-04-18 00:24:46 +0300
commit089f5b64b8af10aaef176f91144275d25e71e2ff (patch)
tree641ba5d304fb5a0ca354c9097c341dcef98a540c /drivers/scsi/ufs
parent9ae583804a331594fc91c87719d404e0dc73034a (diff)
downloadlinux-089f5b64b8af10aaef176f91144275d25e71e2ff.tar.xz
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.org Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Acked-by: Stanley Chu <stanley.chu@mediatek.com> Acked-by: Avri Altman <Avri.Altman@wdc.com> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r--drivers/scsi/ufs/ufshcd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 698e8d20b4ba..7d1fa1349d40 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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))