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

Commit f705250a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: don't turn off ref_clk when link is active"

parents 6949de30 dab587b4
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -3943,7 +3943,8 @@ out:
	return ret;
}

static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on)
static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on,
				 bool skip_ref_clk)
{
	int ret = 0;
	struct ufs_clk_info *clki;
@@ -3954,6 +3955,9 @@ static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on)

	list_for_each_entry(clki, head, list) {
		if (!IS_ERR_OR_NULL(clki->clk)) {
			if (skip_ref_clk && !strcmp(clki->name, "ref_clk"))
				continue;

			if (on && !clki->enabled) {
				ret = clk_prepare_enable(clki->clk);
				if (ret) {
@@ -3979,6 +3983,11 @@ out:
	return ret;
}

static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on)
{
	return  __ufshcd_setup_clocks(hba, on, false);
}

static int ufshcd_init_clocks(struct ufs_hba *hba)
{
	int ret = 0;
@@ -4297,8 +4306,11 @@ disable_clks:
			goto set_link_active;
	}

	/* freeze the hardware by turning off the clocks */
	if (!ufshcd_is_link_active(hba))
		ufshcd_setup_clocks(hba, false);
	else
		/* If link is active, device ref_clk can't be switched off */
		__ufshcd_setup_clocks(hba, false, true);

	/*
	 * Disable the host irq as host controller as there won't be any