scsi: ufs: enable auto hibern8 only after device initialization

Make sure auto hibern8 is enabled only after both host controller
and device initialization is complete. Enabling it before device
initialization could cause issues as the device might not be ready
to handle hibern8 enter/exit before initialization.

Change-Id: Ia3fb69dca00654dacd8d1faae34715e40e097480
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This commit is contained in:
Venkat Gopalakrishnan 2016-11-04 12:36:55 -07:00
parent 758693b4a6
commit 70399030d0

View file

@ -6908,11 +6908,6 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
if (ret)
goto out;
/* Enable auto hibern8 if supported */
if (ufshcd_is_auto_hibern8_supported(hba))
ufshcd_set_auto_hibern8_timer(hba,
hba->hibern8_on_idle.delay_ms);
/* Debug counters initialization */
ufshcd_clear_dbg_ufs_stats(hba);
/* set the default level for urgent bkops */
@ -6979,6 +6974,13 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
if (ufshcd_scsi_add_wlus(hba))
goto out;
/* Enable auto hibern8 if supported, after full host and
* device initialization.
*/
if (ufshcd_is_auto_hibern8_supported(hba))
ufshcd_set_auto_hibern8_timer(hba,
hba->hibern8_on_idle.delay_ms);
/* Initialize devfreq after UFS device is detected */
if (ufshcd_is_clkscaling_supported(hba)) {
memcpy(&hba->clk_scaling.saved_pwr_info.info,