aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-08-01 18:02:20 -0400
committerKeith Packard <keithp@keithp.com>2011-08-01 18:24:18 -0400
commit11bee43ebba0bfc92165c059f6e9869197ea8889 (patch)
tree6bc213dfd279525f0400524ac31641ed8fa7e172
parentcda2bb78c24de7674eafa3210314dc75bed344a6 (diff)
drm/i915/dp: wait for previous AUX channel activity to clear
Before initiating a new read or write on the DP AUX channel, wait for any outstanding activity to complete. This may happen during normal retry behavior. If the wait fails (i.e. after 1ms the AUX channel is still busy) dump a backtrace to make the caller easier to spot. v2: use msleep instead, and timeout after 3ms (only ever saw 1 retry with msleep in testing) v3: fix backtrace check to trigger if the 3ms wait times out Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38136. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 449364187bc0..ba72fbcbbbc9 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -315,9 +315,17 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
315 else 315 else
316 precharge = 5; 316 precharge = 5;
317 317
318 if (I915_READ(ch_ctl) & DP_AUX_CH_CTL_SEND_BUSY) { 318 /* Try to wait for any previous AUX channel activity */
319 DRM_ERROR("dp_aux_ch not started status 0x%08x\n", 319 for (try = 0; try < 3; try++) {
320 I915_READ(ch_ctl)); 320 status = I915_READ(ch_ctl);
321 if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
322 break;
323 msleep(1);
324 }
325
326 if (try == 3) {
327 WARN(1, "dp_aux_ch not started status 0x%08x\n",
328 I915_READ(ch_ctl));
321 return -EBUSY; 329 return -EBUSY;
322 } 330 }
323 331