rynbrd / xf86-input-mtrack

Xorg Multitouch Trackpad Driver
GNU General Public License v2.0
355 stars 58 forks source link

Stops working after suspend #74

Closed atmoz closed 8 years ago

atmoz commented 9 years ago

After suspend, my touchpad (bcm5974, late 2008 macbookpro) stops working.

This seems to happen after i upgraded Xorg and it became rootless. Before that I had no problem suspending and resuming the laptop.

Every time I resume from suspend I have to restart Xorg to get my touchpad working again. It's very annoying.

Is this a bug or can I do something to fix this?

/etc/X11/xorg.conf.d/10-mtrack.conf:

Section "InputClass"
    Identifier "touchpads"
    MatchIsTouchpad "on"
    Driver "mtrack"
    Option "Sensitivity" "0.6"
    Option "TapButton1" "0"
    Option "TapButton2" "0"
    Option "TapButton3" "0"
    Option "ClickFinger2" "3"
    Option "ClickFinger3" "2"
EndSection

lsusb:

Bus 002 Device 002: ID 05ac:8502 Apple, Inc. Built-in iSight
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 004: ID 05ac:0231 Apple, Inc. Internal Keyboard/Trackpad (MacBook Pro 4,1) (ISO)
Bus 007 Device 002: ID 05ac:8242 Apple, Inc. Built-in IR Receiver
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 05ac:820f Apple, Inc. Bluetooth HCI
Bus 003 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

This is the relevant systemd log, when resuming:

Nov 22 19:05:24 arch-book kernel: ACPI: Waking up from system sleep state S3
Nov 22 19:05:24 arch-book kernel: uhci_hcd 0000:00:1a.0: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: uhci_hcd 0000:00:1a.1: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: uhci_hcd 0000:00:1d.0: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: uhci_hcd 0000:00:1d.1: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: uhci_hcd 0000:00:1d.2: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: ehci-pci 0000:00:1d.7: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: ehci-pci 0000:00:1a.7: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: PM: noirq resume of devices complete after 154.075 msecs
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:01.0:pcie04: Card present on Slot(1)
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Card present on Slot(5)
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: slot(5): Link Up event
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Card present on Slot(4)
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: slot(4): Link Up event
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Link Up event ignored on slot(5): already powering on
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Link Up event ignored on slot(4): already powering on
Nov 22 19:05:24 arch-book kernel: PM: early resume of devices complete after 0.262 msecs
Nov 22 19:05:24 arch-book kernel: usb usb1: root hub lost power or was reset
Nov 22 19:05:24 arch-book kernel: usb usb2: root hub lost power or was reset
Nov 22 19:05:24 arch-book kernel: snd_hda_intel 0000:00:1b.0: irq 30 for MSI/MSI-X
Nov 22 19:05:24 arch-book kernel: usb usb3: root hub lost power or was reset
Nov 22 19:05:24 arch-book kernel: usb usb4: root hub lost power or was reset
Nov 22 19:05:24 arch-book kernel: usb usb5: root hub lost power or was reset
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.2:pcie04: Timeout on hotplug command 0x00001038 (issued 4796546 msec ago)
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.0:pcie04: Timeout on hotplug command 0x00001038 (issued 4796546 msec ago)
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Timeout on hotplug command 0x00001038 (issued 4796546 msec ago)
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Timeout on hotplug command 0x00001038 (issued 4796546 msec ago)
Nov 22 19:05:24 arch-book kernel: sd 2:0:0:0: [sda] Starting disk
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Device 0000:0c:00.0 already exists at 0000:0c:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Cannot add device at 0000:0c:00
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Device 0000:0b:00.0 already exists at 0000:0b:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Cannot add device at 0000:0b:00
Nov 22 19:05:24 arch-book kernel: ata1.00: ACPI cmd ef/03:0c:00:00:00:a0 (SET FEATURES) filtered out
Nov 22 19:05:24 arch-book kernel: ata1.00: ACPI cmd ef/03:44:00:00:00:a0 (SET FEATURES) filtered out
Nov 22 19:05:24 arch-book kernel: ata1.00: configured for UDMA/66
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Device 0000:0c:00.0 already exists at 0000:0c:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Cannot add device at 0000:0c:00
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Device 0000:0b:00.0 already exists at 0000:0b:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Cannot add device at 0000:0b:00
Nov 22 19:05:24 arch-book kernel: usb 1-1: reset full-speed USB device number 2 using uhci_hcd
Nov 22 19:05:24 arch-book kernel: usb 5-2: reset full-speed USB device number 4 using uhci_hcd
Nov 22 19:05:24 arch-book kernel: firewire_core 0000:0d:03.0: rediscovered device fw0
Nov 22 19:05:24 arch-book kernel: usb 5-1: reset low-speed USB device number 2 using uhci_hcd
Nov 22 19:05:24 arch-book kernel: usb 1-1.1: reset full-speed USB device number 3 using uhci_hcd
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:01.0:pcie04: Device 0000:01:00.0 already exists at 0000:01:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:01.0:pcie04: Cannot add device at 0000:01:00
Nov 22 19:05:24 arch-book kernel: rtc_cmos 00:03: System wakeup disabled by ACPI
Nov 22 19:05:24 arch-book kernel: ata3.00: ACPI cmd ef/03:0c:00:00:00:a0 (SET FEATURES) filtered out
Nov 22 19:05:24 arch-book kernel: ata3.00: ACPI cmd ef/03:45:00:00:00:a0 (SET FEATURES) filtered out
Nov 22 19:05:24 arch-book kernel: ata3.00: configured for UDMA/100
Nov 22 19:05:24 arch-book kernel: b43-phy0: Loading firmware version 666.2 (2011-02-23 01:15:07)
Nov 22 19:05:24 arch-book kernel: PM: resume of devices complete after 2162.703 msecs
Nov 22 19:05:24 arch-book kernel: input: bcm5974 as /devices/pci0000:00/0000:00:1d.2/usb5/5-2/5-2:1.2/input/input27
Nov 22 19:05:24 arch-book kernel: PM: Finishing wakeup.

