Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70399030 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan
Browse files

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: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent 758693b4
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -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,