[Wayland-bugs] [Bug 102039] LID_SWITCH_RELIABILITY=write_open doesn't work
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Aug 4 17:11:31 UTC 2017
https://bugs.freedesktop.org/show_bug.cgi?id=102039
Bug ID: 102039
Summary: LID_SWITCH_RELIABILITY=write_open doesn't work
Product: Wayland
Version: unspecified
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: major
Priority: medium
Component: libinput
Assignee: wayland-bugs at lists.freedesktop.org
Reporter: me at jasonclinton.com
Background: Benjamin Tissoires reverted an upstream kernel change which was
intended to make Linux more compatible with default Windows behavior:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/acpi/button.c?id=878d8db039daac0938238e9a40a5bd6e50ee3c9b
The original commit was to work around bugs like this one where the laptop lid
switch works as expected in Windows without installing any vendor drivers:
https://bugzilla.kernel.org/show_bug.cgi?id=191211
With the revert, the bad behavior has returned (with kernel option as only
recourse for users).
In the revert message, he suggests working around the problem in user space
with a HWDB rule. I have created one:
$ cat /etc/udev/hwdb.d/91-libinput-model-quirks.hwdb
##########################################
# Razer
##########################################
# Razer Blade laptops need us to write the open lid switch event
libinput:name:*Lid Switch*:dmi:*svnRazer:pnBlade*
LIBINPUT_ATTR_LID_SWITCH_RELIABILITY=write_open
And indeed, it sets the property:
$ udevadm info
--path=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:01/PNP0C0D:00/input/input0/event0
P:
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:01/PNP0C0D:00/input/input0/event0
N: input/event0
E: DEVNAME=/dev/input/event0
E:
DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:01/PNP0C0D:00/input/input0/event0
E: ID_INPUT=1
E: ID_INPUT_SWITCH=1
E: ID_PATH=acpi-PNP0C0D:00
E: ID_PATH_TAG=acpi-PNP0C0D_00
E: LIBINPUT_ATTR_LID_SWITCH_RELIABILITY=write_open
E: LIBINPUT_DEVICE_GROUP=19/0/5/0:PNP0C0D/button
E: MAJOR=13
E: MINOR=64
E: SUBSYSTEM=input
E: TAGS=:power-switch:
E: USEC_INITIALIZED=64391649
However, libinput doesn't actually write open to the lid switch and prevent a
system from suspending after lid open. Systemd eventually times out and sees
that the lid is closed:
$ sudo cat /proc/acpi/button/lid/LID0/state
state: closed
$ libinput --version
1.8.0
Running Wayland on F26 with:
Linux version 4.13.0-0.rc3.git0.1.fc27.x86_64
(mockbuild at bkernel02.phx2.fedoraproject.org) (gcc version 7.1.1 20170718 (Red
Hat 7.1.1-6) (GCC)) #1 SMP Mon Jul 31 16:41:10 UTC 2017
Please fix libinput or revert the upstream kernel revert.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20170804/e62d12a4/attachment.html>
More information about the wayland-bugs
mailing list