Those "Device [...] already exists at [...], cannot hot-add" messages must be part of the problem, I guess:

Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Device 0000:0c:00.0 already exists at 0000:0c:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.5:pcie04: Cannot add device at 0000:0c:00
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Device 0000:0b:00.0 already exists at 0000:0b:00, cannot hot-add
Nov 22 19:05:24 arch-book kernel: pciehp 0000:00:1c.4:pcie04: Cannot add device at 0000:0b:00
lpefferkorn commented 9 years ago

I'm also annoyed by this issue, the touchpad device becomes "floating slave":

$ xinput
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Power Button                                id=8    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Sleep Button                                id=9    [slave  keyboard (3)]
    ↳ Apple Inc. Apple Internal Keyboard / Trackpad   id=10   [slave  keyboard (3)]

~ bcm5974                                   id=11   [floating slave]

It can be manually reactivated with the following command:

xinput --enable bcm5974

Or you can reload the bcm5974 module too.

rynbrd commented 9 years ago

Does this happen when using the synaptics driver? Based on the above logs it looks like a kernel suspend issue rather than an xorg issue.

lpefferkorn commented 9 years ago

It works with the synaptics driver.

stibi commented 9 years ago

Hi, I have the same problem…

Edit: fixed now :) Just reloaded the bcm5974 module and the touchpad is back...

rynbrd commented 9 years ago

That should cause the mtrack driver to reload. I do suspect the mtrack driver itself is at fault for this. I'm working on updating my xorg to 1.16.3 then I'll see what's up.

tomauty commented 9 years ago

Any updates on this one? Or if there are any leads I would be willing to dive into the source as well.

atmoz commented 9 years ago

I can confirm that reloading the bcm5974 module is a temporary fix. Better than restarting xorg and closing all my applications every time. But still annoying. Actually, some times I don't need to do it, the touchpad just works. Maybe some kind of race condition going on?

bitjockey42 commented 9 years ago

I can also confirm that reloading that the bcm5974 module on resume is a workaround.

It got annoying to have to reload that module manually every time I resume from suspend, though. I've written up a simple systemd service to reload it on resume which you can see here (Along with some instructions):

https://gist.github.com/astrohckr/6892f0de1475c6942b89

If you're not using a display-manager, you may have to add graphical.target to the After=suspend.target display-manager.service in reload-touchpad.service. Basically, you have to wait until X has started in order to reload the driver.

yousefamar commented 9 years ago

Thanks lpefferkorn and astrohckr!

bobbens commented 9 years ago

I updated to linux 4.0.6 and sometime a while ago the bug seems to have naturally gone away. I don't think I have done any other change. So I'm fairly happy. This is arch linux. I'm not sure if a maintainer did something else to solve it though. So for me this bug is magically fixed ;)

atmoz commented 8 years ago

As @bobbens said, the problem seems to go away. I no longer had to reload the bcm5974 module after suspend. Now the Macbook Pro is dead (R.I.P) and I'm now using a Lenovo Thinkpad T450s (loving it).

Closing this, assuming no one else still has this issue (correct me if I'm wrong).