touchpad settings changing after hibernate


I am running kernel 5.6.14-arch1-1-surface on my Microsoft Surface Pro 2017. After I hibernate and resume, my touchpad settings change. It still works, but the settings are different. If I disconnect the keyboard and reconnect it, proper touchpad settings come back.

System:    Host: surfacepro Kernel: 5.6.14-arch1-1-surface x86_64 bits: 64 compiler: gcc v: 10.1.0
           Desktop: bspwm 0.9.7-10-g2ffd9c1 info: polybar dm: LightDM 1.30.0 Distro: Manjaro Linux
Machine:   Type: Laptop System: Microsoft product: Surface Pro v: D:0B:08F:5C:09P:38S:01E:0 serial: <filter> Chassis: type: 9
           serial: <filter>
           Mobo: Microsoft model: Surface Pro serial: <filter> UEFI: Microsoft v: 234.2706.768 date: 04/18/2019
Battery:   ID-1: BAT1 charge: 28.1 Wh condition: 43.3/45.5 Wh (95%) volts: 7.8/7.6 model: SMP M1009169 type: Li-ion
           serial: <filter> status: Discharging cycles: 91
CPU:       Topology: Dual Core model: Intel Core i5-7300U bits: 64 type: MT MCP arch: Amber Lake rev: 9 L2 cache: 3072 KiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 21607
           Speed: 700 MHz min/max: 400/3500 MHz Core speeds (MHz): 1: 700 2: 700 3: 700 4: 700
Graphics:  Device-1: Intel HD Graphics 620 vendor: Microsoft driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:5916
           Display: server: X.Org 1.20.8 driver: intel unloaded: modesetting alternate: fbdev,vesa resolution: 2736x1824~60Hz
           OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 20.0.6 direct render: Yes
Audio:     Device-1: Intel Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit driver: ipu3-imgu bus ID: 00:05.0
           chip ID: 8086:1919
           Device-2: Intel driver: ipu3-cio2 bus ID: 00:14.3 chip ID: 8086:9d32
           Device-3: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:9d71
           Sound Server: ALSA v: k5.6.14-arch1-1-surface
Network:   Device-1: Marvell 88W8897 [AVASTAR] 802.11ac Wireless driver: mwifiex_pcie v: 1.0 port: 3000 bus ID: 01:00.0
           chip ID: 11ab:2b38
           IF: wlp1s0 state: up mac: <filter>
           Device-2: Marvell Bluetooth and Wireless LAN Composite Device type: USB driver: btusb bus ID: 1-5:3
           chip ID: 1286:204c serial: <filter>
Drives:    Local Storage: total: 715.38 GiB used: 173.80 GiB (24.3%)
           ID-1: /dev/nvme0n1 vendor: Samsung model: KUS030202M-B000 size: 238.47 GiB speed: 15.8 Gb/s lanes: 2
           serial: <filter> rev: DXY8AM1Q scheme: GPT
           ID-2: /dev/sda type: USB vendor: Generic model: SD MMC size: 476.91 GiB serial: <filter> rev: 1.00 scheme: MBR
Partition: ID-1: / size: 97.93 GiB used: 64.53 GiB (65.9%) fs: ext4 dev: /dev/nvme0n1p5
Sensors:   System Temperatures: cpu: 29.0 C mobo: N/A
           Fan Speeds (RPM): N/A
Info:      Processes: 278 Uptime: 22h 21m Memory: 7.70 GiB used: 3.54 GiB (45.9%) Init: systemd v: 245 Compilers: gcc: 9.3.0
           clang: 10.0.0 Shell: bash v: 5.0.16 running in: alacritty inxi: 3.0.37


Use this to create systemd service that will deal with either reconnect the keyboard, or reload the touchpad

Thanks for your reply, however, my issue is a little different.

It's not that my touchpad stops working. It is still working after awaking from hibernation, except that it has different settings. For instance, before hibernation, to tap on something, I must physically click the touchpad for the touch action to occur, but after hibernation a simple tap on the touchpad (without physically clicking the touchpad) registers as a click.

And, as I mentioned , to restore my original settings, I have found that if I remove the keyboard/touchpad cover, then reattach, the proper touchpad settings come back.

Also, I tried a bunch of the systemd units you suggested. Removing and reloading kernel modules before and after hibernating such as i2c_hid and psmouse don't solve the problem. Also, disabling and reenabling USB before and after hibernation doesn't work either.

Something magical is happening when I remove and reattach the keyboard cover. What is happening during that process and how can I do the same thing when hibernating. Also note that I don't have these problems when I suspend/resume.

I have some additional information:

Before hibernation, the touchpad is associated with xinput device 15 "Microsoft Surface Type Cover Touchpad". This is verified by running "xinput --test 15" and performing actions on the touchpad and seeing output in the terminal.

After hibernation, the touchpad is associated with xinput device 14 "Microsoft Surface Type Cover Consumer Control", and is verified by running "xinput --test 14" and seeing output in the terminal. If I test device 15, I get no output in the terminal.

Why is this happening? How can I fix this?

Found a workaround. Unload hid_multitouch kernel module on hibernate, and load on resume.

Forum kindly sponsored by