From f2f9fc347a114b75b2845eed8952623f91f35fa8 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 19:43:00 +0900 Subject: [PATCH] [COMMON] scsi: ufs: exynos: remove 2 times link startup Change-Id: Ia4661cbc3bbb2e04a29959986d9880dc750174b2 Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ccf07d8b4cf3..88cecb18eaff 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -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); -- 2.20.1