* [PATCH v2 1/1] scsi: ufs: full reinit upon resume if link was off
@ 2020-04-14 6:14 Can Guo
2020-04-17 21:26 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Can Guo @ 2020-04-14 6:14 UTC (permalink / raw)
To: asutoshd, nguyenb, hongwus, rnayak, linux-scsi, kernel-team,
saravanak, salyzyn, cang
Cc: Alim Akhtar, Avri Altman, James E.J. Bottomley,
Martin K. Petersen, Matthias Brugger, Stanley Chu, Bean Huo,
Bart Van Assche, Venkat Gopalakrishnan, Tomas Winkler, open list,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support
From: Asutosh Das <asutoshd@codeaurora.org>
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 may fail occasionally.
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Can Guo <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>
Change since v1:
- Incorporated Alim's comments.
---
drivers/scsi/ufs/ufshcd.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 64e42ef..90313c8 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8048,9 +8048,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))
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/1] scsi: ufs: full reinit upon resume if link was off
2020-04-14 6:14 [PATCH v2 1/1] scsi: ufs: full reinit upon resume if link was off Can Guo
@ 2020-04-17 21:26 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2020-04-17 21:26 UTC (permalink / raw)
To: Can Guo
Cc: asutoshd, nguyenb, hongwus, rnayak, linux-scsi, kernel-team,
saravanak, salyzyn, Alim Akhtar, Avri Altman,
James E.J. Bottomley, Martin K. Petersen, Matthias Brugger,
Stanley Chu, Bean Huo, Bart Van Assche, Venkat Gopalakrishnan,
Tomas Winkler, open list,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support
Can,
> 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 may fail occasionally.
Applied to 5.8/scsi-queue, thanks!
> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
> Signed-off-by: Can Guo <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>
>
> Change since v1:
> - Incorporated Alim's comments.
>
> ---
> drivers/scsi/ufs/ufshcd.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Don't forget to put the changelog after the "---" separator.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-17 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 6:14 [PATCH v2 1/1] scsi: ufs: full reinit upon resume if link was off Can Guo
2020-04-17 21:26 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).