[HP, Dell notebooks] suspends on closed lid, does not recognized external monitors/dock

Bug #1450009 reported by inode77 on 2015-04-29
118
This bug affects 26 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
High
Martin Pitt

Bug Description

Using systemd as init system on a HP zbook15 notebook having 2 external monitors connected using a docking station and starting with lid closed the system goes to sleep after successfully booting and starting lightdm greeter. Sometimes there's enough time to enter username and password but system goes to sleep every time after a few seconds.
The system can be woken up and used after this happens but it will not let me shutdown later.

The problem is just present in docked situation starting with closed lid using systemd a init system.

If notebook is used in non-docked situation with open lid and systemd the problem does not occur.

Workaround: A switch back to upstart as init system resolves the issue.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: systemd-sysv 219-7ubuntu3
ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
Uname: Linux 3.19.0-15-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
Date: Wed Apr 29 14:46:09 2015
InstallationDate: Installed on 2015-04-27 (1 days ago)
InstallationMedia: Xubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422.1)
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)

inode77 (simon-gerber) wrote :
Martin Pitt (pitti) wrote :

So it seems logind neither recognizes the dock nor the multiple monitors. Can you please do the following:

  grep -r . /sys/class/drm/* > /tmp/monitors.txt
  journalctl -b > /tmp/journal.txt

after this happens, and attach /tmp/monitors.txt and /tmp/journal.txt here? Thanks!

Changed in systemd (Ubuntu):
status: New → Incomplete
summary: - systemd started xubuntu 15.04 lets system sleep after boot and start of
- lightdm greeter
+ suspends on closed lid, does not recognized external monitors/dock

Upon waking the login screen from forced sleep the system goes to sleep again and again and again after 20-30sec upon leaving the system on login screen.
I thought upstart was a cure but am not so sure anymore because it started happening there too.

$ cat /tmp/monitors.txt
/sys/class/drm/card0/dev:226:0
/sys/class/drm/card0/power/control:auto
/sys/class/drm/card0/power/async:disabled
/sys/class/drm/card0/power/runtime_enabled:disabled
/sys/class/drm/card0/power/runtime_active_kids:0
/sys/class/drm/card0/power/runtime_active_time:0
grep: /sys/class/drm/card0/power/autosuspend_delay_ms: Input/output error
/sys/class/drm/card0/power/runtime_status:unsupported
/sys/class/drm/card0/power/runtime_usage:0
/sys/class/drm/card0/power/runtime_suspended_time:0
/sys/class/drm/card0/uevent:MAJOR=226
/sys/class/drm/card0/uevent:MINOR=0
/sys/class/drm/card0/uevent:DEVNAME=dri/card0
/sys/class/drm/card0/uevent:DEVTYPE=drm_minor
/sys/class/drm/version:drm 1.1.0 20060810

$ xrandr --query
Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384
VGA-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected (normal left inverted right x axis y axis)
   1920x1080 60.0 + 40.0
DP-4 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200 60.0*+ 59.9
   1920x1080 60.0 59.9 50.0 24.0 60.1 60.0 50.0
   1600x1200 60.0
   1280x1024 75.0 60.0
   1280x720 60.0 59.9 50.0
   1152x864 75.0
   1024x768 75.0 60.0
   800x600 75.0 60.3
   720x576 50.0 50.1
   720x480 59.9 60.1
   640x480 75.0 59.9 59.9
DP-5 disconnected (normal left inverted right x axis y axis)
DP-6 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200 60.0*+ 59.9
   1920x1080 60.0 59.9 50.0 24.0 60.1 60.0 50.0
   1600x1200 60.0
   1280x1024 75.0 60.0
   1280x720 60.0 59.9 50.0
   1152x864 75.0
   1024x768 75.0 60.0
   800x600 75.0 60.3
   720x576 50.0 50.1
   720x480 59.9 60.1
   640x480 75.0 59.9 59.9

I have a similar problem: When having my notebook (Lenovo T430) in the dock, the external monitor is recognized, I see the login screen, but as soon as I log in, the notebook goes to sleep.

Martin Pitt (pitti) on 2015-06-02
Changed in systemd (Ubuntu):
status: Incomplete → New
Martin Pitt (pitti) wrote :

Background: logind has some "failsafe" logic to go to suspend after 30 s if the lid is closed and there are no external monitors connected (http://cgit.freedesktop.org/systemd/systemd/commit/?id=ed4ba7e4f65215). This would lead to effects like this if the lid switch is broken and always says "closed" (like in bug 1438301), and monitor detection fails (like in this case - /sys/class/drm does not have multiple outputs).

So there are two things to fix here:

 - Investigate why on this system the lid switch always reports "closed"

 - Dial back the failsafe to not get engaged if the lid switch reports "closed" right from the start when systemd boots. In that case it's clearly broken, as "normal" laptops don't boot with the lid closed.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
importance: Undecided → High
Carl Rice (rice-carl) wrote :

Also seeing this issue when simply closing laptop lid (Razer Blade 2015). Clicking Suspend does not trigger this bug. It does NOT trigger if I click Suspend, close lid, re-open lid. It only seems to trigger when physically closing the lid while the machine is on.

Martin Pitt (pitti) wrote :

This was reworked recently in https://github.com/systemd/systemd/commit/602a41c22a . That fix will soon enter Wily (current development series), but for you I backported it to 15.04 in https://launchpad.net/~pitti/+archive/ubuntu/sru-test . Could you please enable that PPA, upgrade, and check if that helps?

Note, that PPA has nothing else in it, so it's safe to upgrade (no need to install packages individually).

Kevin Klinger (kevin-klinger) wrote :

I have an HP zbook 15 G2 in the advanced dock and am having the same problem of the system suspending on boot wit the lid closed. I tried the PPA but the problem is still there. I've attached the output of the commands you requested above that were taken after the PPA was applied.

cat /tmp/monitors.txt
/sys/class/drm/card0/dev:226:0
/sys/class/drm/card0/power/control:auto
/sys/class/drm/card0/power/async:disabled
/sys/class/drm/card0/power/runtime_enabled:disabled
/sys/class/drm/card0/power/runtime_active_kids:0
/sys/class/drm/card0/power/runtime_active_time:0
/sys/class/drm/card0/power/runtime_status:unsupported
/sys/class/drm/card0/power/runtime_usage:0
/sys/class/drm/card0/power/runtime_suspended_time:0
/sys/class/drm/card0/uevent:MAJOR=226
/sys/class/drm/card0/uevent:MINOR=0
/sys/class/drm/card0/uevent:DEVNAME=dri/card0
/sys/class/drm/card0/uevent:DEVTYPE=drm_minor
/sys/class/drm/version:drm 1.1.0 20060810

I applied the fix from the ppa yesterday, but the problem is still present. This is on a Dell E6420, docked to an E-port Replicator Plus with a pair of external monitors.

Andreas Schultz (aschultz) wrote :

I have the same problem on an HP EliteBook 8560w (with AMD GPU running fglrx driver) in an HP Docking Station.

In this setup, systemd is unable to determine the docked state. There is no /sys/class/drm device (because of the fglrx driver) and systemd does not find the input event source.

When running system in debug mode, I found this in dmesg:

> [ 12.740423] systemd-logind[1019]: Watching system buttons on /dev/input/event2 (Power Button)
> [ 12.740505] systemd-logind[1019]: Watching system buttons on /dev/input/event4 (Video Bus)
> [ 12.740576] systemd-logind[1019]: Watching system buttons on /dev/input/event1 (Lid Switch)
> [ 12.740624] systemd-logind[1019]: Watching system buttons on /dev/input/event0 (Sleep Button)

After investigating those event sources, I found that none of them report the docked state (SW_DOCK event). That event is in my case on /dev/input/event15 -- the hp_wmi module.

Systemd is not considering that input, because it only scans for udev input devices that have the 'power-switch' tag.

So, at least for HP Notebook with WMI the workaround is simple, edit /lib/udev/rules.d/70-power-switch.rules and include the line

  SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="HP WMI hotkeys", TAG+="power-switch"

and reboot.

I'mnot sure if the udev rule is simply missing or if systemd locking only for power-switch udev input device is wrong. After all, the WMI inputs are not power switches.....

Martin Pitt (pitti) wrote :

Thanks Andreas, well spotted! This is the same issue as for the original reporter, inode77, and Kevin:

Mai 04 08:47:33 damm-xyz1 kernel: input: HP WMI hotkeys as /devices/virtual/input/input17
[...]
Mai 04 08:47:37 damm-xyz1 systemd-logind[853]: Watching system buttons on /dev/input/event2 (Power Button)
Mai 04 08:47:37 damm-xyz1 systemd-logind[853]: Watching system buttons on /dev/input/event4 (Video Bus)
Mai 04 08:47:37 damm-xyz1 systemd-logind[853]: Watching system buttons on /dev/input/event1 (Lid Switch)
Mai 04 08:47:37 damm-xyz1 systemd-logind[853]: Watching system buttons on /dev/input/event0 (Sleep Button)

Robin has:
Jul 14 10:06:33 rgarner-Latitude-E6420 kernel: input: Dell WMI hotkeys as /devices/virtual/input/input19

Martin Pitt (pitti) wrote :

I created an upstream pull request at https://github.com/systemd/systemd/pull/1100

All reporters: it would be nice if you could confirm the fix by editing /lib/udev/rules.d/70-power-switch.rules and adding the line

SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="* WMI hotkeys", TAG+="power-switch"

and then rebooting. If it still does not work for you, please do the "sudo journalctl > /tmp/journal.txt" dance again and attach /tmp/journal.txt. Thanks!

Changed in systemd (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Martin Pitt (pitti)
summary: - suspends on closed lid, does not recognized external monitors/dock
+ [HP, Dell notebooks] suspends on closed lid, does not recognized
+ external monitors/dock
Martin Pitt (pitti) on 2015-09-01
Changed in systemd (Ubuntu):
status: In Progress → Fix Committed

The fix doesn't work for me. journal.txt attached.

Regards,
Robin

The fix as applied:

cat /lib/udev/rules.d/70-power-switch.rules
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

ACTION=="remove", GOTO="power_switch_end"

SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="acpi", TAG+="power-switch"
SUBSYSTEM=="input", KERNEL=="event*", KERNELS=="thinkpad_acpi", TAG+="power-switch"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="twl4030_pwrbutton", TAG+="power-switch"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="tps65217_pwr_but", TAG+="power-switch"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="* WMI hotkeys", TAG+="power-switch"

LABEL="power_switch_end"

Martin Pitt (pitti) wrote :

@Robin: so it does listen to the "Dell WMI hotkeys" input device for you now. Can you please run this:

  for d in /dev/input/event*; do if ! sudo evtest --query $d EV_SW SW_DOCK; then echo $d; fi; done

If this outputs anything, then you have a device which reports "dock" state/events, otherwise this part just doesn't apply to your laptop. E. g. on my ThinkPad none of the input devices support that, but on the HPs they do apparently.

> for d in /dev/input/event*; do if ! sudo evtest --query $d EV_SW SW_DOCK; then echo $d; fi; done

Nothing.

Just a thought, but should the "suspend on boot" behaviour be made configurable ?

Also, any idea what password lightdm is after when you resume after booting with the lid down - it would help triage the issue to not have to reboot after accidentally booting with the lid down ...

Thanks for your efforts to date.

cheers

Kevin Klinger (kevin-klinger) wrote :

The new udev rule seems to have worked for me. Have 2 monitors connected which I use in an extended desktop. When rebooting with the lid down, the login screen comes up as it should, then it goes blank for a moment and comes back in mirrored mode. I then had to switch to extended mode after I logged back in the first time, but subsequent logins seem to switch back to extended mode after logging in automatically.

If I open the lid while logged in, it switches the screens around to use the newly active laptop one. If I then close it, it switches back to what it was before.

Thanks.

Martin Pitt (pitti) wrote :

This is applied in the xenial version now.

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
Nikos Kodos (nickkontos) wrote :

This bug affects me on Ubuntu Gnome 15.10 only when enabling a proprietary nvidia driver.
HP elitebook 8440p with dock and one monitor ext.
The udev rule fixes the problem

Just for some more info,
my "evtest --query " script output, as was asked in #17, is "/dev/input/event16"
Looking forward for xenial!

Alexander Hall (compuguy1088) wrote :

Has this been rolled out to WIly? This seems to still be reproducible with the proprietary nvidia drivers and 15.10.

Martin Pitt (pitti) wrote :

No, see comment #20, it's only fixed in Xenial for now.

Tais P. Hansen (taisph) wrote :

I am on 16.04 LTS Xenial and my Lenovo W520 in a dock with two external monitors suspends about 20 seconds after login as long as the laptop lid is closed.

Tais P. Hansen (taisph) wrote :

... Sorry, Lenovo W540 ... I haven't tested on my W520 yet.

Markus Kaiser (rocketguy) wrote :

Same for me with a Lenovo W510 in dock, two external monitors and Ubuntu GNOME 16.04 LTS.

After waking up my notebook two or three times I am finally able to login via GDM and use my system as normal, but as soon as I switch to one of the ttys my laptop suspends again.

Btw: I don't know if this is relevant, but for the sake of completeness I want to mention that hwinfo --monitors gives no output at all!

Tomas Forsman (pergis) wrote :

Affecs me the same way as Tais and Markus above.

Dell Precision m4800 with docking station and two external monitors.

Alexander Hall (compuguy1088) wrote :

Fix doesn't seem to have worked with the dock with the Dell precision m6600 with proprietary nvidia drivers.

fix also doesn't seem to work with dell precision m4600 with the docking station and proprietary nvidia drivers...

Since upgrading from 14.04 to 16.04.1 I'm experiencing the same problem. When booting my Precision M4600 in the dock with two external monitors, the laptop suspends immediately after login.

I've checked and /lib/udev/rules.d/70-power-switch.rules contains
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="* WMI hotkeys", TAG+="power-switch"

The laptop also suspends when switching from X to a tty. I'm using the proprietary nvidia drivers.

Nabeel Moeen (nabeel-moeen) wrote :

I have the same issue with Dell M4800 using docking station and am a new Ubuntu user (coming from windows), so a lot of the dicussion above does not make sense :(

Chuyang (vcycyv) wrote :

It doesn't work for me on a docked E6420 as well

Chuyang (vcycyv) wrote :

Found a workaround, edit /etc/systemd/logind.conf to set HandleLidSwitch=ignore.

Gfish (gareth-goldswain) wrote :

Similar issues on my Dell M4800.
Even worse for me is a serious security issue: sometimes, when laptop suspends at login screen and I hit power button on docking station to wake up from suspend, I see my Desktop without ever having to enter a username and password. This is obviously a serious problem.

  for d in /dev/input/event*; do if ! sudo evtest --query $d EV_SW SW_DOCK; then echo $d; fi; done
returns nothing.

Journal.txt and monitors.txt attached

Gfish (gareth-goldswain) wrote :
Markus Kaiser (rocketguy) wrote :

Any update on this? I've still got the problem with Ubuntu 16.10 and 17.04 and it really bothers me!

On Wed, May 10, 2017 at 05:43:44AM -0000, Markus Kaiser wrote:
> Any update on this? I've still got the problem with Ubuntu 16.10 and
> 17.04 and it really bothers me!

While the symptom may be the same the root cause could be a different
issue please open a new bug report with information about your system
and issue. Thanks!

--
Brian Murray

Michael Neuffer (neuffer) wrote :

I am also still seeing this on my Dell M4800 (with Ubuntu 18.04 alpha)
I have 2 monitors attached and the same issues as Gareth.

This still happens on a Dell Latitude E6430 with docking station and two external DVI monitors running Linux Mint 19 (based on Ubuntu Bionic)

ii systemd 237-3ubuntu10.3 amd64 system and service manager
ii systemd-sysv 237-3ubuntu10.3 amd64 system and service manager - SysV links

Oct 17 08:33:49 l1 systemd[1]: Started Disk Manager.
Oct 17 08:33:49 l1 systemd[1]: Reached target Graphical Interface.
Oct 17 08:33:49 l1 systemd[1]: Started Stop ureadahead data collection 45s after completed startup.
Oct 17 08:33:49 l1 systemd[1]: Starting Update UTMP about System Runlevel Changes...
Oct 17 08:33:49 l1 NetworkManager[1312]: <info> [1539718429.0768] manager: sleep: sleep requested (sleeping: no enabled: yes)
Oct 17 08:33:49 l1 NetworkManager[1312]: <info> [1539718429.0769] device (wlp3s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Oct 17 08:33:49 l1 NetworkManager[1312]: <info> [1539718429.0774] manager: NetworkManager state is now ASLEEP
Oct 17 08:33:49 l1 systemd[1]: Reached target Sleep.
Oct 17 08:33:49 l1 systemd[1]: Starting Suspend...
Oct 17 08:33:49 l1 systemd[1]: Started Update UTMP about System Runlevel Changes.
Oct 17 08:33:49 l1 systemd-sleep[2197]: Suspending system...
Oct 17 08:33:49 l1 kernel: [ 30.151723] PM: suspend entry (deep)

...but did NOT happen with the previous version of Linux Mint 18 (based on Ubuntu Xenial).

ii systemd 229-4ubuntu21.2 amd64 system and service manager
ii systemd-shim 9-1bzr4ubuntu1 amd64 shim for systemd
ii systemd-sysv 229-4ubuntu21.2 amd64 system and service manager - SysV links

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers