[COMMON] scsi: ufs: exynos: remove 2 times link startup
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 10:43:00 +0000 (19:43 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:51 +0000 (17:20 +0900)
Change-Id: Ia4661cbc3bbb2e04a29959986d9880dc750174b2
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c

index ccf07d8b4cf3943a2c000b548cb70341ca927136..88cecb18eaff64b9997e18ebd3126d1020679c73 100644 (file)
@@ -4476,19 +4476,9 @@ static int ufshcd_link_startup(struct ufs_hba *hba)
 {
        int ret;
        int retries = DME_LINKSTARTUP_RETRIES;
-       bool link_startup_again = false;
-
 
        ufshcd_hold(hba, false);
-       
-       /*
-        * If UFS device isn't active then we will have to issue link startup
-        * 2 times to make sure the device state move to active.
-        */
-       if (!ufshcd_is_ufs_dev_active(hba))
-               link_startup_again = true;
 
-link_startup:
        do {
                ufshcd_vops_link_startup_notify(hba, PRE_CHANGE);
 
@@ -4514,12 +4504,6 @@ link_startup:
                /* failed to get the link up... retire */
                goto out;
 
-       if (link_startup_again) {
-               link_startup_again = false;
-               retries = DME_LINKSTARTUP_RETRIES;
-               goto link_startup;
-       }
-
        /* Mark that link is up in PWM-G1, 1-lane, SLOW-AUTO mode */
        ufshcd_init_pwr_info(hba);
        ufshcd_print_pwr_info(hba);
@@ -8808,12 +8792,10 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
        pm_runtime_get_sync(dev);
 
        /*
-        * We are assuming that device wasn't put in sleep/power-down
-        * state exclusively during the boot stage before kernel.
-        * This assumption helps avoid doing link startup twice during
-        * ufshcd_probe_hba().
+        * The device-initialize-sequence hasn't been invoked yet.
+        * Set the device to power-off state
         */
-       ufshcd_set_ufs_dev_active(hba);
+       ufshcd_set_ufs_dev_poweroff(hba);
 
        async_schedule(ufshcd_async_scan, hba);
        ufshcd_add_sysfs_nodes(hba);