Skip to contentSkip to conversation

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

PATCH Applied Can Guo 2 participants 2 messages Apr 14, 2020 – Apr 17, 2020

Subsystems (2)
lore
Share & tools
lore

Can Guo

author
#0 lore raw

PATCH v2 1/1 scsi: ufs: full reinit upon resume if link was off

From: Asutosh Das <[email protected]>

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.

Change since v1:
- Incorporated Alim's comments.

---
 drivers/scsi/ufs/ufshcd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +6 -2
index 64e42ef..90313c8 100644
@@ -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))
Signature · 1 line
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#1 lore raw

Can,

Quoted 4 lines

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!

Quoted 6 lines
Quoted 6 lines

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.

Signature · 6 lines
Martin K. Petersen	Oracle Linux Engineering

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel