Bug 101044

Summary: [SKL Xeon DP-to-VGA] no hotplug signal from DP-to-VGA branch device after unplug/replug cycle
Product: DRI Reporter: amy.shih <amy.shih>
Component: DRM/IntelAssignee: amy.shih <amy.shih>
Status: CLOSED WORKSFORME QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: highest CC: amy.shih, chenhan.hsiao.tw, intel-gfx-bugs, mika.kahola
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard: ReadyForDev
i915 platform: SKL i915 features: display/DP
Attachments:
Description Flags
dmesg after booting up the OS with VGA cable connected.
none
dmesg after pull out then pull in the VGA cable (VGA got no signal issue).
none
dmesg after booting up the OS with VGA cable connected.
none
with patch dmesg after pull out VGA cable.
none
with patch dmesg after pull in VGA cable.
none
DP branch device quirk none

Description amy.shih 2017-05-15 02:13:32 UTC
Hi Sir,


We have a product which uses Intel Xeon Processor E3 v5 CPU, we found an issue of I915 graphic driver. The testing OS is CentOS7 with kernel 3.10.0-514.10.2 & the OS only has the text mode, after boot up we plug-out the VGA cable and then plug-in the VGA cable again, then the VGA screen shows no signal. On the same OS we remove the I915 module from initramfs & do the same plug-out & plug-in test again, the VGA screen can still got the signal back.

We also do the same test on WIN10 PRO X64, it doesn’t have the VGA no signal issue. It seems the root cause is the I915 driver, could you assist to check it or do you have newest I915 driver source code for us to do the test? Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 1 krisman 2017-05-16 01:34:38 UTC
Hi,

Your kernel is a very old one.  Since it is provided by your distro, you are better off looking for support on their bugzilla and mailling list, unless you can reproduce it with drm-intel-nightly
Comment 2 amy.shih 2017-05-16 01:42:34 UTC
Hi Sir,

We had also tested on the Fedora 24 with latest kernel 4.10.13-100, it also had the same VGA no signal issue.

I don't know what "drm-intel-nightly" is, could you provide the usage or further information to me? Thank you! 


Amy Shih
Amy.Shih@advantech.com.tw
Comment 3 amy.shih 2017-05-16 05:47:30 UTC
Hi Sir,

We had downloaded & built the "drm-intel-nightly" via below commands:

# git clone git://anongit.freedesktop.org/drm-intel
# make modules_install install

We got the kernel 4.11.0-rc7+ in CentOS Linux release 7.3.1611 (Core). 
Do the VGA
Comment 4 amy.shih 2017-05-16 05:54:29 UTC
Hi Sir,

We had downloaded & built the "drm-intel-nightly" via below commands:

# git clone git://anongit.freedesktop.org/drm-intel
# make modules_install install

Then we got the kernel 4.11.0-rc7+ in CentOS Linux release 7.3.1611 (Core). 
Do the VGA test, it still has the VGA no signal issue. And we remove the I915 module from initramfs from kernel 4.11.0-rc7+ then do the test again, the VGA no signal issue is gone.

