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

Commit d8360007 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

drm/msm/dp: fix controller no-clock register access



While switching controller on, cable may get disconnected
which sets abort flag in controller module. If the abort
flag is set, controller power on is skipped resulting in
related clocks to remain off. In case of suspend/resume,
this can cause an issue as resume assumes that the controller
is already up. Fix it by making sure controller power on
sequence switches the related clocks on. If the abort has
been set, the disconnect sequence switches the clocks off.

CRs-Fixed: 2350611
Change-Id: I1ee4684a69ca23e3741d5505a0a19e40056bd804
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 441b78b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -529,6 +529,7 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux,
			timeout = wait_for_completion_timeout(&aux->comp, HZ);
			if (!timeout) {
				pr_err("aux timeout for 0x%x\n", msg->address);
				atomic_set(&aux->aborted, 1);
				ret = -ETIMEDOUT;
				goto end;
			}
+6 −5
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl, bool shallow)
	catalog->phy_lane_cfg(catalog, ctrl->orientation,
				link_params->lane_count);

	while (--link_train_max_retries && !atomic_read(&ctrl->aborted)) {
	do {
		pr_debug("bw_code=%d, lane_count=%d\n",
			link_params->bw_code, link_params->lane_count);

@@ -597,8 +597,10 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl, bool shallow)
		 * even though the cable is removed. Disconnect interrupt
		 * will eventually trigger and shutdown DP.
		 */
		if (shallow)
		if (shallow) {
			rc = 0;
			break;
		}

		dp_ctrl_link_rate_down_shift(ctrl);

@@ -607,7 +609,7 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl, bool shallow)

		/* hw recommended delays before retrying link training */
		msleep(20);
	}
	} while (--link_train_max_retries && !atomic_read(&ctrl->aborted));

	return rc;
}
@@ -1134,8 +1136,7 @@ static int dp_ctrl_on(struct dp_ctrl *dp_ctrl, bool mst_mode, bool shallow)
		ctrl->link->link_params.lane_count);

	rc = dp_ctrl_link_setup(ctrl, shallow);
	/* Ignore errors in case of shallow processing */
	if (!shallow && rc)
	if (rc)
		goto end;

	ctrl->power_on = true;
+8 −5
Original line number Diff line number Diff line
@@ -333,12 +333,15 @@ static int dp_power_clk_enable(struct dp_power *dp_power,
	else if (pm_type == DP_LINK_PM)
		power->link_clks_on = enable;

	pr_debug("%s clocks for %s\n",
			enable ? "enable" : "disable",
			dp_parser_pm_name(pm_type));
	pr_debug("link_clks:%s core_clks:%s strm0_clks:%s strm1_clks:%s\n",
		power->link_clks_on ? "on" : "off",
	/*
	 * This log is printed only when user connects or disconnects
	 * a DP cable. As this is a user-action and not a frequent
	 * usecase, it is not going to flood the kernel logs. Also,
	 * helpful in debugging the NOC issues.
	 */
	pr_info("core:%s link:%s strm0:%s strm1:%s\n",
		power->core_clks_on ? "on" : "off",
		power->link_clks_on ? "on" : "off",
		power->strm0_clks_on ? "on" : "off",
		power->strm1_clks_on ? "on" : "off");
error: