Bug 202579 - [udev] Drm 'change' action do not triggered (trigger delayed)
Summary: [udev] Drm 'change' action do not triggered (trigger delayed)
Status: NEW
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: IA-64 Linux
: P1 normal
Assignee: other_other
Depends on:
Reported: 2019-02-14 06:02 UTC by evilsign
Modified: 2020-07-14 19:13 UTC (History)
8 users (show)

See Also:
Kernel Version: 4.20.7-arch1-1-ARCH
Tree: Mainline
Regression: No


Description evilsign 2019-02-14 06:02:28 UTC
# What have I done:

0. plugin an secondary monitor with HDMI cable to my laptop

1. as root, run:
    [shell]# udevadm monitor -u

2. unplugin HDMI cable

# What expected:

the `udevad monitor` command terminal monitored a change action of drm

# What actually happened:

change action not outputed in `udevadm monitor` command terminal.

# Extra operation after this problem happened:

if I run `xrandr` command, change action showed in `udevadm monitor` command terminal

# More infomation:

I did a little search on internet, and found this [thread](https://bbs.archlinux.org/viewtopic.php?id=220161). I have the exact same problem as floor #3 described.

I'm not sure whether this is a kernel or a video driver problem. Any one knows why this happened ?
Comment 1 Umarov German 2019-03-13 13:15:14 UTC
Have the same bug on Dell Latitude 7480 with Ubuntu 18.04, kernel versions: 4.18.0-16-generic and 5.0.0-050000-generic.
Display is connected through HMDI port.
Comment 2 minatomiray 2019-03-29 23:35:13 UTC
The same problem here. 

OS: Ubuntu 18.04LTS
Kernel: Linux notebook 4.18.0-16-generic #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
HW: Dell Latitude 7490

The udev does not detect the changes because the DRM driver does't:

Use external monitor:
root@notebook:~# cat /sys/class/drm/card0-HDMI-A-1/status 
root@notebook:~# cat /sys/class/drm/card0-HDMI-A-1/status 

<<disconnect now>>
root@notebook:~# cat /sys/class/drm/card0-HDMI-A-1/status 
root@notebook:~# cat /sys/class/drm/card0-HDMI-A-1/status 

<< still connected.

Symtom: the switched off notebook dosplay remains black, so I can't see it. Very annoying when close the LID and then disconnect the notebook and trying to use it e.g. on the train home, no screen. It should be fixed.
Comment 3 gökçe 2019-07-14 07:12:08 UTC
Thinkpad X1 Carbon 3rd Gen (20BT) with 5.2.0-arch2-1-ARCH

I have the same problem, but in my case only a single monitor event gets registered. Only after a reboot I can register another event

1) poweroff and unplug any monitor cable
2) boot
3) $ udevadm monitor
4) plug HDMI cable

at this stage `udevadm monitor` outputs::

  KERNEL[...] change   /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
  UDEV  [...] change   /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)

5) unplug HDMI cable

No change in `udevadm monitor` output

6) plug HDMI cable 

No change in `udevadm monitor` output

The drm driver could be responsible for this.
Comment 4 Guo Yunhe 2019-08-05 17:23:06 UTC
Same problem here with openSUSE Tumbleweed, kernel 5.2.3-1
Comment 5 Guo Yunhe 2019-11-10 14:01:25 UTC
Can we crowdfund experts to fix this bug? I find some platform like Bountysource
Comment 6 minatomiray 2019-11-10 14:56:06 UTC
@Guo Yunhe:

Looks better for now. Switching simultaneously with newer kernel.

Tested on U18.04LTS + Kernel v5.3.8: works now.

Kernel installed from: https://kernel.ubuntu.com/~kernel-ppa/mainline/

uname -a
Linux notebook 5.3.8-050308-generic #201910290940 SMP Tue Oct 29 09:43:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Comment 7 Guo Yunhe 2019-11-10 15:35:39 UTC
I also upgraded to kernel 5.3.8 on openSUSE Tumbleweed. Will give it a try for some days and see if I can still reproduce this issue.
Comment 8 Guo Yunhe 2019-11-13 09:30:45 UTC
During last four days, I plug and unplug HDMI for many times, in both sleep/awake mode, on different monitors. This issue doesn't seem to happen anymore.

However, another user can still reproduce it with newer 5.3.10 kernel (Arch/Manjaro): https://bugs.kde.org/show_bug.cgi?id=372837#c12

Maybe it is distribution specific (firmware difference?) or driver/hardware specific?

Mine configuration:

Operating System: openSUSE Tumbleweed 20191109
KDE Plasma Version: 5.17.2
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Kernel Version: 5.3.8-1-default
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 31.1 GiB
Comment 9 Guo Yunhe 2019-11-20 09:34:35 UTC
I have been trying unplugging HDMI for a week. And I found a thing interesting:

1. If I unplug HDMI cable very fast, as fast as my hand can move, system always recognize that HDMI has been unplugged.
2. But if I unplug HDMI cable slowly, very slow movement, system cannot recognize that HDMI has been unplugged.
Comment 10 Nate Graham 2019-12-11 08:49:55 UTC
We've gotten various reports of this no longer being an issue in the very latest kernels. Can anyone confirm?
Comment 11 minatomiray 2019-12-11 09:12:31 UTC
I can confirm, that it is not a problem anymore, I use U18.04LTS + new 5.3 kernel, but it wasn't an issue on 5.2 as well:

5.3.13-050313-generic #201911240840 SMP Sun Nov 24 08:43:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Comment 12 Nate Graham 2019-12-11 09:36:20 UTC
Awesome. I don't have the power to close this; maybe someone with can power can do so?
Comment 13 Andrey Melentyev 2019-12-30 10:23:44 UTC
There seems to have been a fix for Intel GPUs recently: https://bugs.freedesktop.org/show_bug.cgi?id=107125#c22 that made it into 5.4.

But running 5.5-rc4 on Thinkpad X1 Extreme Gen 1 and, the problem is still reproducible, just as it was on 5.3.x and 5.4.x. The HDMI port in this laptop is wired to the NVIDIA card, I'm using nouveau driver.

Happy to provide debugging info or try out patches.
Comment 14 EYahia 2020-07-14 19:13:33 UTC
The problem still occurs with 5.5.7-arch1-1 kernel on Thinkpad X1 Extreme Gen 1.

Note You need to log in before you can comment on or make changes to this bug.