{
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);
/* 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);
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);