Stop Logitech from waking up Slackware Linux

       508 words, 3 minutes

Because of recent elbow issues, I purchased a Logitech Lift, so-called vertical ergonomic mouse . Not sure if it will solve my elbow issues but I’m sure it brought issue to my laptop suspend process.

Since I replaced my Logitech M590 with a Logitech Lift, the ThinkPad laptop resumes about 2 seconds after I told it to suspend. No matter if I don’t touch the keyboard or the mouse, no matter if I turn the Lift off before issuing the sleep command, no matter if I turn the monitor off before going to sleep - the Logitech dongle is plugged into the monitor USB Hub that is connected to the Thunderbolt port of the laptop.

After a few checks on the hardware, I noticed that the M590 uses a Logitech Unifying receiver (identified with a black star on a red square icon). The Lift uses a Logi Bolt USB receiver (identified with a black thunder flash on yellowish hexagon). Those receivers are probably different because I could never have the Lift connect to the Unifying receiver. And that’s probably why the behaviour is different with both.

Identifying the device

Reading Linux proc literature indicates that /proc/acpi/wakeup lists devices that are configured/allowed to wakeup from S3 (standby, sleep, suspend to RAM) and S4 (hibernation, suspend to disk).

# cat /proc/acpi/wakeup | grep XHC
Device  S-state   Status   Sysfs node
XHC0      S3    *enabled   pci:0000:c4:00.3
XHC1      S4    *enabled   pci:0000:c4:00.4
XHC2      S4    *disabled  pci:0000:c6:00.0
XHC3      S3    *enabled   pci:0000:c6:00.3
XHC4      S3    *enabled   pci:0000:c6:00.4

Checking on dmesg output, the Logitech dongle had its PCI device reference revealed.

usb 7-1.4: new full-speed USB device number 17 using xhci_hcd
usb 7-1.4: New USB device found, idVendor=046d, idProduct=c548, bcdDevice= 5.03
usb 7-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 7-1.4: Product: USB Receiver
usb 7-1.4: Manufacturer: Logitech
input: Logitech USB Receiver as /devices/pci0000:00/0000:00:08.3/0000:c6:00.4/usb7/7-1/7-1.4/7-1.4:1.0/0003:046D:C548.0016/input/input46
on usb-0000:c6:00.4-1.4/input0
input: Logitech USB Receiver Mouse as /devices/pci0000:00/0000:00:08.3/0000:c6:00.4/usb7/7-1/7-1.4/7-1.4:1.1/0003:046D:C548.0017/input/input47
input: Logitech USB Receiver Consumer Control as /devices/pci0000:00/0000:00:08.3/0000:c6:00.4/usb7/7-1/7-1.4/7-1.4:1.1/0003:046D:C548.0017/input/input48
input: Logitech USB Receiver System Control as /devices/pci0000:00/0000:00:08.3/0000:c6:00.4/usb7/7-1/7-1.4/7-1.4:1.1/0003:046D:C548.0017/input/input49
input: Logitech USB Receiver as /devices/pci0000:00/0000:00:08.3/0000:c6:00.4/usb7/7-1/7-1.4/7-1.4:1.1/0003:046D:C548.0017/input/input50
on usb-0000:c6:00.4-1.4/input1
on usb-0000:c6:00.4-1.4/input2
input: Logitech USB Receiver as /devices/pci0000:00/0000:00:08.3/0000:c6:00.4/usb7/7-1/7-1.4/7-1.4:1.3/0003:046D:C548.0019/input/input51
on usb-0000:c6:00.4-1.4/input3

Solving the problem

Matching both previous outputs indicates “XHC4 S3 *enabled pci:0000:c6:00.4” should be the culprit. The validation test is fairly easy: send the system to sleep and watch it wake up a few seconds later, disable the USB/PCI device, send the system back to suspend and watch it sleeps until we decide to wake it up.

# echo -n mem  > /sys/power/state

# echo XHC4 > /proc/acpi/wakeup
# echo -n mem  > /sys/power/state

It should be noted that the whole USB Hub is disabled. Which means none of the connected USB devices can wake the laptop up. Still, closing and opening the LID wakes up the system; as does hitting a key on the ThinkPad keyboard - which is what I do given my home installation.

To have the configuration persists on reboot, the command line can be added to the rc.local script:

# vi /etc/rc.d/rc.local
(...)
echo XHC4 > /proc/acpi/wakeup
(...)

And from now, the laptop has perfect naps!