Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logind: don't act immediately on display connector events in sysfs, they operate asynchronous with a latency #16045

Open
mbevc1 opened this issue Jun 2, 2020 · 4 comments
Labels
downstream/fedora Tracking bugs for Fedora login

Comments

@mbevc1
Copy link

mbevc1 commented Jun 2, 2020

Probable Related: #5451

systemd version the issue has been seen with: systemd-245.4-1.fc32.x86_64

...

Used distribution

Fedora 32

Expected behaviour you didn't see

After initial login system should log user in. Noticed in GNOME and Xorg window manager, not Wayland.

Unexpected behaviour you saw

System going to sleep, instead of loggin user in.

Steps to reproduce the problem
Start system, select Xorg/X11 instead of Wayland and login. Docked T490s Lenovo via USB-c docking. Status is reported docked. Lid is closed.

Also reported upstream: https://bugzilla.redhat.com/show_bug.cgi?id=1840021

Suggestion was:

Yes, slow on the kernel side / too fast on the systemd-logind side. As said I think that logind needs to wait a bit before suspending the machine when the (last) external monitor goes away, as it might only be temporarily going away because the DP MST stuff is being re-enumerated.
@mbevc1 mbevc1 changed the title System goes to sleep instead of loggin user in System goes to sleep instead of loggin user in docked/lid closed Jun 2, 2020
@mbevc1
Copy link
Author

mbevc1 commented Sep 14, 2020

Any progress on this?

@mbevc1
Copy link
Author

mbevc1 commented Sep 15, 2020

Thanks @keszybz. I'll wait and happy to provide more details or investigation.

@galibozek
Copy link

I have the same issue on t480s with dock 40ah

archlinux, systemd 246.6

keszybz added a commit to keszybz/systemd that referenced this issue Oct 10, 2020
…emoved

Hopefully fixes systemd#16045 and https://bugzilla.redhat.com/show_bug.cgi?id=1840021.

When the WM is being started, reprobing of the hardware causes the external
monitor(s) to temporarily disappear. We are too quick and enter suspend when
docked. Let's wait for 5s for the external monitors to reappear before taking
action.

The timeout is set as 5s fully arbitrarily. I think this should be enough, but if
it turns out that some hardware needs more than that, we could increase it.
@poettering poettering changed the title System goes to sleep instead of loggin user in docked/lid closed logind: don't act immediately on display connector events in sysfs, they operate asynchronous with a latency Feb 12, 2021
jankratochvil added a commit to jankratochvil/systemd that referenced this issue May 1, 2021
The problem is logind can incorrectly use HandleLidSwitchExternalPower despite
it should be using HandleLidSwitchDocked as it is difficult to determine
whether the machine is really docked. Besides that the ExternalPower=ignore is
a perfect default preferred by some users and it is less harmful than suspend
which is unexpected and it can also crash many laptops.

Due to a race described below it is happening with X11 (not Wayland) when one
has configured one external display with disabled internal display. The docking
station is Thunderbolt 3 which presents itself only as a USB/Thunderbolt hub.
Then the logind heuristics of multiple displays and/or docking station fails.

systemd#14416
systemd#16045
https://bugzilla.redhat.com/show_bug.cgi?id=1840021
systemd#16077
systemd#15995
systemd#6122
systemd#786
@keszybz
Copy link
Member

keszybz commented Mar 28, 2023

Another downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=2182093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
downstream/fedora Tracking bugs for Fedora login
Development

No branches or pull requests

4 participants