Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Admin message
Our infrastructure migration is complete. Please remember to update your SSH remote to point to ssh.gitlab.freedesktop.org; SSH to the old hostname will time out. You should not see any problems apart from that. Please let us know if you do have any other issues.
Summary: Often during wake from sleep there is a brief display flicker (black to GDM login screen, back to black for about 1s, back to GDM login screen), and also there is this error in red text found in dmesg/journalctl -k
Jan 31 08:37:41 flap.local kernel: [drm:intel_dp_start_link_train [i915]] ERROR failed to enable link training
The flicker is cosmetic. And I'm not sure if the red text is even related to the flicker.
Reproducible: 75%
Hardware:
HP Spectre (circa 2016), Firmware Version: F.42 Release Date: 10/25/2018, is current.
kernel 5.0.0-0.rc4.git1.1.fc30.x86_64 is git 4aa9fc2a435a
drm.debug=0x1e is applied
These times are based on a cellphone; the laptop hasn't yet raised wifi to sync with NTP so its clock could be off by multiple seconds.
8:37:31 - approximate time spacebar is pushed to wake laptop
8:37:42 - approximate time of flicker
This journal contains everything from the time of wake through login; about 90 seconds.
The reported flicker happens on the built-in display. At the time of the flicker the external display is still in powersave, its amber light hasn't yet turned green.
Actually in bug 105998 comment 4 suggests I open a new bug, as it's unclear if what I'm seeing in comment 3 is really the same problem as that bug. Anyway, I can test with i915.disable_power_well=0 if that's helpful.
Getting this on ArchLinux with kernel 5.1.3-g7cb9c5d341b9, i7-8700k CPU, no discrete graphics card, motherboard Asus Prime Z370-A, using BIOS version Version 1002 2018/07/06 8.76 MBytes (latest BIOS being Version 2001 2019/05/15 10.31 MBytes, please don't ask me to update), intel-ucode 20190514.a-1 (ie. the MDS one), mesa 19.0.4-1, NOTE: NOT using: xf86-video-intel, libva-intel-driver, libva1-intel-driver.
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop)<br>00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller<br>```<br><br>I think this is why I also get:<br>```<br>$ xrandr --verbose|grep -C2 -w 85|grep --color=always Bad|head -1<br> link-status: Bad <br><br>$ grep -A1 DP-1 /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml|grep -e 'Active' -e 'false'<br> <property name="Active" type="bool" value="false"/><br>```<br><br>seemingly at/after the times when monitor was turned off(or went to sleep?):<br>```<br>[ 4373.521845] [drm:intel_dp_start_link_train [i915]] *ERROR* failed to enable link training<br>[ 6979.762718] [drm:intel_dp_start_link_train [i915]] *ERROR* failed to enable link training<br>```<br><br>Something from `Xorg.0.log`:<br>```<br>...<br>[ 32.021] (II) modeset(0): glamor X acceleration enabled on Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2) <br>...<br>[ 2974.053] (II) modeset(0): Modeline "1280x800"x0.0 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync (49.7 kHz e)<br>[ 4374.136] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>[ 4374.719] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>[ 4378.425] (II) modeset(0): EDID vendor "GSM", prod id 23305<br>...<br>[ 4442.760] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>...<br>[ 4445.432] (II) modeset(0): Modeline "1280x800"x0.0 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync (49.7 kHz e)<br>[ 6980.360] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>[ 6980.926] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>[ 6980.976] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>[ 6981.172] (II) modeset(0): EDID vendor "GSM", prod id 23305<br>...<br>[ 6990.753] (WW) modeset(0): hotplug event: connector 85's link-state is BAD, tried resetting the current mode. You may be leftwith a black screen if this fails...<br>
Can't manually reproduce it, I tried turning monitor off, then back on; tried:
sleep 1; xset dpms force suspend; sleep 1; xset dpms force off; sleep 1; xset dpms force standby<br>setterm --blank force<br>```<br><br>They all seemed to work so far, so the dmesg output with this patch:<br>```diff<br>$ git diff drivers/gpu/drm/i915/intel_dp_link_training.c|tee<br>diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c<br>index b59c87daa4f7..e69b2198af89 100644<br>--- a/drivers/gpu/drm/i915/intel_dp_link_training.c<br>+++ b/drivers/gpu/drm/i915/intel_dp_link_training.c<br>@@ -87,6 +87,7 @@ intel_dp_set_link_train(struct intel_dp *intel_dp,<br> ret = drm_dp_dpcd_write(&intel_dp->aux, DP_TRAINING_PATTERN_SET,<br> buf, len);<br> <br>+ DRM_ERROR("ret=%d len=%d\n", ret, len);<br> return ret == len;<br> }<br> <br>```<br><br>apparently right after the monitor turns on, I get these 5,5,1 each time on dmesg:<br>```<br>$ dmesg --level err<br>[ 3.844322] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 3.846020] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 3.848732] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=1 len=1<br>[ 56.871626] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 56.873573] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 56.874693] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=1 len=1<br>[ 58.212665] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 58.214381] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 58.217124] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=1 len=1<br>[ 103.393851] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 103.395610] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 103.398358] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=1 len=1<br>```<br><br>So this is when it works normally!<br><br>When it doesn't work..., I'll have to update in a next comment when I hit it again. Curious what ret&len I'll get.
while monitor is off, run that monoff script from the prev. comment, yes this:
sleep 1; xset dpms force suspend; sleep 1; xset dpms force off; sleep 1; xset dpms force standby<br>setterm --blank force<br>```<br>3. wait a few seconds to be sure<br>4. press Ctrl key to wake up desktop<br>5. turn on monitor<br><br>got:<br>```<br>[ 694.869217] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=-110 len=5<br>[ 694.869243] [drm:intel_dp_start_link_train [i915]] *ERROR* failed to enable link training<br>[ 695.138593] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=-110 len=1<br>[ 696.768921] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 696.770645] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 696.773386] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=1 len=1<br>```<br><br>Ok I tried it again, but left 10 seconds before actually doing step 5:<br><br>```<br>[ 887.319215] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=-110 len=5<br>[ 887.319254] [drm:intel_dp_start_link_train [i915]] *ERROR* failed to enable link training<br>[ 887.588579] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=-110 len=1<br>[ 898.050275] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 898.052012] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=5 len=5<br>[ 898.054707] [drm:intel_dp_set_link_train [i915]] *ERROR* ret=1 len=1<br>```<br><br>So looks like link is Good afterwards(after step 5 that is), but something keeps track of link as being still Bad (via xrandr) if it once was Bad (10 seconds ago).
linux-stable/usr/include/asm-generic/errno.h
#define ETIMEDOUT 110 /* Connection timed out */
that's the -110 for the ret
it obviously times out because the monitor is physically(from the button) off.
But as soon as it's turned on, all is good again, however that xrandr --verbose still reports connection as Bad... unsure if this is an issue in something else.
tl;dr: for some reason running xrandr every second prevents this from happening.
ok the only reason that I couldn't reproduce it is because(/when) I was running the following in another terminal:
$ while true; do (date; cat /proc/uptime; xrandr --verbose|grep -w 85 -C 2|grep 'link-status: Bad'|| echo "good"); sleep 1; done<br>```<br><br>So while that is running, there's no way I can reproduce it with Comment 13 steps!<br>As soon as I C-c (aka stop) it, bam, steps are good to reproduce.<br>Start that while again and again can't reproduce!<br><br>So, I guess that's a workaround?
ok I have another way to reproduce that bypasses the xrandr run, and it involves switching step 1 with step 2 in Comment 13. So with this, it doesn't matter if xrandr is ran in a while loop, the -110 will happen nonetheless. Kernel tested 5.1.10
The monitor is LG(something) and is connected via the DisplayPort to the ASUS Prime Z370-A motherboard connector and I've no dedicated gfx card, it's using the integrated one from Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (oh I see I've mentioned this in Comment 11 already, the BIOS is the same version still because the next one is probably trojaned xD)
Ok so to summarize, steps from Comment 13 will only work(to reproduce the issue) if you're not running xrandr in a while loop like:
$ while true; do (date; cat /proc/uptime; xrandr --verbose --dryrun --nograb|grep -w 85 -C 2|grep 'link-status: Bad'|| echo "good"); sleep 1; done
but, if you insist on running xrandr like that(or even without --dryrun --nograb) then simply switching step 1 with step 2(aka run 'monoff' first then turn off monitor) then xrandr will have no effect and the issue can be reproduced 100% (or so it seems, to me).
By reproduce the issue I mean:
[ 3946.388708] [drm:intel_dp_set_link_train [i915]] ERROR ret=-110 len=5
[ 3946.388736] [drm:intel_dp_start_link_train [i915]] ERROR failed to enable link training
[ 3946.658135] [drm:intel_dp_set_link_train [i915]] ERROR ret=-110 len=1
...
[ 3950.951159] [drm:intel_dp_set_link_train [i915]] ERROR ret=5 len=5
[ 3950.952869] [drm:intel_dp_set_link_train [i915]] ERROR ret=5 len=5
[ 3950.955573] [drm:intel_dp_set_link_train [i915]] ERROR ret=1 len=1
And in the case when xrandr is ran in a while loop using Comment 13 steps (without swapping steps 1 and 2), only the last 3 dmesg messages from above appear, meaning the issue doesn't occurr.
I'm up for trying any patches/tries that you want me to test, even if they lockup/oops/panic, I have kdump set up and we'll get nice stacktrace and stuff;-) just like in this bug for example: https://bugzilla.kernel.org/show_bug.cgi?id=203849