Hi Andrey,
On 19/06/2019 08:27, Andrey Smirnov wrote:
@@ -748,22 +748,19 @@ static int tc_set_video_mode(struct tc_data *tc,
 static int tc_wait_link_training(struct tc_data *tc)
 {
-ÂÂÂ u32 timeout = 1000;
ÂÂÂÂÂ u32 value;
ÂÂÂÂÂ int ret;
-ÂÂÂ do {
-ÂÂÂÂÂÂÂ udelay(1);
-ÂÂÂÂÂÂÂ tc_read(DP0_LTSTAT, &value);
-ÂÂÂ } while ((!(value & LT_LOOPDONE)) && (--timeout));
-
-ÂÂÂ if (timeout == 0) {
+ÂÂÂ ret = tc_poll_timeout(tc, DP0_LTSTAT, LT_LOOPDONE,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ LT_LOOPDONE, 1, 1000);
This seems to break DP at least with some monitors for me. I think it's just a timeout problem, as increasing the values helps.
Using ktime, I can see that during link training, the first call takes ~2ms, the second ~7ms. I think this worked before, as udelay(1) takes much longer than 1 us.