Răsfoiți Sursa

disp: msm: dp: fix the check for link maintenance

Current implementation checks for loss of channel equilization
or clock recovery only if the sink sets the link status updated
bit in the DPCD. However, it is possible that the sink can issue
an IRQ HPD to notify a link loss without setting the link status
updated field. Update the implementation to perform a link
maintenance whenever clock recovery or channel equalization is not
ok irrespective of whether the link status updated bit is set.

Change-Id: I2d765236b1e8ddae3c410087406546d0422cdf07
Signed-off-by: Aravind Venkateswaran <[email protected]>
Aravind Venkateswaran 4 ani în urmă
părinte
comite
5ba397e17e
1 a modificat fișierele cu 9 adăugiri și 13 ștergeri
  1. 9 13
      msm/dp/dp_link.c

+ 9 - 13
msm/dp/dp_link.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
  */
 
 #include "dp_link.h"
@@ -1113,19 +1113,15 @@ static u8 get_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r)
  */
 static int dp_link_process_link_status_update(struct dp_link_private *link)
 {
-	if (!(get_link_status(link->link_status, DP_LANE_ALIGN_STATUS_UPDATED) &
-		DP_LINK_STATUS_UPDATED) || /* link status updated */
-		(drm_dp_clock_recovery_ok(link->link_status,
-			link->dp_link.link_params.lane_count) &&
-	     drm_dp_channel_eq_ok(link->link_status,
-			link->dp_link.link_params.lane_count)))
-		return -EINVAL;
-
+	bool channel_eq_done = drm_dp_channel_eq_ok(link->link_status,
+			link->dp_link.link_params.lane_count);
+	bool clock_recovery_done = drm_dp_clock_recovery_ok(link->link_status,
+			link->dp_link.link_params.lane_count);
 	DP_DEBUG("channel_eq_done = %d, clock_recovery_done = %d\n",
-			drm_dp_channel_eq_ok(link->link_status,
-			link->dp_link.link_params.lane_count),
-			drm_dp_clock_recovery_ok(link->link_status,
-			link->dp_link.link_params.lane_count));
+			channel_eq_done, clock_recovery_done);
+
+	if (channel_eq_done && clock_recovery_done)
+		return -EINVAL;
 
 	return 0;
 }