diff mbox series

[1/3] scsi: ufs: retry link startup if that fails and device state is not active

Message ID 20210205013633.16243-1-dh0421.hwang@samsung.com (mailing list archive)
State Deferred
Headers show
Series [1/3] scsi: ufs: retry link startup if that fails and device state is not active | expand

Commit Message

Remove unnecessary link startup command if it was completed.

UniPro stack is reset and enabled when ufshc is enabled.
The link startup command is issued after enabling ufshc,
if link startup is completed, there is no needed to issue again.

Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 721f55db181f..286f7c918f0e 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4642,13 +4642,13 @@  static int ufshcd_link_startup(struct ufs_hba *hba)
 		ufshcd_update_evt_hist(hba,
 				       UFS_EVT_LINK_STARTUP_FAIL,
 				       (u32)ret);
-		goto out;
-	}
 
-	if (link_startup_again) {
-		link_startup_again = false;
-		retries = DME_LINKSTARTUP_RETRIES;
-		goto link_startup;
+		if (link_startup_again) {
+			link_startup_again = false;
+			retries = DME_LINKSTARTUP_RETRIES;
+			goto link_startup;
+		}
+		goto out;
 	}
 
 	/* Mark that link is up in PWM-G1, 1-lane, SLOW-AUTO mode */