We can reproduce it with drm-intel-nightly, please assist to check it, thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 5 krisman 2017-05-17 17:39:47 UTC
(In reply to amy.shih from comment #4)
> Hi Sir,
> 
> We had downloaded & built the "drm-intel-nightly" via below commands:
> 
> # git clone git://anongit.freedesktop.org/drm-intel
> # make modules_install install
> 
> Then we got the kernel 4.11.0-rc7+ in CentOS Linux release 7.3.1611 (Core). 
> Do the VGA test, it still has the VGA no signal issue. And we remove the
> I915 module from initramfs from kernel 4.11.0-rc7+ then do the test again,
> the VGA no signal issue is gone.
> 
> We can reproduce it with drm-intel-nightly, please assist to check it, thank

Thanks for checking.  Can you run your kernel with drm.debug=0xf, reproduce the problem and provide the dmesg?
Comment 6 amy.shih 2017-05-18 03:32:15 UTC
Hi Sir,

We added kernel with drm.debug=0xf, reproduce the problem and recorded the dmesg log as shown in attachments.

[dmesg_after_booting_up.log]:

dmesg after booting up the OS with VGA cable connected.


[dmesg_after_pull_out_VGA.log]:

dmesg after pull out then pull in the VGA cable (VGA got no signal issue).


Amy Shih
Amy.Shih@advantech.com.tw
Comment 7 amy.shih 2017-05-18 03:32:59 UTC
Created attachment 131397 [details]
dmesg after booting up the OS with VGA cable connected.
Comment 8 amy.shih 2017-05-18 03:33:48 UTC
Created attachment 131398 [details]
dmesg after pull out then pull in the VGA cable (VGA got no signal issue).
Comment 9 amy.shih 2017-05-22 07:11:40 UTC
Hi Sir,

Any update on this issue? Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 10 Luis Botello 2017-05-22 20:28:18 UTC
Hi, unfortunately we do not have a Xeon Processor to check this issue. 
However this issue is not seen on an APL NuC on Fedora25 OS with the following kernel:
4.10.15-200.fc25.x86_64
Comment 11 amy.shih 2017-05-23 08:01:07 UTC
Hi Sir,

Did you find any valuable information or the root cause on the demsg log? Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 12 Jani Nikula 2017-05-23 08:49:11 UTC
The hardware in question does not have VGA natively. There's a DP-to-VGA branch adapter. The unplug can be seen in the logs, but there's no hotplug event for the re-plug.

Please try this:

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1ae9de5cf39c..0d28b6dc4153 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2468,6 +2468,8 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
 {
 	int ret, i;
 
+	return;
+
 	/* Should have a valid DPCD by this point */
 	if (intel_dp->dpcd[DP_DPCD_REV] < 0x11)
 		return;
Comment 13 amy.shih 2017-05-25 03:08:35 UTC
Hi Sir,

We added the function "intel_dp_sink_dpmspatch" patch on "drm-intel-nightly" source code & rebuild the kernel, the VGA no signal issue is gone.

We also test the patch on CentOS 7.3.1611 with kernel 3.10.0-514.10.2, the VGA no signal issue is also gone.

Enclosed dmesg logs are for patch on "drm-intel-nightly" source code.

[patch_dmesg_after_boot_up.log]:

dmesg after booting up the OS with VGA cable connected.


[patch_dmesg_after_pull_out_VGA_cable.log]:

dmesg after pull out VGA cable.

[patch_dmesg_after_pull_in_VGA_cable.log]

dmesg after pull in VGA cable.

Could you explain why we need to add this patch to make VGA work & does this patch have any side effect? 

Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 14 amy.shih 2017-05-25 03:09:31 UTC
Created attachment 131498 [details]
dmesg after booting up the OS with VGA cable connected.
Comment 15 amy.shih 2017-05-25 03:11:13 UTC
Created attachment 131499 [details]
with patch dmesg after pull out VGA cable.
Comment 16 amy.shih 2017-05-25 03:11:36 UTC
Created attachment 131500 [details]
with patch dmesg after pull in VGA cable.
Comment 17 Jani Nikula 2017-05-30 07:20:59 UTC
(In reply to amy.shih from comment #13)
> Could you explain why we need to add this patch to make VGA work & does this
> patch have any side effect?

Without the patch, we tell the DP sink (or, in this case, the DP branch device, the DP-to-VGA converter) to go to power save mode when we disable it. Apparently the branch device in question doesn't wake up like other devices, and sleeps forever instead of waking up on hotplug.

If the logs in comment #8 are to be trusted, we really don't get a hotplug event from the branch device anymore, so we won't even try to talk to it to wake it up.

The drawback with the patch is that it'll potentially waste power.
Comment 18 Jani Nikula 2017-05-30 07:24:36 UTC
For upstream the options are to disable power savings everywhere because of some misbehaving sink/branch devices, or to add a sink specific quirk. Unfortunately in this case, the branch device doesn't support DPCD OUI, so I'm not sure what we could base the identification for the quirk on. :(
Comment 19 Ville Syrjala 2017-05-30 15:11:57 UTC
Long ago I came up with this to fix my dongle:
https://lists.freedesktop.org/archives/intel-gfx/2015-July/070788.html
I'll have to re-test to see if my dongle still needs that or not.

Also there's a BRANCH_DEVICE_CTRL register in DPCD which supposedly allows you to select whether short or long pulses are used for HPD notifications. It should default to long pulse, but at least my dongle used to do short pulses by default back when I came up with that patch. I don't think I ever tried to play around with BRANCH_DEVICE_CTRL on my dongle to see if it made any difference. I should do that as well.
Comment 20 steven.j.hockemeier 2017-06-13 17:55:02 UTC
Any updates to this bug?
Comment 21 amy.shih 2017-06-14 00:59:03 UTC
Hi Sir,

Does this patch can be use on any kernel & distribution? Thank you!


Amy Shih
Amy.Shih@advantech.com.tw
Comment 22 Mika Kahola 2017-06-20 10:28:54 UTC
Could a solution here be that if we have a branch device that doesn't support DPCD OUI we set DPMS OFF in that case as Ville's patch suggests?
Comment 23 Ville Syrjala 2017-06-20 14:39:49 UTC
(In reply to Mika Kahola from comment #22)
> Could a solution here be that if we have a branch device that doesn't
> support DPCD OUI we set DPMS OFF in that case as Ville's patch suggests?

We might want to limit this to DPCD 1.1 devices as those don't have the BRANCH_DEVICE_CTRL register, and for DPCD 1.2+ we should perhaps just try to frob BRANCH_DEVICE_CTRL to use long pulses instead. In fact long pulse should be the default, but I'm not sure I'd trust these things that far. Not sure we can even trust that they respect the setting in BRANCH_DEVICE_CTRL at all, but at least we could try it and see.
Comment 24 Mika Kahola 2017-06-21 12:07:57 UTC
Created attachment 132114 [details] [review]
DP branch device quirk

I had something like this patch in mind. As Ville suggested, let's limit this DP branch device quirk only for DPCD 1.1 devices.

As I can't replicate this issue with my Xeon, I would need Amy's support to test this patch if it fixes the issue.
Comment 25 Jani Saarinen 2017-08-02 10:16:59 UTC
Reporter, please respond back if patch done by Mika solves your issue?
Comment 26 Jani Saarinen 2017-08-04 09:24:06 UTC
As no response in timely manner, will close now. 
If this is still issue please check patch attached and report back.
Comment 27 amy.shih 2017-08-04 09:30:52 UTC
Hi Sir,

We will test this patch before September, thank you!


Amy Shih
Amy.Shih@advantech.com.tw
Comment 28 amy.shih 2017-08-25 08:27:50 UTC
Hi Sir,

We want to test the patch on CentOS 7.3.1611 with kernel 3.10.0-514.10.2, but the codes are not matching. We can't find "dpcd_quirk dpcd_quirk_list" & "enum drm_dp_quirk" in CentOS 7.3.1611 source code. Does the patch you provide need to add on special kernel source? Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 29 Mika Kahola 2017-08-25 08:33:22 UTC
Thanks for trying it. The patch should apply on top of the drm-tip kernel. You can clone the kernel from

https://anongit.freedesktop.org/git/drm-tip.git
Comment 30 amy.shih 2017-08-25 08:36:52 UTC
Hi Sir,

If the patch fix the issue on drm-tip kernel. How about other kernel & distribution? Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 31 Mika Kahola 2017-08-25 09:11:46 UTC
If it turns out that the patch fixes the issue on drm-tip it will eventually be merged upstream and later on to distributions. Of course, this will take some time until it surfaces to distribution. 

Of course, there is always a possibility to backport it to earlier kernels.
Comment 32 amy.shih 2017-08-25 09:17:16 UTC
Hi Sir,

Got it. We will test the patch on drm-tip kernel once the board is available and feedback the testing result in here. Thank you!

Amy Shih
Amy.Shih@advantech.com.tw
Comment 33 amy.shih 2017-08-28 03:38:43 UTC
Hi Sir,

We add the patch on drm-tip kernel, and execute below commands:


1. make menuconfig
2. make -j8

Got below errors:

/tmp/ccKOCfDx.o: In function `main':
sign-file.c:(.text.startup+0x40): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x4c): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x652): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/sign-file] Error 1
make[1]: *** Waiting for unfinished jobs....
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
/tmp/cciUZYQG.o: In function `main':
extract-cert.c:(.text.startup+0x15): undefined reference to `OPENSSL_init_crypto'
extract-cert.c:(.text.startup+0x21): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/extract-cert] Error 1
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh

We had tried different versions of openssl as listed in below, but all got the same error. Our building environment is CentOS Linux release 7.3.1611 (Core) with kernel 3.10.0-514.10.2.el7.x86_64.

openssl-1.0.2a
openssl-1.0.2l
openssl-1.0.1g
openssl-1.1.0f
openssl-1.0.1 


Amy Shih
Amy.Shih@advantech.com.tw
Comment 34 Jani Nikula 2017-08-29 13:23:38 UTC
(In reply to amy.shih from comment #33)
> Hi Sir,
> 
> We add the patch on drm-tip kernel, and execute below commands:
> 
> 
> 1. make menuconfig
> 2. make -j8
> 
> Got below errors:

The errors are unrelated to drm/i915.

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.