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

Commit 742ea849 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: fix ufs power down specs violation in shutdown path"

parents 7ed67e67 a8bc450a
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -10370,7 +10370,7 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)

	/* UFS device & link must be active before we enter in this function */
	if (!ufshcd_is_ufs_dev_active(hba) || !ufshcd_is_link_active(hba))
		goto set_vreg_lpm;
		goto disable_clks;

	if (ufshcd_is_runtime_pm(pm_op)) {
		if (ufshcd_can_autobkops_during_suspend(hba)) {
@@ -10412,9 +10412,6 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
	    ufshcd_is_hibern8_on_idle_allowed(hba))
		hba->hibern8_on_idle.state = HIBERN8_ENTERED;

set_vreg_lpm:
	if (!hba->auto_bkops_enabled)
		ufshcd_vreg_set_lpm(hba);
disable_clks:
	/*
	 * Call vendor specific suspend callback. As these callbacks may access
@@ -10431,6 +10428,13 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
	 */
	ufshcd_disable_irq(hba);

	/* reset the connected UFS device during shutdown */
	if (ufshcd_is_shutdown_pm(pm_op)) {
		ret = ufshcd_assert_device_reset(hba);
		if (ret)
			goto set_link_active;
	}

	if (!ufshcd_is_link_active(hba))
		ret = ufshcd_disable_clocks(hba, false);
	else
@@ -10450,6 +10454,10 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)

	/* Put the host controller in low power mode if possible */
	ufshcd_hba_vreg_set_lpm(hba);
	if (!hba->auto_bkops_enabled ||
		!(req_dev_pwr_mode == UFS_ACTIVE_PWR_MODE &&
		req_link_state == UIC_LINK_ACTIVE_STATE))
		ufshcd_vreg_set_lpm(hba);
	goto out;

set_link_active: