Bug 69128

Summary: [IVB dp dongle] Apple miniDP-to-VGA fails link training
Product: DRI Reporter: shui yangwei <yangweix.shui>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: major    
Priority: medium CC: gokcen.eraslan, intel-gfx-bugs, jinxianx.guo, lei.a.liu, mika.kuoppala, qingshuai.tian, yi.sun
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg: miniDP-to-VGA cause machine boot up with "ERROR"
none
dmesg: with Mika's patch on latest -next-queued kernel
none
dmesg: on latest -nightly none

Description shui yangwei 2013-09-09 06:35:35 UTC
Created attachment 85479 [details]
dmesg: miniDP-to-VGA cause machine boot up with "ERROR"

Environment:
-------------------
Kernel: (drm-intel-next-queued)da66146425c3136943452988afd3d64cd551da58
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Fri Sep 6 16:03:28 2013 +0300

    drm/i915: include hangcheck action and score in error_state

lspci:
--------------------
00:02.0 VGA compatible controller: Intel Corporation Device 0162 (rev 09)

Description:
--------------------
When machine boot up with miniDP-to-VGA, there's "Error" in dmesg. I have tried many older kernels, and can't find a good commit.
Both -next-queued and -fixes branches reproducible.
Other IVB machines like desktop and mobile haven't come up such issue. 
Other display adapter like miniDP-to-DVI/DP/HDMI work well.

Test Step:
--------------------
1. plugged in miniDP-to-VGA
2. reboot machine
3. check dmesg

Error type:
-------------------
[drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
Comment 1 Daniel Vetter 2013-09-09 08:00:06 UTC
I'm confused: Subject says miniDP-to-HDMI, but everything else is about VGA. Which one is it?
Comment 2 shui yangwei 2013-09-09 08:32:48 UTC
(In reply to comment #1)
> I'm confused: Subject says miniDP-to-HDMI, but everything else is about VGA.
> Which one is it?

Sorry, I miswrite the title, It's miniDP-to-VGA, not DP.
Comment 3 Jani Nikula 2013-09-10 14:01:01 UTC
Please try Mika's patch from:
https://bugs.freedesktop.org/show_bug.cgi?id=60263#c10
Comment 4 shui yangwei 2013-09-12 02:40:05 UTC
Created attachment 85682 [details]
dmesg: with Mika's patch on latest -next-queued kernel

(In reply to comment #3)
> Please try Mika's patch from:
> https://bugs.freedesktop.org/show_bug.cgi?id=60263#c10

This patch doesn't fix this error. I applied Mika's patch on latest -next-queued kernel, and this issue also exists. Like below listed:

[root@x-ivb17 ~]# dmesg | grep -i "error"
[    4.673347] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.677734] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.770181] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.772661] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.775185] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.777690] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.780363] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up
[    4.782871] [drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up


I append the dmesg here, maybe it can help you.
Comment 5 Jani Nikula 2013-09-12 10:15:28 UTC
Please try intel-dp-fixes branch of git://gitorious.org/jani/drm.git. It's intel-drm-nightly plus some DP aux fixes.
Comment 6 shui yangwei 2013-09-13 01:41:17 UTC
(In reply to comment #5)
> Please try intel-dp-fixes branch of git://gitorious.org/jani/drm.git. It's
> intel-drm-nightly plus some DP aux fixes.

I fetched intel-dp-fixes branch of this repo to Daniel's tree, then build a kernel, this issue come up again.

The commit witch I test is:
commit c030533419ec5f9ce042bafb6f40368f310181f8
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Sep 11 14:46:20 2013 +0300

    drm/i915/dp: read DPCD PSR capability only on eDP

    Reduce AUX transactions for non-eDP.

    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Comment 7 Jani Nikula 2013-09-13 06:45:40 UTC
(In reply to comment #6)
> I fetched intel-dp-fixes branch of this repo to Daniel's tree, then build a
> kernel, this issue come up again.

Hmm, please try the below patch on top of:

> commit c030533419ec5f9ce042bafb6f40368f310181f8
> Author: Jani Nikula <jani.nikula@intel.com>
> Date:   Wed Sep 11 14:46:20 2013 +0300
> 
>     drm/i915/dp: read DPCD PSR capability only on eDP

Thanks.

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 08f9d2d..97063b3 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -677,7 +677,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
 			 */
 			if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
 			    DP_DWN_STRM_PORT_PRESENT)
-				usleep_range(500, 600);
+				usleep_range(5000, 7000);
 			else
 				usleep_range(300, 400);
 			continue;
Comment 8 Jani Nikula 2013-09-13 06:53:27 UTC
Also, have you tried different VGA cables between the dongle and the display? Have you tried the cable and the display directly in a VGA port?
Comment 9 shui yangwei 2013-09-16 02:07:44 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > I fetched intel-dp-fixes branch of this repo to Daniel's tree, then build a
> > kernel, this issue come up again.
> 
> Hmm, please try the below patch on top of:
> 
> > commit c030533419ec5f9ce042bafb6f40368f310181f8
> > Author: Jani Nikula <jani.nikula@intel.com>
> > Date:   Wed Sep 11 14:46:20 2013 +0300
> > 
> >     drm/i915/dp: read DPCD PSR capability only on eDP
> 
> Thanks.
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 08f9d2d..97063b3 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -677,7 +677,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int
> mode,
>  			 */
>  			if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
>  			    DP_DWN_STRM_PORT_PRESENT)
> -				usleep_range(500, 600);
> +				usleep_range(5000, 7000);
>  			else
>  				usleep_range(300, 400);
>  			continue;

Test with this patch, this issue also reproduceable.
Comment 10 shui yangwei 2013-09-16 02:12:51 UTC
(In reply to comment #8)
> Also, have you tried different VGA cables between the dongle and the
> display? Have you tried the cable and the display directly in a VGA port?

Yes, I have used different VGA cables to recheck  this bug, and the result is the same with before. 

This bug is reported on Apple MacBook Pro, there's only miniDP-to-someting. We have other IVB machine to test direct VGA port, and doesn't have this issue.
Comment 11 Jani Nikula 2013-10-11 11:04:14 UTC
I think we've fixed some more DP stuff even after the last comments, so please retry on current drm-intel-nightly. Attach full dmesg with drm.debug=0xe if it doesn't work. Thanks.
Comment 12 shui yangwei 2013-10-12 01:17:29 UTC
(In reply to comment #11)
> I think we've fixed some more DP stuff even after the last comments, so
> please retry on current drm-intel-nightly. Attach full dmesg with
> drm.debug=0xe if it doesn't work. Thanks.

On current -nightly, this error is gone. Closed here.
Comment 13 shui yangwei 2013-10-12 01:28:00 UTC
Created attachment 87495 [details]
dmesg: on latest -nightly

Sorry, I haven't find error at the first time reboot with current -nightly, then I tested latest -next-queued kernel, the error reproduced. After this, I turned back to boot up with current -nightly kernel, this error also appeared. It's weird. Dmesg is appended, please have a look. Thx.
Comment 14 Imre Deak 2013-12-05 15:44:05 UTC
The '[drm:intel_dp_i2c_aux_ch] *ERROR* too many retries, giving up' looks like a VGA EDID read error.

The first dmesg had also a 'too many voltage retries, give up' error, which is not in the latest dmesg any more, so I assume that's been fixed meanwhile.

As for the EDID issue: despite the error message the modeset seems to succeed using a default mode; is the display on or blank for you?

Could you check if your VGA cable is DDC-2 compatible? There are cables out there without pin 9,12,15 properly wired and with those you won't be able to read the EDID. You can check this by using the cable on another machine and checking with xrandr if all the modes supported by the display are listed.
Comment 15 Qingshuai Tian 2013-12-12 07:31:38 UTC
(In reply to comment #14)

> As for the EDID issue: despite the error message the modeset seems to
> succeed using a default mode; is the display on or blank for you?

The display is on. It  work normally even when boot up with the error message.
 
> Could you check if your VGA cable is DDC-2 compatible? There are cables out
> there without pin 9,12,15 properly wired and with those you won't be able to
> read the EDID. You can check this by using the cable on another machine and
> checking with xrandr if all the modes supported by the display are listed.

I plugged the cable on another machine and get the information with xrandr:

 VGA1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm
   1920x1080      60.0*+
   1680x1050      60.0
   1280x1024      75.0     60.0
   1440x900       75.0     59.9
   1280x960       60.0
   1152x864       75.0
   1280x720       60.0
   1024x768       75.1     70.1     60.0
   832x624        74.6
   800x600        72.2     75.0     60.3     56.2
   640x480        75.0     72.8     66.7     60.0
   720x400        70.1 

But sorry that I'm not sure how to confirm whether all the modes of the display are listed or not. I hope to hear from you. Thanks :)
Comment 16 Jani Nikula 2014-09-05 09:19:30 UTC
Timeout. Please re-test with current drm-intel-nightly.
Comment 17 yaoming 2014-09-22 07:22:04 UTC
(In reply to comment #16)
> Timeout. Please re-test with current drm-intel-nightly.

This bug does not appear on the latest drm-intel-nightly(c5660b4ad395f1e34eacc22cf81c687edfc9c83c).
Comment 18 Rodrigo Vivi 2014-09-22 23:21:09 UTC
So the error got fixed upstream.

feel free to reopen the bug if you start facing it again on drm-intel-nightly.
Comment 19 Elizabeth 2017-10-06 14:43:24 UTC
Closing old verified.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.