浏览代码

disp: msm: dp: set ctrl power_on flag when link clock is on

While running DP simulation script for stability and the rare
occasions when link clock fails to enable, the ctrl power_on
flag is wrongly set indicating the link is powered on. This
flag is used in the ctrl sub-module to check that the link
clock is on before accessing the registers powered by the
link clock. When this flag is wrongly set, the link registers
are accessed while processing the cable disconnect to cause a
NOC error.

The change will ensure the power_on flag is set when the link
clock is on so that the access to registers in the link clock
domain can be correctly filtered by the power_on flag.

Change-Id: I40af054a5738172f5ea86079a9258518f8fdd44e
Signed-off-by: Sankeerth Billakanti <[email protected]>
Signed-off-by: Tatenda Chipeperekwa <[email protected]>
Sankeerth Billakanti 5 年之前
父节点
当前提交
a457a0ada9
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      msm/dp/dp_ctrl.c

+ 5 - 2
msm/dp/dp_ctrl.c

@@ -723,8 +723,10 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl, bool shallow)
 			break;
 		}
 
-		if (!link_train_max_retries || atomic_read(&ctrl->aborted))
+		if (!link_train_max_retries || atomic_read(&ctrl->aborted)) {
+			dp_ctrl_disable_link_clock(ctrl);
 			break;
+		}
 
 		if (rc != -EAGAIN)
 			dp_ctrl_link_rate_down_shift(ctrl);
@@ -1319,7 +1321,8 @@ static int dp_ctrl_on(struct dp_ctrl *dp_ctrl, bool mst_mode,
 	ctrl->initial_bw_code = ctrl->link->link_params.bw_code;
 
 	rc = dp_ctrl_link_setup(ctrl, shallow);
-	ctrl->power_on = true;
+	if (!rc)
+		ctrl->power_on = true;
 end:
 	return rc;
 }