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

Commit 1bba10ef authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

scsi: ufs: Ensure clocks are ON while running power change procedure



UFS driver is not holding clock requests while performing vendor-specific
power change settings. This can lead to un-clocked access if the
context which performs this power change sequence (Eg rls_handler) gets
scheduled out just before this vendor-specific steps and gets a chance
to run after clock gating delay. Clock gating can turn off the clock
during this time and can lead to un-clocked access.

CRs-fixed: 2549002
Change-Id: I49746ed5aa547271fc96cb33656f5fd9db42d07c
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent d976e318
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1402,6 +1402,9 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
	int ret = 0;
	int res = 0;

	hba->ufs_stats.clk_hold.ctx = PWR_CHG_NOTIFY;
	ufshcd_hold(hba, false);

	if (!dev_req_params) {
		pr_err("%s: incoming dev_req_params is NULL\n", __func__);
		ret = -EINVAL;
@@ -1492,6 +1495,8 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
		break;
	}
out:
	hba->ufs_stats.clk_rel.ctx = PWR_CHG_NOTIFY;
	ufshcd_release(hba, false);
	return ret;
}

+1 −0
Original line number Diff line number Diff line
@@ -615,6 +615,7 @@ enum ufshcd_ctx {
	H8_EXIT_WORK,
	UIC_CMD_SEND,
	PWRCTL_CMD_SEND,
	PWR_CHG_NOTIFY,
	TM_CMD_SEND,
	XFR_REQ_COMPL,
	CLK_SCALE_WORK,