MSFT Touchpad not working on Lenovo Legion-5 15ARH05

Bug #1887190 reported by Nicolas Rogues
406
This bug affects 73 people
Affects Status Importance Assigned to Milestone
Pop!_OS
Fix Released
Undecided
Unassigned
linux (Arch Linux)
Fix Committed
Undecided
Unassigned
linux (Fedora)
Confirmed
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Unassigned
linux (openSUSE)
New
Undecided
Unassigned
xserver-xorg-input-libinput (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Update (based on #296)
=============

The latest kernel tree (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git) has the complete solution to fix this bug. So we can expect kernel v5.11 to fix this issue without any additional work.

Before the release of v5.11, you are suggested to use #189 to save your touchpad. Note that for distributions like Ubuntu and Fedora, the pinctrl-amd driver is built into the initramfs. So you have to rebuild the initramfs after replacing the old module with new one.
On Fedora, run `sudo dracut --force`; On ubuntu, run `sudo update-initramfs -u`.

The complete solution is three patches,
 - 47a0001436352c9853d72bf2071e85b316d688a2 ("pinctrl: amd: remove debounce filter setting in IRQ type setting")
 - 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter")
 - 8dcb7a15a585b6d0fee15751ce11d7a68cfedd56 ("gpiolib: acpi: Take into account debounce settings")

The first two patches has reached the stable tree. If the last one is also backported to LTS kernel, you won't need to install kernel 5.11. But I don't know when this will happen.

Original bug report
===================

Hello

The MSFT touchpad of this Lenovo Legion-5 15ARH05 laptop is not reacting at all (pointer and click never move when touchpad is touched). This has been reported by other users in various websites, with various linux systems including other Ubuntu systems, but I saw no launchpad bug so I post one. Example of websites covering the issue :
- https://askubuntu.com/questions/1253830/lenovo-legion-5-touchpad (exactly the same laptop)
- https://www.linux.org/threads/lenovo-legion-5-touchpad.29536/ (similar laptop)

xinput indentifies it as MSFT0001:00 04F3:3140

Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ MSFT0001:00 04F3:3140 Touchpad id=17 [slave pointer (2)]
⎜ ↳ MSFT0001:00 04F3:3140 Mouse id=16 [slave pointer (2)]
⎜ ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control id=12 [slave pointer (2)]
⎜ ↳ Logitech USB Optical Mouse id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
    ↳ Ideapad extra buttons id=15 [slave keyboard (3)]
    ↳ Power Button id=6 [slave keyboard (3)]
    ↳ Integrated Camera: Integrated C id=10 [slave keyboard (3)]
    ↳ Video Bus id=7 [slave keyboard (3)]
    ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control id=19 [slave keyboard (3)]
    ↳ Power Button id=9 [slave keyboard (3)]
    ↳ ITE Tech. Inc. ITE Device(8910) Wireless Radio Control id=13 [slave keyboard (3)]
    ↳ ITE Tech. Inc. ITE Device(8910) Keyboard id=14 [slave keyboard (3)]
    ↳ AT Translated Set 2 keyboard id=18 [slave keyboard (3)]
    ↳ Video Bus id=8 [slave keyboard (3)]

Thanks a lot for your time. It does not help, but I can confirm what was reported on askubuntu by another user : the touchpad does work on Windows.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-5.4.0-40-generic 5.4.0-40.44
ProcVersionSignature: Ubuntu 5.4.0-40.44-generic 5.4.44
Uname: Linux 5.4.0-40-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.3
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: nicolas 1567 F.... pulseaudio
 /dev/snd/controlC1: nicolas 1567 F.... pulseaudio
 /dev/snd/controlC2: nicolas 1567 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Fri Jul 10 20:14:25 2020
InstallationDate: Installed on 2020-07-02 (8 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
MachineType: LENOVO 82B5
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
ProcFB: 0 EFI VGA
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.4.0-40-generic root=UUID=d8898017-2821-434e-ab52-fec76ac93106 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-5.4.0-40-generic N/A
 linux-backports-modules-5.4.0-40-generic N/A
 linux-firmware 1.187.1
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/12/2020
dmi.bios.vendor: LENOVO
dmi.bios.version: EUCN19WW
dmi.board.asset.tag: NO Asset Tag
dmi.board.name: LNVNB161216
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40709 WIN
dmi.chassis.asset.tag: NO Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Lenovo Legion 5 15ARH05
dmi.modalias: dmi:bvnLENOVO:bvrEUCN19WW:bd05/12/2020:svnLENOVO:pn82B5:pvrLenovoLegion515ARH05:rvnLENOVO:rnLNVNB161216:rvrSDK0J40709WIN:cvnLENOVO:ct10:cvrLenovoLegion515ARH05:
dmi.product.family: Legion 5 15ARH05
dmi.product.name: 82B5
dmi.product.sku: LENOVO_MT_82B5_BU_idea_FM_Legion 5 15ARH05
dmi.product.version: Lenovo Legion 5 15ARH05
dmi.sys.vendor: LENOVO
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27.3
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 20.04
InstallationDate: Installed on 2020-07-02 (12 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
Package: linux (not installed)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
Tags: focal
Uname: Linux 5.8.0-050800rc5-generic x86_64
UnreportableReason: The running kernel is not an Ubuntu kernel
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True

CVE References

Revision history for this message
Nicolas Rogues (nrogues) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
You-Sheng Yang (vicamo)
tags: added: hwe-touchpad
Revision history for this message
Nicolas Rogues (nrogues) wrote : ProcCpuinfoMinimal.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Nicolas Rogues (nrogues) wrote :

Hello

Kernel 5.8-rc5 from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.8-rc5/ does not resolve the problem.

I tried to use below command to reattach all apport files, but it only attached one file, let me know if you need more files (and provide the appropriate command line !)
apport-collect 1887190

Thanks
Nicolas

Revision history for this message
Helmut Stult (helmut-stult) wrote :

The link provides all the necessary information:

https://linux-hardware.org/?probe=59d2f291d6

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Controlling the screen brightness with Fn + F5 / F6 also does not work

Revision history for this message
Stefano Galassi (iltoga) wrote :

my lenovo legion 5 15ARH05 has same issues:
touchpad shows up under input devices as 'MSFT0001:00 04F3:3140 Touchpad' but doesn't work on linux (on windows it does work perfectly)
screen brightness control doesn't work too

https://linux-hardware.org/?probe=a8dfb4b56d

Revision history for this message
You-Sheng Yang (vicamo) wrote :
Download full text (3.6 KiB)

@Helmut, from your Xorg.log and dmesg, MSFT0001 has beend detected and enabled in kernel, but somehow it failed to be enabled in xorg:

[ 74.771] (II) config/udev: Adding input device MSFT0001:00 04F3:3140 Mouse (/dev/input/event16)
[ 74.771] (**) MSFT0001:00 04F3:3140 Mouse: Applying InputClass "evdev pointer catchall"
[ 74.771] (**) MSFT0001:00 04F3:3140 Mouse: Applying InputClass "libinput pointer catchall"
[ 74.771] (II) Using input driver 'libinput' for 'MSFT0001:00 04F3:3140 Mouse'
[ 74.771] (**) MSFT0001:00 04F3:3140 Mouse: always reports core events
[ 74.771] (**) Option "Device" "/dev/input/event16"
[ 74.771] (**) Option "_source" "server/udev"
[ 74.772] (II) event16 - MSFT0001:00 04F3:3140 Mouse: is tagged by udev as: Mouse Pointingstick
[ 74.772] (II) event16 - MSFT0001:00 04F3:3140 Mouse: device is a pointer
[ 74.772] (II) event16 - MSFT0001:00 04F3:3140 Mouse: device removed
[ 74.836] (**) Option "config_info" "udev:/sys/devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input18/event16"
[ 74.836] (II) XINPUT: Adding extended input device "MSFT0001:00 04F3:3140 Mouse" (type: MOUSE, id 16)
[ 74.836] (**) Option "AccelerationScheme" "none"
[ 74.836] (**) MSFT0001:00 04F3:3140 Mouse: (accel) selected scheme none/0
[ 74.836] (**) MSFT0001:00 04F3:3140 Mouse: (accel) acceleration factor: 2.000
[ 74.836] (**) MSFT0001:00 04F3:3140 Mouse: (accel) acceleration threshold: 4
[ 74.837] (II) event16 - MSFT0001:00 04F3:3140 Mouse: is tagged by udev as: Mouse Pointingstick
[ 74.837] (II) event16 - MSFT0001:00 04F3:3140 Mouse: device is a pointer
[ 74.838] (II) config/udev: Adding input device MSFT0001:00 04F3:3140 Mouse (/dev/input/mouse0)
[ 74.838] (II) No input driver specified, ignoring this device.
[ 74.838] (II) This device may have been added with another device file.
[ 74.839] (II) config/udev: Adding input device MSFT0001:00 04F3:3140 Touchpad (/dev/input/event17)
[ 74.839] (**) MSFT0001:00 04F3:3140 Touchpad: Applying InputClass "evdev touchpad catchall"
[ 74.839] (**) MSFT0001:00 04F3:3140 Touchpad: Applying InputClass "libinput touchpad catchall"
[ 74.839] (II) Using input driver 'libinput' for 'MSFT0001:00 04F3:3140 Touchpad'
[ 74.839] (**) MSFT0001:00 04F3:3140 Touchpad: always reports core events
[ 74.839] (**) Option "Device" "/dev/input/event17"
[ 74.839] (**) Option "_source" "server/udev"
[ 74.839] (II) event17 - MSFT0001:00 04F3:3140 Touchpad: is tagged by udev as: Touchpad
[ 74.840] (II) event17 - MSFT0001:00 04F3:3140 Touchpad: device is a touchpad
[ 74.840] (II) event17 - MSFT0001:00 04F3:3140 Touchpad: device removed
[ 74.916] (**) Option "config_info" "udev:/sys/devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input19/event17"
[ 74.917] (II) XINPUT: Adding extended input device "MSFT0001:00 04F3:3140 Touchpad" (type: TOUCHPAD, id 17)
[ 74.917] (**) Option "AccelerationScheme" "none"
[ 74.917] (**) MSFT0001:00 04F3:3140 Touchpad: (accel) selected scheme none/0
[ 74.917] (**) MSFT0001:00 04F3:3140 Touchpad: (accel) acceleration factor: 2.000
[ 74.917] (**) MSF...

Read more...

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Please file screen brightness control as another bug (and maybe comment the url for that new bug) and let's focus on touchpad here.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Nicolas Rogues (nrogues) wrote :

Hello,

The kernel 5.4.0-42-generic from https://people.canonical.com/~khfeng/lp1887190/ does not work either.

Thanks

Nicolas

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you please attach dmesg? Thanks!

Revision history for this message
Nicolas Rogues (nrogues) wrote :

Here you go
Nicolas

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please run `watch -n0 cat /proc/interrupts`, put finger on the touchpad and see "AMDI0010:03", "pinctrl_amd" or "MSFT0001:00" increase the interrupt count rapidly.

Revision history for this message
Nicolas Rogues (nrogues) wrote :

AMDI0010:03 and pinctrl_amd are present but the count does not move when I move finger or click on the touchpad.

Please note I tried to remove my USB Mouse which is responsible for the high counts on one of xhci_hcd. For this mouse it's moving rapidly.

Two screen captures enclosed.

Revision history for this message
Nicolas Rogues (nrogues) wrote :
Revision history for this message
Justin Arendt (arendtubuntuone) wrote :

This bug also affects my laptop touchpad
Lenvo Legion 5-ARH05 5.7.1 Kernel
https://linux-hardware.org/?probe=d449a0b248

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
Stefano Galassi (iltoga) wrote :

I manually patched that file on 5.7.8-AMD kernel, but touchpad is still dead..

https://linux-hardware.org/?probe=50272ea6ea

thank you

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please raise the issue to the following email address:
Jarkko Nikula <email address hidden> (maintainer:SYNOPSYS DESIGNWARE I2C DRIVER)
Andy Shevchenko <email address hidden> (reviewer:SYNOPSYS DESIGNWARE I2C DRIVER)
Mika Westerberg <email address hidden> (reviewer:SYNOPSYS DESIGNWARE I2C DRIVER)
Philipp Zabel <email address hidden> (maintainer:RESET CONTROLLER FRAMEWORK)
<email address hidden> (open list:SYNOPSYS DESIGNWARE I2C DRIVER)
<email address hidden> (open list)

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Possible dupe of lp: #1884981, with different error though.

Revision history for this message
Nicolas Rogues (nrogues) wrote :

done today

got an error from vger.kernel.org (policy analysis reported: your address is not liked source for email) but not from other recipients, so if any of the other affected users has an approved email address with this server, I will be glad to provide the initial email for forwarding

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in xserver-xorg-input-libinput (Ubuntu):
status: New → Confirmed
Revision history for this message
Didi Kohen (kohen-d) wrote :

I think I have the same issue on my Idea Pad 5, before I got i2c controller timed out errors, but after a firmware upgrade, I don't see any errors, I'll try to revert my firmware settings to see if I can restore the previous state (where after windows is started, touchpad workd on the next boot)
I'll try the kernels given here afterwards (since it did work before)

Revision history for this message
Didi Kohen (kohen-d) wrote :

OK, this is really strange, after tons of reboots to Ubuntu and Win 10, it started working again after I disabled the legacy boot option.
Still would like a solution to the timeouts other than rebooting twice, though.
I'm a developer, so if there are multiple code changes that need to be tested, I could make them and compile to check, but right now I don't know where to start. (I'm used to working on storage, not HID)

Revision history for this message
Nicolas Rogues (nrogues) wrote :

Hello Didi,

The issue we face could be different : on the Lenovo Legion-5 15ARH05 (which is the object of this bug report) there is no working trick to boot on Windows then Ubuntu : it just never worked under Linux on the two BIOS tested (factory I think EUCN16WW and June update EUCN19WW), in UEFI mode, no matters if Windows was used before reboot and grub to Ubuntu (I have a dual-boot setup).

As a remark, the touchpad does work in the UEFI BIOS, before any OS is loaded.

Revision history for this message
Ben T (derrotmax) wrote :

Touchpad MSFT0001:00 04F3:3140 is dead on 5.8 rc5 as well.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

I have found the cause so far that the touchpad MSFT0001: 00 04F3: 3140 is recognized, but no suitable driver is found.

With the touchpad ELAN0001: 00 04F3: 3140 it seems to work with a few tricks.
ELAN is also available in the kernel config, but MSFT is not.

I just don't understand why there are two different names (ELAN and MFST) under the same hardware ID - what did Lenovo do?

Revision history for this message
Nicolas Rogues (nrogues) wrote :

It's a good question.

In my understanding, the Legion R7000 is the name for China of the Legion-5 15ARH05. In the Lenovo forum, the Lenovo employee has no access to the equipment and indicates it's a kernel issue, suggesting it used to work prior to 5.4 kernel. That looks strange.

https://forums.lenovo.com/topic/view/2713/5020793

Also in this thread a member of the Lenovo forum points out to a blog, unfortunately in Chinese, of a guy who may have found a workaround. I tried to google translate it but was not sure of the result to try anything :

https://www.cnblogs.com/mikeguan/p/13126497.html

Revision history for this message
Helmut Stult (helmut-stult) wrote :

I am a Manjaro developer and we have kernels 4.4 / 4.9 / 4.14 / 4.19 / 5.4 / 5.7 / 5.8
The touchpad doesn't work with one of the kernels.
Screen brightness only works with AMD- or nouveau-Driver, not with the proprietary driver, like 440.100
The brightness display works, but nothing changes.
.

Revision history for this message
Ben T (derrotmax) wrote :

Nicolas -- I've seen the R7000 Chinese post (https://www.cnblogs.com/mikeguan/p/13126497.html), and what it basically entails is blacklisting hid_multitouch (or disabling it in the kernel and recompiling), which according to other forums seems to have an effect on some touchpads, but has no effect on the MSFT0001:00 04F3:3140 touchpad we have. I attempted his suggestions anyways, and saw the same lack of results -- the touchpad remained dead.

Revision history for this message
Nicolas Rogues (nrogues) wrote :

Thanks Helmut and Ben. These are very precise information and better than any post elsewhere.
I got no reply from the email contacts provided by Kai-Heng yet...
Anyone with a Lenovo connection ?

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Just repeat again - the fix works where an incorrect driver is detected.
However, no driver is found at all for the LEGION 5 and the touchpad is therefore not activated.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

These are my latest LOG files

https://linux-hardware.org/?probe=27a5d47256

Revision history for this message
Helmut Stult (helmut-stult) wrote :

As long as no solution is found, here is another solution.

https://gitlab.manjaro.org/packages/community/lenopow

Since it is only a script, this should work in every distribution ;-)

Revision history for this message
Helmut Stult (helmut-stult) wrote :
Nicolas Rogues (nrogues)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Stefano Galassi (iltoga)
Changed in linux (Arch Linux):
status: New → Confirmed
Changed in linux (Fedora):
status: New → Confirmed
Revision history for this message
Stefano Galassi (iltoga) wrote :

is there anyone workin on this yet?

Revision history for this message
daleli (daleli) wrote :

is there anyone workin on this yet?

Revision history for this message
Stefano Galassi (iltoga) wrote :

it seems not yet... :(

Revision history for this message
Coiby Xu (coiby) wrote :

I am now working on this issue.

I can confirm the solution provided by https://www.cnblogs.com/mikeguan/p/13126497.html works. What the solution does is,
 - blacklist hid_multitouch
 - Add the vendor id and product id of this touchpad device to hid_device_id in drivers/hid/hid-rmi.c

I've posted the patch to https://github.com/coiby/linux/commit/cca37387d87a874824040c946f43cecce2679d70. You needn't to re-build the whole kernel to test if it works. You simple build the hid_rmi module and load it with insmod.

But this is not an perfect solution. I'm now working on a solution that doesn't need to blacklist hid_multitouch. I've figured out how hid-core.c let the hid_multitouch driver handle this device.

Revision history for this message
Stefano Galassi (iltoga) wrote :

Thank you Coiby Xu! appreciate your support :)

unfortunately, even with your patch I could not make it to activate my touchpad.
I've created a kernel patch from yours, recompiled the kernel.
I tried both blacklisting hid_multitouch and removing hid_multitouch support in kernel config. all without any luck..

I am using a custom kernel patched for amd cpu/gpu (linux-amd), on arch linux.

Look forward to see your progresses anyway.
keep up with the good work!

Revision history for this message
Coiby Xu (coiby) wrote :

Thank you for testing the patch!

I'm sory I forgot the fact Lenovo ships different kinds of touchpads for the same laptop model and neglected this bug report is for MSFT0001:00 04F3:3140. Yours must also this touchpad device whose vendor is Elan (04F3).

I assume it should be also handled by hid_rmi. I've posted the change to https://github.com/coiby/linux/commit/53d8f9c8bade43b209831912d93ac941ca2c59ab. Can you confirm if it works?

diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index 59a7ae712319..c9d4b7fc7512 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -759,6 +759,7 @@ static const struct hid_device_id rmi_id[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_REZEL) },
        { HID_I2C_DEVICE(I2C_VENDOR_ID_SYNAPTICS, 0x7f28) },
+ { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x3140) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5),
                .driver_data = RMI_DEVICE_OUTPUT_SET_REPORT },
        { HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) },

Revision history for this message
Stefano Galassi (iltoga) wrote :

I am sorry mate.. touchpad still not working
I've checked and the patch has been applied correctly.
this is the output from lspci that shows hid_rmi is loaded, which is a step ahead compared to yesterday ;)

```
lsmod | grep hid
hid_magicmouse 20480 0
hidp 32768 1
bluetooth 737280 38 btrtl,hidp,btintel,btbcm,bnep,btusb,rfcomm
hid_rmi 24576 0
rmi_core 94208 1 hid_rmi
i2c_hid 32768 0
hid_generic 16384 0
usbhid 65536 0
hid 147456 6 i2c_hid,hidp,usbhid,hid_generic,hid_rmi,hid_magicmouse
usbcore 335872 5 xhci_hcd,usbhid,uvcvideo,btusb,xhci_pci
```

Revision history for this message
Stefano Galassi (iltoga) wrote :

other info that might be useful are:
xinput list-props 20
````
Device 'MSFT0001:00 04F3:3140':
 Device Enabled (177): 1
 Coordinate Transformation Matrix (179): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
 libinput Natural Scrolling Enabled (339): 0
 libinput Natural Scrolling Enabled Default (340): 0
 libinput Scroll Methods Available (341): 0, 0, 1
 libinput Scroll Method Enabled (342): 0, 0, 1
 libinput Scroll Method Enabled Default (343): 0, 0, 1
 libinput Button Scrolling Button (358): 3
 libinput Button Scrolling Button Default (359): 3
 libinput Button Scrolling Button Lock Enabled (360): 0
 libinput Button Scrolling Button Lock Enabled Default (361): 0
 libinput Accel Speed (349): -1.000000
 libinput Accel Speed Default (350): 0.000000
 libinput Accel Profiles Available (362): 1, 1
 libinput Accel Profile Enabled (363): 1, 0
 libinput Accel Profile Enabled Default (364): 1, 0
 libinput Calibration Matrix (365): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
 libinput Calibration Matrix Default (366): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
 libinput Left Handed Enabled (351): 0
 libinput Left Handed Enabled Default (352): 0
 libinput Send Events Modes Available (353): 1, 0
 libinput Send Events Mode Enabled (354): 0, 0
 libinput Send Events Mode Enabled Default (355): 0, 0
 Device Node (297): "/dev/input/event15"
 Device Product ID (296): 1267, 12608
 libinput Drag Lock Buttons (356): <no items>
 libinput Horizontal Scroll Enabled (357): 1
````

and the output of: cat /dev/input/event15 is empty when I try to use the touchpad, meaning that it's not sending events to that device..

Revision history for this message
Coiby Xu (coiby) wrote :

Sorry I made another mistake. hid_rmi is specifically for the Synaptics RMI4 touchpads. We use let hid_elan handle this device. The vendor&product id should be added to elan_devices in drivers/hid/hid-elan.c. Can you give the following patch a try?

diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c
index 45c4f888b7c4..0cf427a94897 100644
--- a/drivers/hid/hid-elan.c
+++ b/drivers/hid/hid-elan.c
@@ -525,6 +525,7 @@ static const struct hid_device_id elan_devices[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_HP_X2_10_COVER),
          .driver_data = ELAN_HAS_LED },
        { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_TOSHIBA_CLICK_L9W) },
+ { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x3140) },
        { }
 }

Revision history for this message
Stefano Galassi (iltoga) wrote :

no luck man..
now I've got a hid_elan module loaded, but touchpad is still dead:

````
hid_magicmouse 20480 0
hidp 32768 1
bluetooth 737280 38 btrtl,hidp,btintel,btbcm,bnep,btusb,rfcomm
hid_elan 16384 0
led_class 20480 4 input_leds,iwlmvm,hid_elan,snd_hda_codec_realtek
i2c_hid 32768 0
hid_generic 16384 0
usbhid 65536 0
hid 147456 6 i2c_hid,hidp,usbhid,hid_elan,hid_generic,hid_magicmouse
usbcore 335872 5 xhci_hcd,usbhid,uvcvideo,btusb,xhci_pci
````

and output of xinput:
````
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ AKKO AKKO 3084BT Wireless Radio Control id=12 [slave pointer (2)]
⎜ ↳ AKKO AKKO 3084BT Consumer Control id=13 [slave pointer (2)]
⎜ ↳ iTrobPad id=15 [slave pointer (2)]
⎜ ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control id=17 [slave pointer (2)]
⎜ ↳ MSFT0001:00 04F3:3140 id=20 [slave pointer (2)]
⎜ ↳ Elan Touchpad id=21 [slave pointer (2)]
````

both pointer devices with id 20 and 21 don't receive any event on their respective /dev/input/event*

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (3.3 KiB)

Although Elan Touchpad is listed in the output of xinput, "0" in "hid_elan 16384 0" shows hid_elan is not being used. Is there an entry named "*:04F3:3140.*" under /sys/bus/hid/drivers/hid-elan/?

> plus I found that this device is already defined in hid-elan.c

I couldn't find the string 0x3140. Do you mean the device is defined in another way?

Yesterday, I used evtest to monitor the Synaptics touchpad and was surprised to find when hid_multitouch is taking over the device, multiple fingers (up to 4) touching could be detected,

```
$ sudo evtest
/dev/input/event14: MSFT0001:00 06CB:7F28 Mouse
/dev/input/event15: MSFT0001:00 06CB:7F28 Touchpad
Select the device event number [0-21]: 15
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x6cb product 0x7f28 version 0x100
Input device name: "MSFT0001:00 06CB:7F28 Touchpad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 328 (BTN_TOOL_QUINTTAP)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value 0
      Min 0
      Max 1224
      Resolution 12
    Event code 1 (ABS_Y)
      Value 0
      Min 0
      Max 804
      Resolution 12
    Event code 47 (ABS_MT_SLOT)
      Value 0
      Min 0
      Max 4
    Event code 53 (ABS_MT_POSITION_X)
      Value 0
      Min 0
      Max 1224
      Resolution 12
    Event code 54 (ABS_MT_POSITION_Y)
      Value 0
      Min 0
      Max 804
      Resolution 12
    Event code 55 (ABS_MT_TOOL_TYPE)
      Value 0
      Min 0
      Max 2
    Event code 57 (ABS_MT_TRACKING_ID)
      Value 0
      Min 0
      Max 65535
  Event type 4 (EV_MSC)
    Event code 5 (MSC_TIMESTAMP)
Properties:
  Property type 0 (INPUT_PROP_POINTER)
  Property type 2 (INPUT_PROP_BUTTONPAD)
Testing ... (interrupt to exit)
Event: time 1597225994.180980, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1597225994.180980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 765
Event: time 1597225994.180980, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 220
Event: time 1597225994.180980, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1597225994.180980, type 1 (EV_KEY), code 325 (BTN_TOOL_FINGER), value 1
Event: time 1597225994.180980, type 3 (EV_ABS), code 0 (ABS_X), value 765
Event: time 1597225994.180980, type 3 (EV_ABS), code 1 (ABS_Y), value 220
Event: time 1597225994.180980, type 4 (EV_MSC), code 5 (MSC_TIMESTAMP), value 0
Event: time 1597225994.180980, -------------- SYN_REPORT ------------
```

The only issue is the pointer won't move when I my fingers move on the touchpad. Compared with a working touchpad, the only difference is the lack of ABS_PRESSURE events. If I use hid-rmi, these ABS_PRESSURE events would be generated. It seems ABS_PRESSURE events are needed to make the pointer move. If I could let hid_multitouch collect ABS_PRESSURE events...

Read more...

Revision history for this message
Stefano Galassi (iltoga) wrote :
Download full text (3.6 KiB)

sudo evtest

````
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: AT Translated Set 2 keyboard
/dev/input/event1: AKKO AKKO 3084BT
/dev/input/event2: AKKO AKKO 3084BT Keyboard
/dev/input/event3: AKKO AKKO 3084BT Wireless Radio Control
/dev/input/event4: AKKO AKKO 3084BT Consumer Control
/dev/input/event5: AKKO AKKO 3084BT
/dev/input/event6: Integrated Camera: Integrated C
/dev/input/event7: Logitech M350
/dev/input/event8: ITE Tech. Inc. ITE Device(8910) Keyboard
/dev/input/event9: ITE Tech. Inc. ITE Device(8910) Consumer Control
/dev/input/event10: ITE Tech. Inc. ITE Device(8910) Wireless Radio Control
/dev/input/event11: Lid Switch
/dev/input/event12: Power Button
/dev/input/event13: Power Button
/dev/input/event14: Video Bus
/dev/input/event15: Video Bus
/dev/input/event16: PC Speaker
/dev/input/event17: Elan Touchpad
/dev/input/event18: MSFT0001:00 04F3:3140
/dev/input/event19: Ideapad extra buttons
/dev/input/event20: HDA NVidia HDMI/DP,pcm=3
/dev/input/event21: HDA NVidia HDMI/DP,pcm=7
/dev/input/event22: HDA NVidia HDMI/DP,pcm=8
/dev/input/event23: HDA NVidia HDMI/DP,pcm=9
/dev/input/event24: HDA NVidia HDMI/DP,pcm=10
/dev/input/event25: HDA Digital PCBeep
/dev/input/event26: HD-Audio Generic Mic
/dev/input/event27: HD-Audio Generic Headphone
Select the device event number [0-27]: 17
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x4f3 product 0x3140 version 0x100
Input device name: "Elan Touchpad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 328 (BTN_TOOL_QUINTTAP)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value 0
      Min 0
      Max 3209
      Resolution 31
    Event code 1 (ABS_Y)
      Value 0
      Min 0
      Max 2097
      Resolution 31
    Event code 24 (ABS_PRESSURE)
      Value 0
      Min 0
      Max 255
    Event code 47 (ABS_MT_SLOT)
      Value 0
      Min 0
      Max 4
    Event code 53 (ABS_MT_POSITION_X)
      Value 0
      Min 0
      Max 3209
    Event code 54 (ABS_MT_POSITION_Y)
      Value 0
      Min 0
      Max 2097
    Event code 57 (ABS_MT_TRACKING_ID)
      Value 0
      Min 0
      Max 65535
    Event code 58 (ABS_MT_PRESSURE)
      Value 0
      Min 0
      Max 255
Properties:
  Property type 0 (INPUT_PROP_POINTER)
  Property type 2 (INPUT_PROP_BUTTONPAD)
Testing ... (interrupt to exit)

````

sudo evtest (I choose 18)

````
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x4f3 product 0x3140 version 0x100
Input device name: "MSFT0001:00 04F3:3140"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 256 (BTN_0)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 330 (BTN_TOUCH)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
    Event code 6 (REL_HW...

Read more...

Revision history for this message
Stefano Galassi (iltoga) wrote :
Download full text (6.4 KiB)

about my previous post..
> I couldn't find the string 0x3140. Do you mean the device is defined in another way?
I am really sorry (it might have been late at night :) ) that line it was actually added by the kernel patch I prepared (I am building the whole kernel using makepkg and patching is done automatically)..

one more thing I found is, when I remove and insert again i2c_hid module (with rmmod and modprobe), I get this messages from system journal

journalctl -f

````
Aug 13 16:36:48 hypervisor kernel: i2c_hid i2c-MSFT0001:00: supply vdd not found, using dummy regulator
Aug 13 16:36:48 hypervisor kernel: i2c_hid i2c-MSFT0001:00: supply vddl not found, using dummy regulator
Aug 13 16:36:48 hypervisor kernel: input: Elan Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0008/input/input40
Aug 13 16:36:48 hypervisor kernel: input: MSFT0001:00 04F3:3140 as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0008/input/input39
Aug 13 16:36:48 hypervisor kernel: elan 0018:04F3:3140.0008: input,hidraw5: I2C HID v1.00 Mouse [MSFT0001:00 04F3:3140] on i2c-MSFT0001:00
Aug 13 16:36:48 hypervisor sudo[4748]: pam_unix(sudo:session): session closed for user root
Aug 13 16:36:48 hypervisor /usr/lib/gdm-x-session[1902]: (II) config/udev: Adding input device Elan Touchpad (/dev/input/mouse1)
Aug 13 16:36:48 hypervisor /usr/lib/gdm-x-session[1902]: (II) No input driver specified, ignoring this device.
Aug 13 16:36:48 hypervisor /usr/lib/gdm-x-session[1902]: (II) This device may have been added with another device file.
Aug 13 16:36:48 hypervisor /usr/lib/gdm-x-session[1902]: (II) config/udev: Adding input device MSFT0001:00 04F3:3140 (/dev/input/mouse2)
Aug 13 16:36:48 hypervisor /usr/lib/gdm-x-session[1902]: (II) No input driver specified, ignoring this device.
Aug 13 16:36:48 hypervisor /usr/lib/gdm-x-session[1902]: (II) This device may have been added with another device file.
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (II) config/udev: Adding input device MSFT0001:00 04F3:3140 (/dev/input/event18)
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (**) MSFT0001:00 04F3:3140: Applying InputClass "evdev pointer catchall"
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (**) MSFT0001:00 04F3:3140: Applying InputClass "libinput pointer catchall"
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (II) Using input driver 'libinput' for 'MSFT0001:00 04F3:3140'
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (II) systemd-logind: got fd for /dev/input/event18 13:82 fd 56 paused 0
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (**) MSFT0001:00 04F3:3140: always reports core events
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (**) Option "Device" "/dev/input/event18"
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (**) Option "_source" "server/udev"
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (II) event18 - MSFT0001:00 04F3:3140: is tagged by udev as: Mouse Pointingstick
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-session[1902]: (II) event18 - MSFT0001:00 04F3:3140: device is a pointer
Aug 13 16:36:49 hypervisor /usr/lib/gdm-x-sessi...

Read more...

Revision history for this message
Helmut Stult (helmut-stult) wrote :

The vendor ID is MSFT0001:00 04F3:3140 - therefore the patch cannot work

https://linux-hardware.org/?probe=b28405eeb0

no longer affects: linux
Revision history for this message
Stefano Galassi (iltoga) wrote :

what does it means "no longer affects: linux"?
in mine and many others cases it does still affect linux and no valid solutions to this issue have been found to date

Revision history for this message
Marton Danko (golddragon007) wrote :

I've added wrong distro and when I'm removed it from the list it created that comment automatically. This interface not too intuitive for me. Sorry.

Revision history for this message
Stefano Galassi (iltoga) wrote :

hehe no worries.. I was thinking someone was trying to prematurely close the issue ;)

Revision history for this message
daleli (daleli) wrote :

This bug affects me a lot. I visit this page everyday to see whether if someone fix it. :(

information type: Public → Public Security
Revision history for this message
Olcay Ozturkmen (o-ozturkmen) wrote :

Does this bug affects amd version only? according to arch wiki touchpad works on Intel(5i and 5pi) version https://wiki.archlinux.org/index.php/Laptop/Lenovo#Legion_series

Revision history for this message
daleli (daleli) wrote :

Not sure that intel version(5i and 5pi) has the same touchpad. Legion5 amd has two touchpad: MSFT0001:00 06CB:7F28, and MSFT0001:00 04F3:3140. IdeaPad 5 15 touchpad is ELAN0001:00 04F3:3140, this page may be helpful: https://bugzilla.kernel.org/show_bug.cgi?id=207759

information type: Public Security → Public
Revision history for this message
Coiby Xu (coiby) wrote :

Hi Stefano,

> sudo evtest
>
> ````
> /dev/input/event17: Elan Touchpad
> /dev/input/event18: MSFT0001:00 04F3:3140
> Select the device event number [0-27]: 17
> Input driver version is 1.0.1
> Input device ID: bus 0x18 vendor 0x4f3 product 0x3140 version 0x100
> Input device name: "Elan Touchpad"
> Supported events:
> Event type 0 (EV_SYN)
> Event type 1 (EV_KEY)
> Event code 272 (BTN_LEFT)
> Event code 325 (BTN_TOOL_FINGER)
> Event code 328 (BTN_TOOL_QUINTTAP)
> Event code 330 (BTN_TOUCH)
> Event code 333 (BTN_TOOL_DOUBLETAP)
> Event code 334 (BTN_TOOL_TRIPLETAP)
> Event code 335 (BTN_TOOL_QUADTAP)
> Event type 3 (EV_ABS)
> Event code 0 (ABS_X)
> Value 0
> Min 0
> Max 3209
> Resolution 31
> Event code 1 (ABS_Y)
> Value 0
> Min 0
> Max 2097
> Resolution 31
> Event code 24 (ABS_PRESSURE)
> Value 0
> Min 0
> Max 255
> Event code 47 (ABS_MT_SLOT)
> Value 0
> Min 0
> Max 4
> Event code 53 (ABS_MT_POSITION_X)
> Value 0
> Min 0
> Max 3209
> Event code 54 (ABS_MT_POSITION_Y)
> Value 0
> Min 0
> Max 2097
> Event code 57 (ABS_MT_TRACKING_ID)
> Value 0
> Min 0
> Max 65535
> Event code 58 (ABS_MT_PRESSURE)
> Value 0
> Min 0
> Max 255
> Properties:
> Property type 0 (INPUT_PROP_POINTER)
> Property type 2 (INPUT_PROP_BUTTONPAD)
> Testing ... (interrupt to exit)
>
> ````

Thank you for providing this! So "*_PRESSURE" events are also supported. When you move your fingers or touch the touchpad, are there any event as follows reported?
> Event: time 1597225994.180980, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
> Event: time 1597225994.180980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 765
> Event: time 1597225994.180980, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 220
> Event: time 1597225994.180980, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1

Revision history for this message
Stefano Galassi (iltoga) wrote :

hey Coybi,

unfortunately using the 'elan touchpad patch' didn't work because probably MSFT0001:00 04F3:3140 is not an elan device.
with and without patch, no events are ever recorded by pressing or swiping the surface of the TouchPad

Revision history for this message
Coiby Xu (coiby) wrote :

The code 04F3 indeed represents the vendor ELAN. It seems I need to dig into the lower level driver (one that talk to the touchd firmware directly) to find out more info.

Btw, I Googled "Linux ELAN touchpad" and found another solution [kernel - ELAN Touchpad not working on Lenovo Thinkbook with Ubuntu 18.04 - Ask Ubuntu](https://askubuntu.com/questions/1205382/elan-touchpad-not-working-on-lenovo-thinkbook-with-ubuntu-18-04). Have you tried it? Can you also show me the result of `sudo acpidump | grep -C3 ELAN`? I'm curious to know if this device's ID has been defined in include/linux/input/elan-i2c-ids.h.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

"unfortunately using the 'elan touchpad patch' didn't work because probably MSFT0001:00 04F3:3140 is not an elan device."

Thats not really correct. The touchpad is from Elan (see Vendor-ID 04F3) and there are the following two versions:

ELAN0001:00 04F3:3140
MSFT0001:00 04F3:3140

The MSFT (where MS is probably the abbreviation for MicroSoft) seems to have a different firmware that meets Microsoft's requirements and there is no driver for it under Linux yet.

Perhaps the following article found on "https://windowsarea.de/2016/12/microsoft-praezisionstouchpads- Werden-pflicht-unter-windows-10/" will bring some clarity to the matter.
I quickly translated it with Google.

________________

Microsoft: Precision touchpad becomes mandatory for Windows 10 notebooks

During the WinHEC conference in Taiwan, Microsoft announced that the precision touchpad will be mandatory in a later Windows update from the Windows hardware compatibility program.

This means that manufacturers who do not install such touchpads will not receive certification for Windows. Manufacturers can still install Windows, but this certificate is simply missing. It's a step in the right direction, especially since Windows machines have long been known for their weak input devices. A lot has changed in the last few years, especially due to Microsoft's commitment. In Windows 10, for example, standard gestures were defined, which are mostly supported by the manufacturers.
Precision touchpad ≠ good touchpad

However, the fact that Microsoft will require a precision touchpad in the future does not mean that it has to be a good touchpad. “Precision touchpad” is basically just the term Microsoft uses to summarize those touchpads that communicate via the driver integrated in Windows. In other words: The touchpad options integrated in the settings can already be used for the touchpad from Redstone 2. Devices that use a proprietary Synaptics driver, for example, cannot be controlled with it.

It doesn't matter whether the touchpad comes from Microsoft, Apple, Synaptics or a cheap Chinese village. As long as the manufacturer controls its touchpad via the Windows driver, it is a “precision touchpad” for Microsoft. The Trekstor SurfBook W1 uses the Windows driver and is therefore a “precision touchpad”, but the HP Specter x360 is a proprietary panel for the settings. The latter undoubtedly has the better quality unit, the only difference is that the precision touchpad can be configured in the Windows settings and the HP touchpad can only be configured using software specially written for it.
a step in the right direction

The fact that touchpads are to be configured exclusively via the Windows settings in the future is an important step. Users can find their way around it better and the use of a touchpad under Windows is also simplified.

Revision history for this message
Stefano Galassi (iltoga) wrote :

thank you for the explanation Helmut!
so, as far as I can understand we can only wait until someone implements a proper linux driver for this (Elan) device, is that correct?

Revision history for this message
Francesco Grieco (fgrieco) wrote :

I think this issue is covering different devices.

I have a Lenovo Ideapad 14ARE05 with the following touchpad:

MSFT0004:00 06CB:CD98

(synaptic? similar to the Legion, I suppose)

And I have the same problem of others, the touchpad sometime works, sometime not.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Right, it affects all MSFT touchpads.
At the moment there is nothing for MSFT - we will have to be very patient and hope, that someone can find a driver for it.

Revision history for this message
Nicolas Rogues (nrogues) wrote :

Thanks Helmut and Francesco

I have a (bold ?) question.

As previously reported, it works (at least, moves and clicks as expected, not talking gestures here) in the UEFI BIOS prior to the loading of any operating system.

Does this mean there is a kind of working driver in code of the UEFI BIOS ? If yes, any hope to get it from Lenovo or other vendors ?

Revision history for this message
wangjun (biggerchina) wrote :

my computer is Lenovo Legion R7000 ,with the MSFT0001:00 04F3:3140 touchpad.

and i had tested the kernel 5.9.0 rc2 on fedora 32 with no lucky,

Revision history for this message
wangjun (biggerchina) wrote :

Lenovo release new version BIOS for Legion R7000 or Legion 5-15ARH05.

2020/8/20
BIOS Version: EUCN22WW,
EC Version: EUEC22WW

EUCN22WW:
BIOS Notification:
1. Fixed
  1) Fix panel brightness almost not changed when change from the level 0 to level 1.

2. Add
  1) None.

3. Modified
  1) Follow PM requirement to disable GPU OC feature;
  2) Hide the "keyboard backlight" option in Lenovo Vantage for RGB keyboard SKU.

EC Notification:
1. Fixed
  1) None.

2. Add
  1) None.

3. Modified
  1) None.

But the touchpad still doesn't work。

Eugene (zhekehz)
information type: Public → Public Security
information type: Public Security → Private Security
information type: Private Security → Public
Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby) ,i had tested by patch the kernel source in the file :include/linux/input/elan-i2c-ids.h with MSFT0001 , ELAN3140 ,04f33140,

but it doesn't work。

and sudo acpidump | grep -C3 ELAN result as follows:

ra@bogon Downloads]$ sudo acpidump | grep -C3 ELAN
[sudo] password for ra:
    E310: A2 1F 01 70 99 69 00 5F 54 5F 31 A0 0C 93 5F 54 ...p.i._T_1..._T
    E320: 5F 31 01 A4 11 03 01 03 A1 06 A4 11 03 01 00 A5 _1..............
    E330: A1 0F A0 09 93 5F 54 5F 30 01 A4 00 A1 03 A4 00 ....._T_0.......
    E340: A5 A1 06 A4 11 03 01 00 5B 82 40 13 45 4C 41 4E ........[.@.ELAN
    E350: 08 5F 48 49 44 0C 41 D0 0C 50 08 5F 43 49 44 0D ._HID.A..P._CID.
    E360: 50 4E 50 30 43 35 30 00 08 5F 55 49 44 01 14 47 PNP0C50.._UID..G
    E370: 05 5F 43 52 53 00 08 52 42 55 46 11 45 04 0A 41 ._CRS..RBUF.E..A
--
    E580: A2 1F 01 70 99 69 00 5F 54 5F 31 A0 0C 93 5F 54 ...p.i._T_1..._T
    E590: 5F 31 01 A4 11 03 01 03 A1 06 A4 11 03 01 00 A5 _1..............
    E5A0: A1 0F A0 09 93 5F 54 5F 30 01 A4 00 A1 03 A4 00 ....._T_0.......
    E5B0: A5 A1 06 A4 11 03 01 00 5B 82 40 13 45 4C 41 4E ........[.@.ELAN
    E5C0: 08 5F 48 49 44 0C 41 D0 0C 50 08 5F 43 49 44 0D ._HID.A..P._CID.
    E5D0: 50 4E 50 30 43 35 30 00 08 5F 55 49 44 01 14 47 PNP0C50.._UID..G
    E5E0: 05 5F 43 52 53 00 08 52 42 55 46 11 45 04 0A 41 ._CRS..RBUF.E..A
--
    EFB0: 49 44 0D 50 4E 50 30 43 35 30 00 08 5F 53 55 42 ID.PNP0C50.._SUB
    EFC0: 0D 58 58 58 58 30 30 30 30 00 14 46 05 5F 49 4E .XXXX0000..F._IN
    EFD0: 49 00 A0 25 93 54 50 54 59 01 70 0D 4D 53 46 54 I..%.TPTY.p.MSFT
    EFE0: 30 30 30 31 00 5F 48 49 44 70 0D 45 4C 41 4E 30 0001._HIDp.ELAN0
    EFF0: 30 30 31 00 5F 53 55 42 A0 26 93 54 50 54 59 0A 001._SUB.&.TPTY.
    F000: 02 70 0D 4D 53 46 54 30 30 30 31 00 5F 48 49 44 .p.MSFT0001._HID
    F010: 70 0D 53 59 4E 41 30 30 30 31 00 5F 53 55 42 A4 p.SYNA0001._SUB.
[ra@bogon Downloads]$

Revision history for this message
wangjun (biggerchina) wrote :

on kernel 5.8.5 fedora 32,touchpad does not work too.

juziy (jukz)
no longer affects: linux
Revision history for this message
Olcay Ozturkmen (o-ozturkmen) wrote :

It does affect linux kernel.

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (6.1 KiB)

Hi Helmut,

Thank you for sharing the article on MSFT (I'm been long wondering what does MSFT mean).

> Right, it affects all MSFT touchpads.
>
> At the moment there is nothing for MSFT - we will have to be very patient and hope, that someone can find a driver for it.

I think The Microsoft Precision Touchpad has been implemented in drivers/hid/hid-multitouch.c.

$ git log --grep="Precision Touchpad"
commit 9152c7d77d87e2b6b9ccc21bb52f8eea15744f50
Author: Dmitry Torokhov <email address hidden>
Date: Fri Jul 13 16:13:52 2018 +0200

    HID: multitouch: report MT_TOOL_PALM for non-confident touches

    According to Microsoft specification [1] for Precision Touchpads (and
    Touchscreens) the devices use "confidence" reports to signal accidental
    touches, or contacts that are "too large to be a finger". Instead of
    simply marking contact inactive in this case (which causes issues if
    contact was originally proper and we lost confidence in it later, as
    this results in accidental clicks, drags, etc), let's report such
    contacts as MT_TOOL_PALM and let userspace decide what to do.

    [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection

And https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/legion-series/legion-5-15arh05/downloads/driver-list/ doesn't list the driver for the touchpad. According to this Chinese webpage https://newsupport.lenovo.com.cn/driveDownloads_detail.html?driveId=47994, no special driver is needed for Windows 10.

So maybe there are some issues in drivers/hid/hid-mulititouch.c. For for the Synaptics touchpad of this model, the pointer won't move but 2/3/4 fingers touching events can be reported. And for the Elan touchpad, according to Stefano, no events are reported.

Since both touchpads works on Windows and "Precision touchpad becomes mandatory for Windows 10 notebooks", we can fix both touchpads by fixing hid-mulittouch. Can someone show me the content of /sys/kernel/debug/hid/*\:04F3\:3140.0001/rdesc which has the Report Descriptors when your ELAN touchpad is being handled by hid-multitouch? For example, for the Synaptics touchpad,

$ cat /sys/kernel/debug/hid/0018\:06CB\:7F28.0001/rdesc
05 01 09 02 a1 01 85 02 09 01 a1 00 05 09 19 01 29 02 15 00 25 01 75 01 95 02 81 02 95 06 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 c0 c0 05 0d 09 05 a1 01 85 03 05 0d 09 22 a1 02 15 00 25 01 09 47 0
9 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 c8 04 75 10 55 0e 65 11 09 30 35 00 46 fc 03 95 01 81 02 46 9d 02 26 24 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47
 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 c8 04 75 10 55 0e 65 11 09 30 35 00 46 fc 03 95 01 81 02 46 9d 02 26 24 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09
47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 c8 04 75 10 55 0e 65 11 09 30 35 00 46 fc 03 95 01 81 02 46 9d 02 26 24 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 0
9 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05...

Read more...

Revision history for this message
Stefano Galassi (iltoga) wrote :

Hi again Coiby,
I attach to this the output of 'cat /sys/kernel/debug/hid/0018:04F3:3140.0001/rdesc'

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (28.0 KiB)

Hi wangjun (biggerchina),

Thank you for testing the linux/input/elan-i2c-ids.h! So somehow elan_i2c can't handle this device either. Is there anything like "elan_i2c i2c-ELAN060F:00: invalid report id data" in dmesg as similar to https://bugzilla.kernel.org/show_bug.cgi?id=203467?

Btw, when hid-multitouch is handling your touchpad device, what's the result of `sudo hid-recorder` (this tool is contained in hid-tools)?

$ sudo hid-recorder
Available devices:
/dev/hidraw0: MSFT0001:00 06CB:7F28
/dev/hidraw1: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-1]: 0
# MSFT0001:00 06CB:7F28
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x02, // Report ID (2) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x01, // Input (Cnst,Arr,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x15, 0x81, // Logical Minimum (-127) 38
# 0x25, 0x7f, // Logical Maximum (127) 40
# 0x75, 0x08, // Report Size (8) 42
# 0x95, 0x02, // Report Count (2) 44
# 0x81, 0x06, // Input (Data,Var,Rel) 46
# 0xc0, // End Collection 48
# 0xc0, // End Collection 49
# 0x05, 0x0d, // Usage Page (Digitizers) 50
# 0x09, 0x05, // Usage (Touch Pad) 52
# 0xa1, 0x01, // Collection (Application) 54
# 0x85, 0x03, // Report ID (3) 56
# 0x05, 0x0d, // Usage Page (Digitizers) 58
# 0x09, 0x22, // Usage (Finger) 60
# 0xa1, 0x02, // Collection (Logical) 62
# 0x15, 0x00, // Logical Minimum (0) 64
# 0x25, 0x01, // Log...

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (16.0 KiB)

@Coiby Xu (coiby)

there is not any text like "invalid report id data" in dmesg output.

and on fedora 32 kernel 5.8.5

=====================
[ra@bogon ~]$ dmesg | grep MSFT
[ 0.004946] ACPI: SSDT 0x00000000CDFF4000 007216 (v02 LENOVO CB-01 00000001 MSFT 04000000)
[ 1.534909] i2c_hid i2c-MSFT0001:00: supply vdd not found, using dummy regulator
[ 1.534921] i2c_hid i2c-MSFT0001:00: supply vddl not found, using dummy regulator
[ 1.679063] input: MSFT0001:00 04F3:3140 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input6
[ 1.679354] input: MSFT0001:00 04F3:3140 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input7
[ 1.679516] hid-generic 0018:04F3:3140.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:00 04F3:3140] on i2c-MSFT0001:00
[ 1.744137] input: MSFT0001:00 04F3:3140 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input8
[ 1.744252] input: MSFT0001:00 04F3:3140 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input9
[ 1.744326] hid-multitouch 0018:04F3:3140.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:00 04F3:3140] on i2c-MSFT0001:00
[ra@bogon ~]$

====================
and

====================

[ra@bogon ~]$ sudo hid-recorder
Available devices:
/dev/hidraw0: MSFT0001:00 04F3:3140
/dev/hidraw1: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw2: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw3: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw4: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-4]: 0
# MSFT0001:00 04F3:3140
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x01, // Report ID (1) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x03, // Input (Cnst,Var,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x09, 0x38, // Usage (Wheel) 38
# 0x15, 0x81, ...

Revision history for this message
wangjun (biggerchina) wrote :

and after line

I: 18 04f3 3140

no more output , event i touch the touchpad.

Revision history for this message
Stefano Galassi (iltoga) wrote :

hey guys there is a new thread on official lenovo forum about this.
let's make them hear our voice!

https://forums.lenovo.com/t5/Gaming-Laptops/Lenovo-Legion-5-15ARH05-Touchpad-not-working-in-any-Linux/m-p/5035512

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Stefano Galassi (iltoga) and wangjun (biggerchina)

Thank you for providing the info!

So this ELAN touchpad's HID reporter descriptors could be read and parsed but it couldn't be started at all since no HID reports are received.

Now the only way I can think of to tackle this issue is to install Windows Driver Kit to capture&analyze
HID reports to see what reports are sent/received from/by the Windows driver while playing with the touchpad under Windows? But my laptop comes with the Synnaptics touchpad, I couldn't do this on my own computer. Is it possible for you to do it for me? Here's the how-to https://techcommunity.microsoft.com/t5/microsoft-usb-blog/how-to-capture-and-read-hid-traces-in-windows-8-1/ba-p/270839.

Revision history for this message
Coiby Xu (coiby) wrote :

And for those who have the Synaptics touchpad, I've found a way to make the touchpad almost work. You can apply the following patch which will make kernel use hid-rmi handle the device without blacklisting hid-mulitouch,

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index a8e3b2796be8..9984e31c8914 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1102,6 +1102,7 @@

 #define I2C_VENDOR_ID_SYNAPTICS 0x06cb
 #define I2C_PRODUCT_ID_SYNAPTICS_SYNA2393 0x7a13
+#define I2C_PRODUCT_ID_SYNAPTICS_SYNA7f28 0x7f28

 #define USB_VENDOR_ID_SYNAPTICS 0x06cb
 #define USB_DEVICE_ID_SYNAPTICS_TP 0x0001
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index a65aef6a322f..a11366f6ccd8 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -568,6 +568,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_RAZER, USB_DEVICE_ID_RAZER_BLADE_14) },
        { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_REZEL) },
+ { HID_I2C_DEVICE(I2C_VENDOR_ID_SYNAPTICS, I2C_PRODUCT_ID_SYNAPTICS_SYNA7f28) },
 #endif
 #if IS_ENABLED(CONFIG_HID_ROCCAT)
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index 7f41213d5ae3..e74b54f1b0c4 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -759,6 +759,7 @@ static const struct hid_device_id rmi_id[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_REZEL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5),
                .driver_data = RMI_DEVICE_OUTPUT_SET_REPORT },
+ { HID_I2C_DEVICE(I2C_VENDOR_ID_SYNAPTICS, I2C_PRODUCT_ID_SYNAPTICS_SYNA7f28) },
        { HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) },
        { }
 };

One left issue is the single clicking is not sensitive enough. I need to let my finger linger on the touchpad for a while (like 0.5s). I'll send the patches upstream after fixing this issue.

Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby) ,

on my windows 10 ,

it report error!

========================================================

Microsoft Windows [Version 10.0.19042.450]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>logman create trace -n HID_WPP -o %SystemRoot%\Tracing\HID_WPP.etl -nb 128 640 -bs 128

Error:
Data Collector already exists.

C:\WINDOWS\system32>logman update trace -n HID_WPP -p {E742C27D-29B1-4E4B-94EE-074D3AD72836} 0x7FFFFFFF 0xFF
The command completed successfully.

C:\WINDOWS\system32>logman start -n HID_WPP

Error:
The filename, directory name, or volume label syntax is incorrect.

C:\WINDOWS\system32>logman stop -n HID_WPP

Error:
Data Collector Set is not running.

C:\WINDOWS\system32>logman update trace -n HID_WPP -p {47c779cd-4efd-49d7-9b10-9f16e5c25d06} 0x7FFFFFFF 0xFF
The command completed successfully.

C:\WINDOWS\system32>logman start -n HID_WPP

Error:
The filename, directory name, or volume label syntax is incorrect.

C:\WINDOWS\system32>logman update trace -n HID_WPP -p {896f2806-9d0e-4d5f-aa25-7acdbf4eaf2c} 0x7FFFFFFF 0xFF
The command completed successfully.

C:\WINDOWS\system32>logman start -n HID_WPP

Error:
The filename, directory name, or volume label syntax is incorrect.

C:\WINDOWS\system32>logman update trace -n HID_WPP -p {07699FF6-D2C0-4323-B927-2C53442ED29B} 0x7FFFFFFF 0xFF
The command completed successfully.

C:\WINDOWS\system32>logman start -n HID_WPP

Error:
The filename, directory name, or volume label syntax is incorrect.

C:\WINDOWS\system32>logman update trace -n HID_WPP -p {0107cf95-313a-473e-9078-e73cd932f2fe} 0x7FFFFFFF 0xF
The command completed successfully.

C:\WINDOWS\system32>logman start -n HID_WPP

Error:
The filename, directory name, or volume label syntax is incorrect.

C:\WINDOWS\system32>logman stop -n HID_WPP

Error:
Data Collector Set is not running.

C:\WINDOWS\system32>

Revision history for this message
Gerald Bachner (geri1403) wrote :

Hi,

attached the etl tracefile. I could not get the pdb files from the Microsoft symbol server to view it in TraceView. I hope this helps.

Revision history for this message
Gerald Bachner (geri1403) wrote :

Here the outfile from TraceView

Revision history for this message
Gerald Bachner (geri1403) wrote :
Revision history for this message
stillnurs (stillnurs) wrote :

Hey palls, it's Lenovo Legion Y540, and I just signed up here to suggest a solution for touchpad that helped for me. Since I have the similar touchpad types as here in the topic MSFT0001:01 04F3:309E .
I was wandering same as many of you for several days since installing Linux, (it's Manjaro btw, but anyways just try if you can, who knows, maybe it will work for you too)

So the solution for touchpad to get it working:

1/ sudo pacman -Rsn xf86-input-synaptics

2/ sudo pacman -Syu xf86-input-libinput

(create a new file if you don't have existing)
3/ /etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
        Identifier "MyTouchpad"
        MatchIsTouchpad "on"
        Driver "libinput"
        Option "Tapping" "on"
EndSection

Revision history for this message
stillnurs (stillnurs) wrote :

update:

for the 3-step, you can edit xx-libinput.conf file if you have existing.

You will find a line which states the similar to these:

Section "InputClass"
        Identifier "MyTouchpad"
        MatchIsTouchpad "on"
        Driver "libinput"
        Option "Tapping" "on" #just add this OPTION line
EndSection

Revision history for this message
wangjun (biggerchina) wrote :

new kernel on fedora test result:

  5.8.7 not work
  5.9-rc4 not work

Revision history for this message
PD (pd1986) wrote :

@Stillnurs

Your advice doesn't work for me. Kernel 5.8.6

Actually, there is no event triggered by touchpad seen via "libinput debug-events"

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Stillnurs

Please do not confuse apples with oranges!

We're talking about the Lenovo Legion-5 15ARH05 with the MSFT0001: 00 04F3: 3140 touchpad.
It may be nice that it works with the MSFT0001: 01 04F3: 309E on your Legion Y540, but that is a different hardware and therefore not helpful.

Revision history for this message
PD (pd1986) wrote :

Referring to another case #207759 (https://bugzilla.kernel.org/show_bug.cgi?id=207759)

I am curious why ideapad 15 has the same Touchpad ID and someone could solve the issue by blacklist elan-i2c but Legion 15ARH05 cannot, especially I didn't complied elan-i2c or elants-i2c. Legion 15ARH05 doesn't have touchscreen. Very strange

dmesg | grep -i 04f3
[ 2.095379] input: MSFT0001:00 04F3:3140 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input16
[ 2.095450] input: MSFT0001:00 04F3:3140 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input17
[ 2.095506] hid-generic 0018:04F3:3140.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:00 04F3:3140] on i2c-MSFT0001:00
[ 2.589937] input: MSFT0001:00 04F3:3140 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input19
[ 2.590052] input: MSFT0001:00 04F3:3140 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input20
[ 2.590112] hid-multitouch 0018:04F3:3140.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:00 04F3:3140] on i2c-MSFT0001:00

Revision history for this message
wangjun (biggerchina) wrote :

diff is amd and intel.

Revision history for this message
PD (pd1986) wrote :

@wangjun user "dl3it" in that bug has AMD too and he seemed to solve it by recompile the kernel with elan_i2c as module.

Revision history for this message
wangjun (biggerchina) wrote :

new kernel on fedora test result:

  5.8.8 not work

Revision history for this message
Shatadru Banerjee (satadru-bag) wrote :

So what is the solution? I am new to this. Has anyone successfully managed to solve the bug?

Revision history for this message
wangjun (biggerchina) wrote :

no solution to MSFT0001:00 04F3:3140

Revision history for this message
Franck VAISSIERE (royalcheese) wrote :

Tested on last manjaro k5.8, and currently on debian sid unstable (k5.8.0-1)and same issue with touchpad.

Same results as above...
Lenovo Gaming 3 15ARH05

Revision history for this message
Dimitar Kotsev (dimitar-kotsev) wrote :

On my machine the touchpad is recognized and even the click events are registered but moving produces clicking instead of moving the cursor.

Legion 5 15ARH05, kernel Linux 5.8.6-1-MANJARO,

dmesg | grep MSFT
    [ 162.390501] i2c_hid i2c-MSFT0001:00: supply vdd not found, using dummy regulator
    [ 162.390521] i2c_hid i2c-MSFT0001:00: supply vddl not found, using dummy regulator
    [ 162.670737] input: MSFT0001:00 06CB:7F28 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0003/input/input17
    [ 162.670910] input: MSFT0001:00 06CB:7F28 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0003/input/input18
    [ 162.671186] hid-generic 0018:06CB:7F28.0003: input,hidraw2: I2C HID v1.00 Mouse [MSFT0001:00 06CB:7F28] on i2c-MSFT0001:00
    [ 162.813553] input: MSFT0001:00 06CB:7F28 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0003/input/input20
    [ 162.813965] input: MSFT0001:00 06CB:7F28 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0003/input/input21
    [ 162.814182] hid-multitouch 0018:06CB:7F28.0003: input,hidraw2: I2C HID v1.00 Mouse [MSFT0001:00 06CB:7F28] on i2c-MSFT0001:00

cat /proc/bus/input/devices

    I: Bus=0018 Vendor=06cb Product=7f28 Version=0100
    N: Name="MSFT0001:00 06CB:7F28 Mouse"
    P: Phys=i2c-MSFT0001:00
    S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0004/input/input23
    U: Uniq=
    H: Handlers=event12 mouse1
    B: PROP=0
    B: EV=17
    B: KEY=30000 0 0 0 0
    B: REL=3
    B: MSC=10

    I: Bus=0018 Vendor=06cb Product=7f28 Version=0100
    N: Name="MSFT0001:00 06CB:7F28 Touchpad"
    P: Phys=i2c-MSFT0001:00
    S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0004/input/input24
    U: Uniq=
    H: Handlers=event13 mouse2
    B: PROP=5
    B: EV=1b
    B: KEY=e520 10000 0 0 0 0
    B: ABS=2e0800000000003
    B: MSC=20

When `blacklist hid_multitouch` the coursor is moving with absolute coordinates and hangs which makes it unusable.

Revision history for this message
wangjun (biggerchina) wrote :

new kernel on fedora test result:

  5.8.9 not work
  5.9-rc5 not work

Revision history for this message
lightning (lightning1141) wrote :

Legion 15 82GR, known as Legion R7000P2020H 82GR in China has the same issue.
Device id is MSFT0001:00 04F3:3186 Touchpad.
See full hardware info at https://linux-hardware.org/index.php?probe=dae1221cfd.

Revision history for this message
Ivan Gašparović (poofpoo) wrote :

Legion 5 laptop with AMD - best I could do is add "blacklist hid_multitouch" to /etc/modprobe.d/blacklist.conf , it got the mouse to move but stutters a lot.

[ 0.004610] ACPI: SSDT 0x00000000CDFF4000 007216 (v02 LENOVO CB-01 00000001 MSFT 04000000)
[ 2.467514] i2c_hid i2c-MSFT0001:00: supply vdd not found, using dummy regulator
[ 2.467526] i2c_hid i2c-MSFT0001:00: supply vddl not found, using dummy regulator
[ 2.632628] input: MSFT0001:00 06CB:7F28 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0001/input/input6
[ 2.632754] input: MSFT0001:00 06CB:7F28 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0001/input/input7
[ 2.632894] hid-generic 0018:06CB:7F28.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:00 06CB:7F28] on i2c-MSFT0001:00

I: Bus=0018 Vendor=06cb Product=7f28 Version=0100
N: Name="MSFT0001:00 06CB:7F28 Mouse"
P: Phys=i2c-MSFT0001:00
S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0001/input/input6
U: Uniq=
H: Handlers=mouse0 event6
B: PROP=0
B: EV=17
B: KEY=30000 0 0 0 0
B: REL=3
B: MSC=10

I: Bus=0018 Vendor=06cb Product=7f28 Version=0100
N: Name="MSFT0001:00 06CB:7F28 Touchpad"
P: Phys=i2c-MSFT0001:00
S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:06CB:7F28.0001/input/input7
U: Uniq=
H: Handlers=mouse1 event7
B: PROP=0
B: EV=1b
B: KEY=400 1 0 0 0 0
B: ABS=10000000003
B: MSC=10

Revision history for this message
Mike Boruta (maridius) wrote :

Hello, I have exactly the same issue as the creator of this bug. I have a Lenovo Legion 5 15ARH05H, model number 82B1000AUS (https://psref.lenovo.com/Detail/Legion/Lenovo_Legion_5_15ARH05H?M=82B1000AUS), and my touchpad is listed as MSFT0001:00 04F3:3186, not 04F3:3140.

How can I help add support for this device in linux? @Coiby Xu (coiby), were the files provided by Gerald Bachner (geri1403) in comment #83 sufficient? Is there anything I can provide to help?

Revision history for this message
Bibi (powerstreamy) wrote :

Hello, facing the same issue (obviously).

I appear to have the MSFT0001:00 04F3:3186, ordered in France, so this model does not seems to be limited to china (R7000 variant).

Blacklisting done nothing. I have seen the chinese blog but I'm a little lost with this, is it supposed to work with my model ?

I'm available if anyone need something to try or any info regarding this model.

Revision history for this message
Von (straeker) wrote :

I have the same MSFT0001:00 04F3:3186 touchpad, however, the touchpad will show as Elantech Touch Pad under windows and it is listed under the firmware section:

Elantech Touch Pad Firmware 1.0.0.2

Device type: Firmware
Manufacturer: Elantech Ltd.
Locatioon: on Microsft UEFI-Compliant System
https://www.catalog.update.microsoft.com/ScopedViewInline.aspx?updateid=88c5455c-404a-4e6b-b2a0-382ff0017406

And I found it's driver on windows is actually raw data called "SA469D-22HM_Fv0x02.bin". I tried to disassembly it but the output doesn't make much sense.

I think to try to understand why do this type of touchpads work on windows may help understanding why do them do not work on most Linux distributions.

There are also some docs about Precision Touchpad on MS' site:
https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection
https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections

Revision history for this message
PD (pd1986) wrote :

I did some search in internet. At this moment, it seems that most of the Touchpad having this issue are MSFT 04F3:xxxx.

Revision history for this message
wangjun (biggerchina) wrote :

lenovo release new bios

EUCN26WW

Revision history for this message
Solomon Thatcher (superwafflekitty) wrote :

Would it be possible to replace the track-pad with a different one from a supported manufacturer?

Revision history for this message
Coiby Xu (coiby) wrote :

Hi,

I've found out that there is something wrong with the GPIO interrupt controller under Linux. For the details, you can check https://www.spinics.net/lists/linux-input/msg69267.html. While I'm still working on the ultimate solution, you may be interested in the patch as attached which makes the touchpad work by polling HID reports from the touchpad.

I've tested the patch for the Synaptics touchpad (MSFT0001:00 06CB:7F28). I guess it will also work for the Elan touchpad (MSFT0001:00 04F3:3140) based on the ACPI DSDT. If not, could you share the following info with me,

1) dsdt.dsl

Use the following commands to get dsdt.dsl (you need to install acpica which provides iasl)

 a) sudo acpidump > acpidata.out
 b) acpixtract -sSSDT acpidata.out
 c) acpixtract -sDSDT acpidata.out
 d) iasl -da dsdt.dat ssdt*.dat

2) dmesg dump when booting kernel with the following command line parameters

i2c-designware-core.dyndbg=+p i2c-hid.debug=1

Thank you!

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "polling_pin_state_touchpad.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby)

my machine is MSFT0001:00 04F3:3140;

i tested the patch on fedora 32 kernel 5.8.11 .

the touchpad worked.

but the original patch not compile :

thread_hid undeclared

then i add one line:

static struct task_struct *thread_hid = NULL;

many thanks to your hard work!

i am in in expectation of your final version patch.

Revision history for this message
wangjun (biggerchina) wrote :

sorry for my poor english!

非常感谢!

Revision history for this message
Gerald Bachner (geri1403) wrote :

Hi,

tested patch + workaround from wangjun (added "static struct task_struct *thread_hid = NULL;") on Manjaro 5.9rc6:
Touchpad MSFT0001:00 04F3:3140 works perfect.

Thanks!

Revision history for this message
Paulinski (mail-izy) wrote :

Hey guys,
I also would like to apply this patch on my machine. Unfortunately I didn't understand where to add the extra line in the code an how to apply the patch...

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Coiby Xu (coiby)

You are the best !!!

First of all, thank you very much for the patch - it works perfectly.
All I had to do was add the fix from @wangjun (biggerchina).

Here is the link to the working patch:
https://gitlab.manjaro.org/packages/core/linux58/-/raw/master/0304-i2c-hid-core.patch?inline=false

The kernel 5.8.12-2 of Manjaro Linux 5.8.12-2 already contains it.
I will also include it in the 5.9-rc7.

Helmut (schinfo) - Manjaro Team

Changed in linux (Arch Linux):
status: Confirmed → Fix Committed
Revision history for this message
Demyan Yarmoshik (niquepolice) wrote :

Amazing news! Applied the patch to 5.6-rc6, works great. Thanks a lot, Coiby Xu!

Revision history for this message
alex (agolks) wrote :

have managed to compile the i2c_hid.ko module in ubuntu 20.04, too, works! thanks!

Revision history for this message
alex (agolks) wrote :

... but:
have to modprobe -r and modprobe i2c_hid again, to get the touchpad working.
any ideas?

Revision history for this message
Bulat (ilov3) wrote :

Hey guys! Very excited and waited so much to the moment when this bug will be fixed.
Any chances that the patch will be included into ubuntu mainline kernel build? (something go wrong when I attempting to boot from the patched kernel: in the very start says "Loading initial ramdisk" and hangs forever, tried to google the issue, but no luck at this moment, plz contact me if you know(or have ideas) the solution)
Thanks!

Revision history for this message
Stefano Galassi (iltoga) wrote :

@Coiby YOU ARE THE MAN!

works like a charm on kernel 5.8.12-AMD!
thank you so much for your efforts. you should get paid by Lenovo for this ;)

Revision history for this message
Dimitar Kotsev (dimitar-kotsev) wrote :

@Coiby Xu, @wangjun, Helmut (schinfo) thank you for saving the day.

I've `git cloned` 5.8.12-3 Manjaro kernel from GitLab and using this post I installed it on my system. -> https://forum.manjaro.org/t/how-to-compile-patch-kernel-with-custom-alsa-driver/20326/4

Everything works like a charm now.

Thank you all once again.

Revision history for this message
Azizkhan (injkgz) wrote :

Can anyone provide an instruction for newbees?
I made a clean install of Ubuntu 20.04 LTS, how to apply patch and make touchpad work?

Revision history for this message
Mike Boruta (maridius) wrote :

Wow, thanks a lot Coiby Xu! I applied the patch and the touchpad 04F3:3186 works as expected on the 5.7.19 ubuntu mainline kernel. Please let me know if you need help developing/testing the final fix to pinctrl_amd/amd_gpio.

@Azizkhan (injkgz), @Bulat (ilov3), @Paulinski (mail-izy): Please see the following guides on how to install patches and build kernel modules:

https://www.thegeekstuff.com/2014/12/patch-command-examples/
https://yoursunny.com/t/2018/one-kernel-module/
https://stackoverflow.com/a/44204152

Wish you luck!

Revision history for this message
Mike Boruta (maridius) wrote :
Revision history for this message
alex (agolks) wrote :

thanks @Mike Boruta (maridius)!
wondered why it worked after re-install of nvidia driver, so thats the explanation now ;)

what about any issues with the touchpad?
not sure if something else produces my issues, but during longer usage there random stutterings, the mouse is not moved for some seconds.

Revision history for this message
Mike Boruta (maridius) wrote :

I have not (yet) experienced the issue you are describing, or any issues for that matter. Maybe you can remove and re-insert i2c_hid when this happens? Hopefully a fix of the GPIO driver is not too far off and will resolve the stability issues you are experiencing.

Revision history for this message
Azizkhan (injkgz) wrote :

Kernel 5.8.13 doesn't build with this patch

Revision history for this message
PD (pd1986) wrote :

@Coiby Xu (coiby)

Great. Touchpad works. Thank you so much

Revision history for this message
PD (pd1986) wrote :
Revision history for this message
wangjun (biggerchina) wrote :

found a patch related to amd and gpio:

gpio: amd-fch: correct logic of GPIO_LINE_DIRECTION
The original commit appears to have the logic reversed in
amd_fch_gpio_get_direction. Also confirmed by observing the value of
"direction" in the sys tree.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d25e8fdebdad84219b498873300b7f11dd915b88

Revision history for this message
Coiby Xu (coiby) wrote :

Thank you for testing this patch! I'm glad it also works for both 04F3:3140 and 04F3:3186. I was completely new to things like I2C, HID before investigating this touchpad issue. So thank you for your patience with me.

Note this patch is meant to be a temporary specifically for this laptop. It will break other machines' touchpads if they have different interrupt configuration.

But I think it's worthwhile to add a polling mode to the drivers/hid/i2c-hid/i2c-hid-core.c as a fallback solution. I'll send some patches upstream next week and hopefully they will be accepted and reach different different distribution's kernel package soon.

Revision history for this message
Coiby Xu (coiby) wrote :

Today I find something interesting about the GPIO controller. I wonder if the same thing would happen to the ELAN touchpads.

For those who have the ELAN touchpad, could you show me the result of the following experiment with a kernel not having the polling_pin_state_touchpad.patch?

```bash
# install hid-tools
# If it's not provided by your distribution's package manager, you can install it by pip
# sudo pip install hid-tools

# run hid-recorder and choose the device having name "MSFT*"
$ sudo hid-recorder
Available devices:
/dev/hidraw0: MSFT0001:00 06CB:7F28

# now open another terminal window
# switch to root user
sudo su
# go to gpio's sysfs
cd /sys/class/gpio/
# export the pin used by the touchpad
echo 386 > export
# now you will see a folder named gpio396 created
# change the pin as an output
echo out > gpio396/direction
# write 1 to the pin
echo 1 > gpio386/value

```

Now move your finger on the touchpad. See if your cursor moves now and if there is any output from hid-recorder.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Forget everything up to now - it is a kernel bug that has been known since January of this year and for which there has been a fix since then.
I can't say why it hasn't been included in the kernel so far.

Here is the patch:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d25e8fdebdad84219b498873300b7f11dd915b88

It's been included in Manjaro Linux kernel >= 5.8.13-4 (5.9 with the next update)

https://gitlab.manjaro.org/packages/core/linux58/-/blob/master/0305-gpio-amd-fch.patch

The bug was, that at /drivers/gpio/gpio-amd-fch.c the line "return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;" was wrong.

It must be correct "return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;"

A small swap that unfortunately has a big impact on the owners of a Lenovo Legion.

Revision history for this message
Coiby Xu (coiby) wrote :

For Legion-5 15ARH05, the GPIO chip is managed by drivers/pinctrl/pinctrl-amd.c. So the fix for drivers/gpio/gpio-amd-fch.c is irrelevant to this issue.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Right - unfortunately that was a mistake on my part - please ignore # 133

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (17.1 KiB)

@coiby xu,

with my elan touchpad ,

[ra@localhost ~]$ sudo pip install hid-tools
[sudo] password for ra:
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
Collecting hid-tools
  Using cached hid-tools-0.2.tar.gz (51 kB)
Collecting parse
  Downloading parse-1.18.0.tar.gz (30 kB)
Collecting pyudev
  Using cached pyudev-0.22.0.tar.gz (85 kB)
Requirement already satisfied: six in /usr/lib/python3.9/site-packages (from pyudev->hid-tools) (1.15.0)
Using legacy 'setup.py install' for hid-tools, since package 'wheel' is not installed.
Using legacy 'setup.py install' for parse, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyudev, since package 'wheel' is not installed.
Installing collected packages: parse, pyudev, hid-tools
    Running setup.py install for parse ... done
    Running setup.py install for pyudev ... done
    Running setup.py install for hid-tools ... done
Successfully installed hid-tools-0.2 parse-1.18.0 pyudev-0.22.0
[ra@localhost ~]$ sudo hid-recorder
Available devices:
/dev/hidraw0: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw1: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw2: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw3: MSFT0001:00 04F3:3140
/dev/hidraw4: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-4]: 3
# MSFT0001:00 04F3:3140
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x01, // Report ID (1) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x03, // Input (Cnst,Var,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x09, 0x38, // Usage (Wheel) 38
# 0x15, 0x81, // Logical Minimum (-127) 40
# 0x25, 0x7f, // Logical Maximum (127) 42
# 0x75, 0x08, // Report Size (8) 44
# 0x95, 0x03, // Report Count (3) 4...

Revision history for this message
wangjun (biggerchina) wrote :

sorry, default fedora kernel with the option CONFIG_GPIO_SYSFS is not set.

i will set it and build new kernel to test the above script.

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (15.3 KiB)

@coiby xu,

terminal window 1:
-----------------
[ra@localhost ~]$ uname -r
5.8.13-301.fc33.x86_64
[ra@localhost ~]$ sudo hid-recorder
[sudo] password for ra:
Available devices:
/dev/hidraw0: MSFT0001:00 04F3:3140
/dev/hidraw1: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw2: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw3: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw4: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-4]: 0
# MSFT0001:00 04F3:3140
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x01, // Report ID (1) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x03, // Input (Cnst,Var,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x09, 0x38, // Usage (Wheel) 38
# 0x15, 0x81, // Logical Minimum (-127) 40
# 0x25, 0x7f, // Logical Maximum (127) 42
# 0x75, 0x08, // Report Size (8) 44
# 0x95, 0x03, // Report Count (3) 46
# 0x81, 0x06, // Input (Data,Var,Rel) 48
# 0x05, 0x0c, // Usage Page (Consumer Devices) 50
# 0x0a, 0x38, 0x02, // Usage (AC Pan) 52
# 0x95, 0x01, // Report Count (1) 55
# 0x81, 0x06, // Input (Data,Var,Rel) 57
# 0x75, 0x08, // Report Size (8) 59
# 0x95, 0x03, // Report Count (3) 61
# 0x81, 0x03, // Input (Cnst,Var,Abs) 63
# 0xc0, // End Collection 65
# 0x06, 0x00, 0xff, // Usage Page (Vendor Defined Page 1) 66
# 0x85, 0x0d, // Report ID (13) 69
# 0x09, 0xc5, // Usage (Vendor Usage 0xc5) 71
# 0x15, 0...

Revision history for this message
Coiby Xu (coiby) wrote :

Hi wangjun,

Thank you for testing the script. Sorry I notice there's some problems with the instructions in # 132. And those instructions can't be executed as a single shell script.

If you go to /sys/class/gpio, do you see a folder named gpio386?
- If yes, cd to gpio386. "echo out > direction". Then "echo 0 > value". Then you check the output from hid-recorder.

- If no, please checck another re-written version of # 132 as follows.

Revision history for this message
Coiby Xu (coiby) wrote :

(For those who read # 132, please ignore it and this is re-written version.)

For the Synaptics touchpad, the following experiment would make the touchpad work. Could you share the result with the ELAN touchpad?

1. Install hid-tools and start hid-recorder as the root user

```bash
# install hid-tools
# If it's not provided by your distribution's package manager, you can install it by pip
# sudo pip install hid-tools

# run hid-recorder and choose the device having name "MSFT*"
$ sudo hid-recorder
Available devices:
/dev/hidraw0: MSFT0001:00 06CB:7F28
```

2. Run the following sh script as a root

```bash
# now open another terminal window

# go to gpio's sysfs
cd /sys/class/gpio/
# export the pin used by the touchpad
echo 386 > export
# now you will see a folder named gpio386 created
cd gpio386
# change the pin as an output
echo out > direction
# write 0 to the pin
echo 0 > value
```

Now move your finger on the touchpad. See if your cursor moves now and if there is any output from hid-recorder.

And then don't touch the touchpad. See if there is any output from hid-recorder.

Revision history for this message
wangjun (biggerchina) wrote :

after i run the line in the terminal windows 2:
echo out > direction

terminal window 1 has output

and the cursor start move.

no need to run the line
echo 0 > value

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (362.3 KiB)

and the full terminal window 1 output :

[ra@localhost ~]$ sudo hid-recorder
[sudo] password for ra:
Available devices:
/dev/hidraw0: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw1: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw2: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw3: MSFT0001:00 04F3:3140
/dev/hidraw4: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-4]: 3
# MSFT0001:00 04F3:3140
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x01, // Report ID (1) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x03, // Input (Cnst,Var,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x09, 0x38, // Usage (Wheel) 38
# 0x15, 0x81, // Logical Minimum (-127) 40
# 0x25, 0x7f, // Logical Maximum (127) 42
# 0x75, 0x08, // Report Size (8) 44
# 0x95, 0x03, // Report Count (3) 46
# 0x81, 0x06, // Input (Data,Var,Rel) 48
# 0x05, 0x0c, // Usage Page (Consumer Devices) 50
# 0x0a, 0x38, 0x02, // Usage (AC Pan) 52
# 0x95, 0x01, // Report Count (1) 55
# 0x81, 0x06, // Input (Data,Var,Rel) 57
# 0x75, 0x08, // Report Size (8) 59
# 0x95, 0x03, // Report Count (3) 61
# 0x81, 0x03, // Input (Cnst,Var,Abs) 63
# 0xc0, // End Collection 65
# 0x06, 0x00, 0xff, // Usage Page (Vendor Defined Page 1) 66
# 0x85, 0x0d, // Report ID (13) 69
# 0x09, 0xc5, // Usage (Vendor Usage 0xc5) 71
# 0x15, 0x00, // Logical Minimum (0) ...

Revision history for this message
wangjun (biggerchina) wrote :

i reboot ,and test it again.

only run this script:

```
[ra@localhost ~]$ su
Password:
[root@localhost ra]# cd /sys/class/gpio/
[root@localhost gpio]# echo 386 > export
[root@localhost gpio]# cd gpio386
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]#
```

then cursor start move ,and two figure scroll is ok too.

Revision history for this message
Coiby Xu (coiby) wrote :

@@wangjun Good to know that! What's the result of "echo value"? And what's the output of hdi-recorder with and without fingers on the touchpad?

Revision history for this message
wangjun (biggerchina) wrote :

@coiby xu ,many thanks to you

you find another way to solve the problem.

Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby)

#144

i now test it.

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (15.0 KiB)

no touch test:

i run :sudo hid-recorder

```
[ra@localhost ~]$ sudo hid-recorder
[sudo] password for ra:
Available devices:
/dev/hidraw0: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw1: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw2: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw3: MSFT0001:00 04F3:3140
/dev/hidraw4: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-4]: 3
# MSFT0001:00 04F3:3140
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x01, // Report ID (1) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x03, // Input (Cnst,Var,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x09, 0x38, // Usage (Wheel) 38
# 0x15, 0x81, // Logical Minimum (-127) 40
# 0x25, 0x7f, // Logical Maximum (127) 42
# 0x75, 0x08, // Report Size (8) 44
# 0x95, 0x03, // Report Count (3) 46
# 0x81, 0x06, // Input (Data,Var,Rel) 48
# 0x05, 0x0c, // Usage Page (Consumer Devices) 50
# 0x0a, 0x38, 0x02, // Usage (AC Pan) 52
# 0x95, 0x01, // Report Count (1) 55
# 0x81, 0x06, // Input (Data,Var,Rel) 57
# 0x75, 0x08, // Report Size (8) 59
# 0x95, 0x03, // Report Count (3) 61
# 0x81, 0x03, // Input (Cnst,Var,Abs) 63
# 0xc0, // End Collection 65
# 0x06, 0x00, 0xff, // Usage Page (Vendor Defined Page 1) 66
# 0x85, 0x0d, // Report ID (13) 69
# 0x09, 0xc5, // Usage (Vendor Usage 0xc5) 71
# 0x15, 0x00, // Logical Minimum (0) ...

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (14.3 KiB)

touch test:

follow the no touch test,

i touch the touchpad:

then the output are:
```
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2249 | Y: 1233 | Scan Time: 59692 | Contact Count: 1 | Button: 0 | # | #
E: 000215.550028 12 04 03 c9 08 d1 04 2c e9 01 80 19 43
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2249 | Y: 1233 | Scan Time: 59782 | Contact Count: 1 | Button: 0 | # | #
E: 000215.558929 12 04 03 c9 08 d1 04 86 e9 01 80 19 43
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2249 | Y: 1233 | Scan Time: 59872 | Contact Count: 1 | Button: 0 | # | #
E: 000215.567472 12 04 03 c9 08 d1 04 e0 e9 01 80 19 43
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2249 | Y: 1232 | Scan Time: 59992 | Contact Count: 1 | Button: 0 | # | #
E: 000215.578906 12 04 03 c9 08 d0 04 58 ea 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2246 | Y: 1226 | Scan Time: 60112 | Contact Count: 1 | Button: 0 | # | #
E: 000215.590708 12 04 03 c6 08 ca 04 d0 ea 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2243 | Y: 1219 | Scan Time: 60222 | Contact Count: 1 | Button: 0 | # | #
E: 000215.601795 12 04 03 c3 08 c3 04 3e eb 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2243 | Y: 1219 | Scan Time: 60332 | Contact Count: 1 | Button: 0 | # | #
E: 000215.611951 12 04 03 c3 08 c3 04 ac eb 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2243 | Y: 1219 | Scan Time: 60442 | Contact Count: 1 | Button: 0 | # | #
E: 000215.622699 12 04 03 c3 08 c3 04 1a ec 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2243 | Y: 1219 | Scan Time: 60512 | Contact Count: 1 | Button: 0 | # | #
E: 000215.629600 12 04 03 c3 08 c3 04 60 ec 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2243 | Y: 1219 | Scan Time: 60582 | Contact Count: 1 | Button: 0 | # | #
E: 000215.636408 12 04 03 c3 08 c3 04 a6 ec 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2243 | Y: 1219 | Scan Time: 60672 | Contact Count: 1 | Button: 0 | # | #
E: 000215.646507 12 04 03 c3 08 c3 04 00 ed 01 80 19 34
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2228 | Y: 1171 | Scan Time: 60752 | Contact Count: 1 | Button: 0 | # | #
E: 000215.653875 12 04 03 b4 08 93 04 50 ed 01 80 1c 44
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2227 | Y: 1165 | Scan Time: 60832 | Contact Count: 1 | Button: 0 | # | #
E: 000215.661588 12 04 03 b3 08 8d 04 a0 ed 01 80 1c 44
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2227 | Y: 1165 | Scan Time: 60922 | Contact Count: 1 | Button: 0 | # | #
E: 000215.669600 12 04 03 b3 08 8d 04 fa ed 01 80 1c 44
# ReportID: 4 / Confidence: 1 | Tip Switch: 1 | # | Contact Id: 0 | X: 2224 | Y: 1152 | Scan Time: 61002 | Contact Count: 1 | Button: 0 | # | #
E: ...

Revision history for this message
wangjun (biggerchina) wrote :

and the dmesg has some output related:

```
[ 138.233653] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data

```

Revision history for this message
wangjun (biggerchina) wrote :

so may be there is some bug with the :direction,

because ,i run echo out > direction,then it start to work.

and may be just like #130 or #133 ,but in drivers related to this touchpad .

Revision history for this message
wangjun (biggerchina) wrote :

i have already added some pr_err to the kernel source ,
then the dmesg say : the touchpad work 1 time,during the system boot.

the dmesg output like :
```
[ 1.766437] in handle_fasteoi_irq for irq:7,starting...
[ 1.766440] in handle_irq_event start for :7
[ 1.766440] in __handle_irq_event_percpu :7 starting...
[ 1.766441] in __handle_irq_event_percpu :7,in for_each_action_of_desc
[ 1.766442] in amd_gpio_irq_handler,irq:7 start...
[ 1.766500] in amd_gpio_irq_handler,(!(regval & PIN_IRQ_PENDING) ||!(regval & BIT(INTERRUPT_MASK_OFF))) continue: 0
[ 1.766502] in amd_gpio_irq_handler,(!(regval & PIN_IRQ_PENDING) ||!(regval & BIT(INTERRUPT_MASK_OFF))) continue: 0
[ 1.766504] in amd_gpio_irq_handler, generic_handle_irq :55,start...
[ 1.766510] in amd_gpio_irq_handler, generic_handle_irq :55,end
[ 1.766512] in amd_gpio_irq_handler,(!(regval & PIN_IRQ_PENDING) ||!(regval & BIT(INTERRUPT_MASK_OFF))) continue: 0
[ 1.766514] in amd_gpio_irq_handler,irq:55 end
[ 1.766515] in __handle_irq_event_percpu :7,in switch IRQ_HANDLED break
[ 1.766516] in __handle_irq_event_percpu :7 ending...
[ 1.766516] in handle_irq_event end for :7
[ 1.766517] cond_unmask_eoi_irq irq:7
[ 1.766519] in handle_fasteoi_irq for irq:7, end
[ 1.841153] input: MSFT0001:00 04F3:3140 Mouse as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input6
[ 1.841250] input: MSFT0001:00 04F3:3140 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3140.0001/input/input7
[ 1.841312] hid-generic 0018:04F3:3140.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:00 04F3:3140] on i2c-MSFT0001:00
```

and

today ,i run the script:
```
[root@localhost ra]# cd /sys/class/gpio/
[root@localhost gpio]# echo 386 > export
[root@localhost gpio]# cd gpio386
```
then
```
[root@localhost gpio386]# cat direction
in
```

so, there is some bug code set the direction to in ,or missing code to set the direction to out ?

Revision history for this message
wangjun (biggerchina) wrote :

according to the above analysis, error is happen with the direction is : in

i found the function to set the direction of gpio pin to in: amd_gpio_direction_input,

and add some pr_err and dump_stack() to the function ,

then dmesg out put like :

[ 1.545190] amd_gpio_set_config gpio_chip->label:AMDI0030:00,offset:130,config:278
[ 1.545191] amd_gpio_direction_input gpio_chip->label:AMDI0030:00,offset:130

=============================amd_gpio_direction_input dump_stack()=====
[ 1.545194] CPU: 12 PID: 264 Comm: kworker/12:4 Not tainted 5.8.13-303.fc33.x86_64 #1
[ 1.545194] Hardware name: LENOVO 82B6/LNVNB161216, BIOS EUCN26WW 08/19/2020
[ 1.545197] Workqueue: events deferred_probe_work_func
[ 1.545198] Call Trace:
[ 1.545203] dump_stack+0x6b/0x88
[ 1.545205] amd_gpio_direction_input+0x57/0x60 [pinctrl_amd]
[ 1.545206] gpiod_direction_input+0x5b/0x170
[ 1.545208] acpi_dev_gpio_irq_get+0x111/0x1b6
[ 1.545209] ? i2c_acpi_find_adapter_by_handle+0x30/0x30
[ 1.545210] i2c_acpi_get_irq+0x81/0x90
[ 1.545212] i2c_device_probe+0x24a/0x280
[ 1.545213] really_probe+0x160/0x400
[ 1.545214] driver_probe_device+0xe1/0x150
[ 1.545215] ? driver_allows_async_probing+0x50/0x50
[ 1.545216] bus_for_each_drv+0x6a/0xa0
[ 1.545217] __device_attach+0xb4/0x1b0
[ 1.545218] bus_probe_device+0x8e/0xa0
[ 1.545219] deferred_probe_work_func+0x77/0xc0
[ 1.545220] process_one_work+0x1b4/0x370
[ 1.545221] worker_thread+0x53/0x3e0
[ 1.545222] ? process_one_work+0x370/0x370
[ 1.545223] kthread+0x11b/0x140
[ 1.545224] ? __kthread_bind_mask+0x60/0x60
[ 1.545226] ret_from_fork+0x22/0x30
============================================================================

then i found the functions

acpi_dev_gpio_irq_get

in in file : drivers/gpio/gpiolib-acpi.c, line 927 (as a function)

and it's comment say:
```
/**
 * acpi_dev_gpio_irq_get() - Find GpioInt and translate it to Linux IRQ number
 * @adev: pointer to a ACPI device to get IRQ from
 * @index: index of GpioInt resource (starting from %0)
 *
 * If the device has one or more GpioInt resources, this function can be
 * used to translate from the GPIO offset in the resource to the Linux IRQ
 * number.
 *
 * The function is idempotent, though each time it runs it will configure GPIO
 * pin direction according to the flags in GpioInt resource.
 *
 * Return: Linux IRQ number (> %0) on success, negative errno on failure.
 */
int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
{
```

each time it runs it will configure GPIO pin direction according to the flags in GpioInt resource.

in it's body ,by call function gpiod_configure_flags (in /drivers/gpio/gpiolib.c)
it call the function gpiod_direction_input.
so the direction become to :input or in

the problem may be in two places:
1. lenovo 's default value in bios or dsdt is : input or in,or missing . but on windows ,it's ok,so ,may be not here.
2. in linux kernel,the default value of the type for gpio pin 's direction ,is :input or in

Revision history for this message
wangjun (biggerchina) wrote :

struct acpi_gpio_info {
 struct acpi_device *adev;
 enum gpiod_flags flags;
 bool gpioint;
 int pin_config;
 int polarity;
 int triggering;
 unsigned int quirks;
};

enum gpiod_flags {
 GPIOD_ASIS = 0,
 GPIOD_IN = GPIOD_FLAGS_BIT_DIR_SET,
 GPIOD_OUT_LOW = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT,
 GPIOD_OUT_HIGH = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT |
     GPIOD_FLAGS_BIT_DIR_VAL,
 GPIOD_OUT_LOW_OPEN_DRAIN = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_OPEN_DRAIN,
 GPIOD_OUT_HIGH_OPEN_DRAIN = GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_OPEN_DRAIN,
};

#define GPIOD_FLAGS_BIT_DIR_SET BIT(0)
#define GPIOD_FLAGS_BIT_DIR_OUT BIT(1)
#define GPIOD_FLAGS_BIT_DIR_VAL BIT(2)
#define GPIOD_FLAGS_BIT_OPEN_DRAIN BIT(3)
#define GPIOD_FLAGS_BIT_NONEXCLUSIVE BIT(4)

at end of the body of function gpiod_configure_flags:

 /* Process flags */
 if (dflags & GPIOD_FLAGS_BIT_DIR_OUT)
  ret = gpiod_direction_output(desc,
    !!(dflags & GPIOD_FLAGS_BIT_DIR_VAL));
 else
  ret = gpiod_direction_input(desc);

 return ret;
}

if miss config,
the default value is 0, it will be GPIOD_ASIS,
then in gpiod_configure_flags ,
it will call gpiod_direction_input .

are all the above right ?

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (4.7 KiB)

@wangjun

Thank you for sharing the results and investigating this touchpad issue!

One thing confuses me is for the ELAN touchpad, no single interrupt fires when you put finger on the touchpad while for the Synaptics touchpad, you still see interrupts firing but with a very rate of ~7Hz. Judging from the ACPI DSDT tables, different variants of this laptop model share the same GPIO chip. So this difference is unexpected. Understanding the difference may help us why the GPIO interrupt controller is malfunctioning.

Based on your results, I guess the ELAN touchpad somehow de-asserts its interrupt line connected to the GPIO pin. Could you further do the following experiment?

The following C program is to let GPIO controller quickly generate some interrupts then disable the firing of interrupts by toggling pin#130's direction with an time interval (ms). For the Synaptics touchpad, There is no interrupt firing unless internal > 120ms. So somehow the GPIO controller can only generate interrupt when its pin holding the signal for enough time. My hypothesis is the GPIO is not setup properly so it stays in a idle state or it's clock frequency is too small (so I don't think the touchpad issue is caused by mis-configuration of the direction of the pin). I want to see if the result from the ELAN touchpad would also support this hypothesis.

1. Find out the reliable way to trigger an interrupt which is crucial for this experiment.

   You told me there will be interrupt firing by simply setting the pin's direction to "out". You can check it's reliable by following the steps

    a. Don't put your finger on the touchpad
    b. Open a terminal window and run `sudo dmesg -W`
    c. In another terminal, "cd /sys/class/gpio/gpio386"
    e. "echo out > direction" and see if the following dmesg output will keeping popping out in the previous terminal window

        ```
        [ 138.233653] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
        ```
    d. Then "echo in > direction", now the dmesg output in step 3 should stop popping out.
    f. Repeat step e-d for around 5 times

If you are certain now, use the following C Program,
```c
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <fcntl.h>

#include <errno.h>
void write_to_pin130(char *d, size_t size)
{
 int fd;
 fd = open("/sys/class/gpio/gpio386/direction", O_WRONLY);
 write(fd, d, size);
        perror("Status:");
 close(fd);
}
void toggle_pin130(int interval_ms)
{
 struct timespec ts, ts1;

 write_to_pin130("out", 3);

 clock_gettime(CLOCK_MONOTONIC, &ts);

 usleep(interval_ms*1000);

 write_to_pin130("in", 2);
 clock_gettime(CLOCK_MONOTONIC, &ts1);
 printf("Interval: %.1f (real), %d (set)\n", (ts1.tv_sec-ts.tv_sec)*1000.0+(ts1.tv_nsec-ts.tv_nsec)/1000.0, interval_ms);

}
int main(int argc, char **argv)
{
 struct timespec ts;
 int interval_ms = atoi(argv[1]);
 toggle_pin130(interval_ms);

}
```

For me, it seems it's reliable to toggle the value to trigger a interrupt. You can follow similar steps to test it,

    a. Don't put your finger on the touchpad
    b. Open a terminal window and run `sudo dmesg -W`
    c. In another terminal, "cd /sys/class/gp...

Read more...

Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby)
wait a moment ,i rebuild a clean kernel ,then i test it .

Revision history for this message
wangjun (biggerchina) wrote :

test the script:
```
    a. Don't put your finger on the touchpad
    b. Open a terminal window and run `sudo dmesg -W`
    c. In another terminal, "cd /sys/class/gpio/gpio386"
    e. "echo out > direction" and see if the following dmesg output will keeping popping out in the previous terminal window

        ```
        [ 138.233653] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
        ```
    d. Then "echo in > direction", now the dmesg output in step 3 should stop popping out.
    f. Repeat step e-d for around 5 times
```

window 1:
```
[ra@localhost ~]$ su
Password:
[root@localhost ra]# cd /sys/class/gpio/
[root@localhost gpio]# echo 386 > export
[root@localhost gpio]# ls
export gpio386 gpiochip256 unexport
[root@localhost gpio]# cd /sys/class/gpio/gpio386
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# echo in > direction
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# echo in > direction
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# echo in > direction
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# echo in > direction
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# echo in > direction
[root@localhost gpio386]#

```

window 2:
```
[ra@localhost ~]$ sudo dmesg -W
[ 191.989163] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data

```

it's only out one line on first it run echo out > direction.

during test ,no figure touch the touchpad.

Revision history for this message
wangjun (biggerchina) wrote :

and after the test,i rerun : echo in > direction

my touchpad can work.

Revision history for this message
wangjun (biggerchina) wrote :

sorry for #157, `in` should be `out`

and after the test,i rerun : echo out > direction

my touchpad can work.

Revision history for this message
wangjun (biggerchina) wrote :

first c program, has error,
window 1
```
[ra@localhost 1]$ sudo ./test
[sudo] password for ra:
Segmentation fault
[ra@localhost 1]$
```

windows 2
```
[ra@localhost ~]$ sudo dmesg -W
[sudo] password for ra:
[ 545.297119] test[3424]: segfault at 0 ip 00007f679289151c sp 00007ffc4ea14900 error 4 in libc-2.32.so[7f6792875000+14f000]
[ 545.297127] Code: 41 54 45 31 e4 55 53 48 83 ec 28 48 89 74 24 08 85 c9 0f 85 ce 02 00 00 83 ff 01 0f 84 8d 01 00 00 83 ff 24 0f 87 84 01 00 00 <49> 0f be 55 00 49 8b 48 68 4c 89 eb 48 89 d0 f6 44 51 01 20 74 19

```

Revision history for this message
wangjun (biggerchina) wrote :

test for script 2:

```
    a. Don't put your finger on the touchpad
    b. Open a terminal window and run `sudo dmesg -W`
    c. In another terminal, "cd /sys/class/gpio/gpio386"
    e. "echo 1 > value" and see if the following dmesg output will keeping popping up in the previous terminal window

        ```
        [ 138.233653] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
        ```
    d. Then "echo 0 > value", now the dmesg output in step 3 should stop popping up
    f. Repeat step e-d for around 5 times
```

test env is :

the direction is default : in,
not changed
and then run the script.

windows 1:
```
[ra@localhost ~]$ su
Password:
[root@localhost ra]# cd /sys/class/gpio/gpio386
[root@localhost gpio386]# echo 1 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 0 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 1 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 0 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 1 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 0 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 1 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 0 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 1 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]# echo 0 > value
bash: echo: write error: Operation not permitted
[root@localhost gpio386]#

```

windows 2:
```
[ra@localhost ~]$ sudo dmesg -W
[sudo] password for ra:

```
windows 2 has no output.

Revision history for this message
wangjun (biggerchina) wrote :

test for script 2 ,with changed direction to out before test:

```
    a. Don't put your finger on the touchpad
    b. Open a terminal window and run `sudo dmesg -W`
    c. In another terminal, "cd /sys/class/gpio/gpio386"
    e. "echo 1 > value" and see if the following dmesg output will keeping popping up in the previous terminal window

        ```
        [ 138.233653] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
        ```
    d. Then "echo 0 > value", now the dmesg output in step 3 should stop popping up
    f. Repeat step e-d for around 5 times
```

test env is :

the direction change to :out

and then run the script.

windows 1:
```
[ra@localhost ~]$ su
Password:
[root@localhost ra]# cd /sys/class/gpio
[root@localhost gpio]# echo 386 >export
[root@localhost gpio]# cd gpio386/
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# echo 1 > value
[root@localhost gpio386]# echo 0 > value
[root@localhost gpio386]# echo 1 > value
[root@localhost gpio386]# echo 0 > value
[root@localhost gpio386]# echo 1 > value
[root@localhost gpio386]# echo 0 > value
[root@localhost gpio386]# echo 1 > value
[root@localhost gpio386]# echo 0 > value
[root@localhost gpio386]# echo 1 > value
[root@localhost gpio386]# echo 0 > value
[root@localhost gpio386]#

```

windows 2:
```
[ra@localhost ~]$ sudo dmesg -W
[sudo] password for ra:
[ 144.238931] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data

```
the output :i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
is out after i run echo out > direction.

Revision history for this message
wangjun (biggerchina) wrote :

test the second c program:
i reboot,

it's means the derection is :in

windows 1:

```
[ra@localhost 2]$ su
Password:
[root@localhost 2]# ls
fire_touchpad_pin_irq fire_touchpad_pin_irq.c
[root@localhost 2]# ./fire_touchpad_pin_irq 100
Status:: Operation not permitted
Status:: Operation not permitted
Interval: 100514.3 (real), 100 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 200
Status:: Operation not permitted
Status:: Operation not permitted
Interval: 200497.8 (real), 200 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 300
Status:: Operation not permitted
Status:: Operation not permitted
Interval: 300504.7 (real), 300 (set)
[root@localhost 2]#

```
and window 1:

```
[ra@localhost ~]$ sudo dmesg -W
[sudo] password for ra:

```
window 1 no output.

Revision history for this message
wangjun (biggerchina) wrote :

sorry , two mistakes in # 162

and window 1: ==> and window 2:

window 1 no output. ==> window 2 no output.

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (3.4 KiB)

test the second c program with derection changed to :out

window 1:
```
[ra@localhost ~]$ su
Password:
[root@localhost ra]# cd /sys/class/gpio/
[root@localhost gpio]# ls
export gpiochip256 unexport
[root@localhost gpio]# echo 386 > export
[root@localhost gpio]# ls
export gpio386 gpiochip256 unexport
[root@localhost gpio]# cd gpio386/
[root@localhost gpio386]# ls
active_low device direction edge power subsystem uevent value
[root@localhost gpio386]# echo out > direction
[root@localhost gpio386]# cd /src
[root@localhost src]# cd 2
[root@localhost 2]# ls
fire_touchpad_pin_irq fire_touchpad_pin_irq.c
[root@localhost 2]# ./fire_touchpad_pin_irq 100
Status:: Success
Status:: Success
Interval: -898783.6 (real), 100 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 200
Status:: Success
Status:: Success
Interval: 200220.4 (real), 200 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 300
Status:: Success
Status:: Success
Interval: -698794.8 (real), 300 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 400
Status:: Success
Status:: Success
Interval: 400186.2 (real), 400 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 500
Status:: Success
Status:: Success
Interval: 500237.5 (real), 500 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 600
Status:: Success
Status:: Success
Interval: 600167.4 (real), 600 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 700
Status:: Success
Status:: Success
Interval: -298777.3 (real), 700 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 800
Status:: Success
Status:: Success
Interval: -198787.9 (real), 800 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 900
Status:: Success
Status:: Success
Interval: -98820.3 (real), 900 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1000
Status:: Success
Status:: Success
Interval: 1178.9 (real), 1000 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1100
Status:: Success
Status:: Success
Interval: -897780.3 (real), 1100 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1200
Status:: Success
Status:: Success
Interval: 201147.0 (real), 1200 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1300
Status:: Success
Status:: Success
Interval: -697760.0 (real), 1300 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1400
Status:: Success
Status:: Success
Interval: 401213.1 (real), 1400 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1500
Status:: Success
Status:: Success
Interval: 501211.2 (real), 1500 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1600
Status:: Success
Status:: Success
Interval: -397783.9 (real), 1600 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1700
Status:: Success
Status:: Success
Interval: -297852.3 (real), 1700 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 1200
Status:: Success
Status:: Success
Interval: -797757.7 (real), 1200 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 2000
Status:: Success
Status:: Success
Interval: 2219.5 (real), 2000 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 3000
Status:: Success
Status:: Success
Interval: 3149.3 (real), 3000 (set)
[root@localhost 2]# ./fire_touchpad_pin_irq 5000
Status:: Success
Status:: Success
Interval: 5186.0 (real), 5000 (set)
[root@localhost 2]#

```

window 2:

```
[ra@localhost...

Read more...

Revision history for this message
wangjun (biggerchina) wrote :

sorry for #159,

the first c program ,i missed the parameter when i run it.

now test it again.

reboot

then

```
 [ra@localhost ~]$ su
Password:
[root@localhost ra]# cd /sys/class/gpio
[root@localhost gpio]# ls
export gpiochip256 unexport
[root@localhost gpio]# echo 386 > export
[root@localhost gpio]# ls
export gpio386 gpiochip256 unexport
[root@localhost gpio]# cd gpio386/
[root@localhost gpio386]# ls
active_low device direction edge power subsystem uevent value
[root@localhost gpio386]#

```
the window 1:

```
[root@localhost gpio386]# cd /src
[root@localhost src]# cd 1
[root@localhost 1]# ls
main.c test
[root@localhost 1]# ./test 100
Status:: Success
Status:: Success
Interval: 100507.7 (real), 100 (set)
[root@localhost 1]# ./test 200
Status:: Success
Status:: Success
Interval: -798786.2 (real), 200 (set)
[root@localhost 1]# ./test 300
Status:: Success
Status:: Success
Interval: -698798.6 (real), 300 (set)
[root@localhost 1]# ./test 400
Status:: Success
Status:: Success
Interval: -598783.9 (real), 400 (set)
[root@localhost 1]# ./test 500
Status:: Success
Status:: Success
Interval: -498759.5 (real), 500 (set)
[root@localhost 1]# ./test 600
Status:: Success
Status:: Success
Interval: 600225.3 (real), 600 (set)
[root@localhost 1]# ./test 700
Status:: Success
Status:: Success
Interval: 700192.4 (real), 700 (set)
[root@localhost 1]# ./test 800
Status:: Success
Status:: Success
Interval: -198836.5 (real), 800 (set)
[root@localhost 1]# ./test 900
Status:: Success
Status:: Success
Interval: -98799.5 (real), 900 (set)
[root@localhost 1]# ./test 1000
Status:: Success
Status:: Success
Interval: 1167.8 (real), 1000 (set)
[root@localhost 1]# ./test 1100
Status:: Success
Status:: Success
Interval: 101167.2 (real), 1100 (set)
[root@localhost 1]# ./test 1200
Status:: Success
Status:: Success
Interval: -797821.1 (real), 1200 (set)
[root@localhost 1]# ./test 1300
Status:: Success
Status:: Success
Interval: 301202.4 (real), 1300 (set)
[root@localhost 1]# ./test 1400
Status:: Success
Status:: Success
Interval: 401208.4 (real), 1400 (set)
[root@localhost 1]# ./test 1500
Status:: Success
Status:: Success
Interval: -497844.3 (real), 1500 (set)
[root@localhost 1]# ./test 1600
Status:: Success
Status:: Success
Interval: -397751.6 (real), 1600 (set)
[root@localhost 1]# ./test 1700
Status:: Success
Status:: Success
Interval: 701201.9 (real), 1700 (set)
[root@localhost 1]# ./test 1800
Status:: Success
Status:: Success
Interval: -197768.8 (real), 1800 (set)
[root@localhost 1]# ./test 1900
Status:: Success
Status:: Success
Interval: -97834.9 (real), 1900 (set)
[root@localhost 1]#

```

window 2:
```
[ra@localhost ~]$ sudo dmesg -W
[sudo] password for ra:
[ 416.150765] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data

```

the output only once.

that 's all.

Revision history for this message
wangjun (biggerchina) wrote :

one mistake in #165,

```but there's no data``` is some copy/past err.

it's not the output.

Revision history for this message
Coiby Xu (coiby) wrote :

@wangjun Thank you for doing this experiment!

1. When the touchpad works by setting pin's direction=out, you could see lots of "no data" message ("IRQ triggered but there's no data") keeping popping up after moving your finger away from the touchpad, am I correct?

2. When pin's direction=out, does only one new "no data" message or multiple ones appear on the screen when you toggle the pin value?

Revision history for this message
wangjun (biggerchina) wrote :

Coiby Xu (coiby)
>1. When the touchpad works by setting pin's direction=out, you could see lots of "no data" message ("IRQ triggered but there's no data") keeping popping up after moving your finger away from the touchpad, am I correct?

no, wrong. when run : echo out > direction,
dmesg say :
[ 133.854926] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
only one time,
then my touchpad can work.
no keeping popping up after moving your finger away from the touchpad.

it's only one line .

>2. When pin's direction=out, does only one new "no data" message or multiple ones appear on the screen when you toggle the pin value?

when run : echo out > direction,
dmesg show one time no data msg.no more,
then change pin value,to 0 or to 1,
no msg output.

but ,when value = 1, touchpad not work,
when value =0,touchpad can work.

Revision history for this message
Coiby Xu (coiby) wrote :

>>1. When the touchpad works by setting pin's direction=out, you could see lots of "no data" message ("IRQ triggered but there's no data") keeping popping up after moving your finger away from the touchpad, am I correct?

> no, wrong. when run : echo out > direction,
> dmesg say :
> [ 133.854926] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data
> only one time,
> then my touchpad can work.
> no keeping popping up after moving your finger away from the touchpad.

This is something quite unexpected. When the finger is away from the toucpad, is there any output from `sudo hid-recorder`? For my laptop, the same HId report will be repeatedly received by hid-recorder because amd_gpio_irq_handler is called repeatedly. If amd_gpio_irq_handler is not called when you don't use the touchpad, then "echo out > direction" is really a solution and your guess that amd-pinctrl has incorrect configuration the direction is absolutely right.

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (27.4 KiB)

window 1 run :

```
[ra@localhost ~]$ sudo hid-recorder
[sudo] password for ra:
Available devices:
/dev/hidraw0: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw1: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw2: Microsoft Microsoft® Nano Transceiver v1.0
/dev/hidraw3: MSFT0001:00 04F3:3140
/dev/hidraw4: ITE Tech. Inc. ITE Device(8910)
Select the device event number [0-4]: 3
# MSFT0001:00 04F3:3140
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x85, 0x01, // Report ID (1) 6
# 0x09, 0x01, // Usage (Pointer) 8
# 0xa1, 0x00, // Collection (Physical) 10
# 0x05, 0x09, // Usage Page (Button) 12
# 0x19, 0x01, // Usage Minimum (1) 14
# 0x29, 0x02, // Usage Maximum (2) 16
# 0x15, 0x00, // Logical Minimum (0) 18
# 0x25, 0x01, // Logical Maximum (1) 20
# 0x75, 0x01, // Report Size (1) 22
# 0x95, 0x02, // Report Count (2) 24
# 0x81, 0x02, // Input (Data,Var,Abs) 26
# 0x95, 0x06, // Report Count (6) 28
# 0x81, 0x03, // Input (Cnst,Var,Abs) 30
# 0x05, 0x01, // Usage Page (Generic Desktop) 32
# 0x09, 0x30, // Usage (X) 34
# 0x09, 0x31, // Usage (Y) 36
# 0x09, 0x38, // Usage (Wheel) 38
# 0x15, 0x81, // Logical Minimum (-127) 40
# 0x25, 0x7f, // Logical Maximum (127) 42
# 0x75, 0x08, // Report Size (8) 44
# 0x95, 0x03, // Report Count (3) 46
# 0x81, 0x06, // Input (Data,Var,Rel) 48
# 0x05, 0x0c, // Usage Page (Consumer Devices) 50
# 0x0a, 0x38, 0x02, // Usage (AC Pan) 52
# 0x95, 0x01, // Report Count (1) 55
# 0x81, 0x06, // Input (Data,Var,Rel) 57
# 0x75, 0x08, // Report Size (8) 59
# 0x95, 0x03, // Report Count (3) 61
# 0x81, 0x03, // Input (Cnst,Var,Abs) 63
# 0xc0, // End Collection 65
# 0x06, 0x00, 0xff, // Usage Page (Vendor Defined Page 1) 66
# 0x85, 0x0d, // Report ID (13) 69
# 0x09, 0xc5, // Usage (Vendor Usage 0xc5) 71
# 0x15, 0x00, // Logical Minimum (0) 73
# 0x26, 0xff...

Revision history for this message
Coiby Xu (coiby) wrote :

Hi all,

Can you test the follow patch works for your touchpad? Disabling glitch filter seems to eliminate the root cause.

$ git diff
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 9a760f5cd7ed..e786d779d6c8 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -463,7 +463,7 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
                pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
                pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
                pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
- pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
+ /** pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF; */
                irq_set_handler_locked(d, handle_level_irq);
                bre

Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby)

you are the best!

many thanks to you!!!

#171 work for 04f3:3140 elan touchpad!

env:

fedora 33 kernel 5.8.13

lenovo legion R7000 (another name :Lenovo Legion-5 15ARH05)

pointer move ok,
two finger scroll ok!

Revision history for this message
Azizkhan (injkgz) wrote :

@wangjun
How did you compiled old patch with kernel 5.8.13?

Revision history for this message
wangjun (biggerchina) wrote :

@Azizkhan (injkgz)

read patch file ,find the right line,then manual patch ,do not use tool.

Revision history for this message
PD (pd1986) wrote :

@Azizkhan
check the patch file and your kernel file if the content for each line is consistent. If it is, you could copy patch file to kernel folder and run command "patch -p1 < patchfile"

@wangjun (biggerchina), @Coiby Xu (coiby)
Could you please summarize what you tested and did for patch? I am completely lost. :D

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Coiby Xu (coiby)

#171 works for under Manjaro Linux and Kernel 5.8.13 too.

https://linux-hardware.org/?probe=7b7c4086f5

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Hey @Helmut Stult (helmut-stult)
I compiled kernel from there: https://gitlab.manjaro.org/packages/core/linux58
but unfortunately touchpad does not works.

Linux Lenovo 5.8.13-4-MANJARO #1 SMP PREEMPT Tue Oct 6 19:05:24 CEST 2020 x86_64 GNU/Linux

↳ MSFT0001:00 04F3:3140 Touchpad id=17 [slave pointer (2)]

is something what i should do more to make it works?

Revision history for this message
Azizkhan (injkgz) wrote :

Can anyone provide debian packages for compiled kernel 5.8.13 with patch?

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Piotr Tomaszewski (nfm886)

The patch is not included in the kernel, as other touchpads will no longer work.

You can use the attached patch and build your own kernel. It works with ELAN-Touchpad MSFT0001:00 04F3:3140

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Use this PKGBUILD

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Won't build since there is no 0303-pinctrl-amd2.patch in repo.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

See #179 ;-)

Revision history for this message
Benjamin Rogoll (jewlez) wrote :

Hey Guys, didnt read everything, just for me the simplest version to fix stuff on Manjaro is to download the 5.8.13-1 Kernel from the Manjaro gitlab and install xf86-input-synaptics via pacman. I have not managed to get it to work on Mint, but here it works flawlessly.

Revision history for this message
Azizkhan (injkgz) wrote :

Is it able to build Ubuntu 5.8.13 kernel?
I mean from kernel.org

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Helmut Stult (helmut-stult), oh right. Did not see that post. Now everything works like a charm. Even touchpad gestures works :) Thanks guys, you are awesome!

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Coiby Xu (coiby)

Apparently there was a similar problem with the 4.19 kernel, but with the Intel CPU, which was then solved with the following patch.

https://gitlab.manjaro.org/packages/core/linux419/-/blob/master/ELAN_touchpad_i2c_hid_pinctrl.patch

Now the two lines are included (for example) in kernel 5.8 in /drivers/pincrtl/pincrtl-intel.c:

     /* Clear interrupt status first to avoid unexpected interrupt */
     writel(BIT(gpp_offset), is);

Maybe this information will help you.

Revision history for this message
Azizkhan (injkgz) wrote :

After trying building kernel 5.8.14 with patches getting error:
  LD [M] drivers/iio/pressure/st_pressure.o
  GEN .version
  CHK include/generated/compile.h
  LD vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN modules.builtin
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [Makefile:1135: vmlinux] Error 1
make[2]: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:77: deb-pkg] Error 2
make: *** [Makefile:1491: deb-pkg] Error 2

Revision history for this message
MeMoS (athov) wrote :

Managed to make the touchpad work but gestures are not working.
Got the PKGBUILD for 5.8.14 from the gitlab page and added the patch tried xf86-input-synaptics and xf86-input-libinput.

Revision history for this message
Coiby Xu (coiby) wrote :

@injkgz

And also for those who have difficult building the custom kernel which is not necessary, you can build a single pinctrl-amd.ko.

1. After you download the attached file which contains fixed pinctrl-amd.c and other heades for building, run make to build this module,

$ make
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '~/kernel/linux_touchpad
  CC [M] ~/kernel/other/standone_pinctrl-amd/pinctrl-amd.o
  AR ~/kernel/other/standone_pinctrl-amd/built-in.a
  MODPOST ~/kernel/other/standone_pinctrl-amd/Module.symvers
  CC [M] ~/kernel/other/standone_pinctrl-amd/pinctrl-amd.mod.o
  LD [M] ~/kernel/other/standone_pinctrl-amd/pinctrl-amd.ko

make[1]: Leaving directory '/home/coiby/Desktop/kernel/linux_touchpad'

2 Copy pinctrl-amd.ko to override the current one whose path can be found by modinfo

$ modinfo pinctrl-amd
filename: /lib/modules/5.9.0-rc7-MANJARO+/kernel/drivers/pinctrl-amd/pinctrl-amd.ko.xz
$ cp pinctrl-amd.ko /lib/modules/5.9.0-rc7-MANJARO+/kernel/drivers/pinctrl-amd/pinctrl-amd.ko.xz

3. reboot the system and now you are expected to see a working touchpad
;

Revision history for this message
Coiby Xu (coiby) wrote :

@wangjun (biggerchina)

Thank you for sharing the result in #170.

I'm surprised to know that with pin's direction set to "out", no new "no data" message shows when putting the touchpad aside.

Can you share the interrupt counter for me when you don't use the touchpad? For my laptop, the number of interrupts will keep increasing rapidly after setting the pin's direction to "out". Can you confirm it for your laptop?

$ cat /proc/interrupts |grep pinctrl
5: 7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 IR-IO-APIC 7-fasteoi
# increasing from 3 to 11839
$ cat /proc/interrupts |grep pinctrl
5: 7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11839 IR-IO-APIC 7-fasteoi

Revision history for this message
Coiby Xu (coiby) wrote :

@PD (pd1986)

> @wangjun (biggerchina), @Coiby Xu (coiby)

> Could you please summarize what you tested and did for patch? I am completely lost. :D

Basically, I want wangjun to find out the minimum time for manually triggering a interrupt for the ELAN touchpad. You may be also check https://www.spinics.net/lists/linux-gpio/msg53623.html for more details.

Revision history for this message
Coiby Xu (coiby) wrote :

@Helmut Stult (helmut-stult)

> @Coiby Xu (coiby)

> Apparently there was a similar problem with the 4.19 kernel, but with the Intel CPU, which was then solved with the following patch.

> https://gitlab.manjaro.org/packages/core/linux419/-/blob/master/ELAN_touchpad_i2c_hid_pinctrl.patch

> Now the two lines are included (for example) in kernel 5.8 in /drivers/pincrtl/pincrtl-intel.c:

> /* Clear interrupt status first to avoid unexpected interrupt */

Thank you for sharing this info! I think we've found the root cause and the fix is to disable glitch filter. What needs to be done is to find a way to do it without affecting existing touchpads. For the details, you can check the disccussion in this thread https://www.spinics.net/lists/linux-gpio/msg53638.html.

Revision history for this message
wangjun (biggerchina) wrote :

@Coiby Xu (coiby)

test to your #190;

test env:

     1.no use the disable glitch filter patch.
     2.enabled gpio sysfs

the result:

     1.before run : echo out > direction
```

[ra@localhost ~]$ cat /proc/interrupts |grep pinctrl
   7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 IR-IO-APIC 7-fasteoi pinctrl_amd

```

       2.after run : echo out > direction

```
[ra@localhost ~]$ cat /proc/interrupts |grep pinctrl
   7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3495 IR-IO-APIC 7-fasteoi pinctrl_amd
[ra@localhost ~]$ cat /proc/interrupts |grep pinctrl
   7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6406 IR-IO-APIC 7-fasteoi pinctrl_amd
[ra@localhost ~]$ cat /proc/interrupts |grep pinctrl
   7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7948 IR-IO-APIC 7-fasteoi pinctrl_amd
[ra@localhost ~]$ cat /proc/interrupts |grep pinctrl
   7: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9317 IR-IO-APIC 7-fasteoi pinctrl_amd
[ra@localhost ~]$

```

the interrupts count is increasing fastly ,same with your laptop.

dmesg say only one time :

[ 1032.737176] i2c_hid i2c-MSFT0001:00: i2c_hid_get_input: IRQ triggered but there's no data

Revision history for this message
Coiby Xu (coiby) wrote :

@wangjun (biggerchina)

Thank you for sharing the result! Then we can be completely sure glitch filter is the sole root cause.

Revision history for this message
PD (pd1986) wrote :

I am not misunderstanding, does it mean that only patch for pinctrl-amd.c without changing i2c-hid-core.c should solve the problem?

Revision history for this message
PD (pd1986) wrote :

If I am not misunderstanding...

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Hey Coiby Xu (coiby),
That's does not works. Manjaro Linux 5.8.11-1-MANJARO x86_64 20.1.1 Mikah
and make ending up with error 2

translated error is
make [1]: *** No objects found and no makefile found. Stop.

Revision history for this message
Coiby Xu (coiby) wrote :

@PD (pd1986)
> If I am not misunderstanding, does it mean that only patch for pinctrl-amd.c without changing i2c-hid-core.c should solve the problem?

Yes, you are right! Only commenting out one line of code in pinctrl-amd.c would be sufficient for fixing this laptop model. But for now we are not sure how will it affect other touchpads, so only use it for this laptop.

Revision history for this message
Coiby Xu (coiby) wrote :

@Piotr Tomaszewski (nfm886)

> Hey Coiby Xu (coiby),
> That's does not works. Manjaro Linux 5.8.11-1-MANJARO x86_64 20.1.1 Mikah
> and make ending up with error 2

> translated error is
> make [1]: *** No objects found and no makefile found. Stop

You should run make in the folder where you see "Makefile". After unzipping the downloaded archive in #189, you should run make after going into the child folder, i.e., "cd standone_pinctrl-amd" (sorry for the typoin the name, I meant standalone_pinctrl-amd).

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Coiby Xu (coiby),Thanks for reply. I'm actually trying to make it from the directory standone_pinctrl-amd, but error is still there.

~/Pobrane/standone_pinctrl-amd >>> ls -al
drwxr-xr-x - piotr 9 paź 0:30 .
drwxr-xr-x - piotr 9 paź 22:26 ..
.rw-r--r-- 220 piotr 9 paź 0:19 .built-in.a.cmd
.rw-r--r-- 292 piotr 9 paź 0:21 .Module.symvers.cmd
.rw-r--r-- 249 piotr 9 paź 0:21 .modules.order.cmd
.rw-r--r-- 358 piotr 9 paź 0:21 .pinctrl-amd.ko.cmd
.rw-r--r-- 234 piotr 9 paź 0:21 .pinctrl-amd.mod.cmd
.rw-r--r-- 30k piotr 9 paź 0:21 .pinctrl-amd.mod.o.cmd
.rw-r--r-- 46k piotr 9 paź 0:21 .pinctrl-amd.o.cmd
.rw-r--r-- 8,1k piotr 9 paź 0:20 core.h
.rw-r--r-- 115 piotr 9 paź 0:19 Makefile
.rw-r--r-- 0 piotr 9 paź 0:21 Module.symvers
.rw-r--r-- 69 piotr 9 paź 0:21 modules.order
.rw-r--r-- 26k piotr 9 paź 0:29 pinctrl-amd.c
.rw-r--r-- 6,7k piotr 9 paź 0:21 pinctrl-amd.h
.rw-r--r-- 1,9k piotr 9 paź 0:21 pinctrl-amd.mod.c
.rw-r--r-- 1,7k piotr 9 paź 0:20 pinctrl-utils.h
~/Pobrane/standone_pinctrl-amd >>> make
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Wejście do katalogu '/usr/lib/modules/5.8.11-1-MANJARO/build'
make[1]: *** Nie podano obiektów i nie znaleziono makefile. Stop.
make[1]: Opuszczenie katalogu '/usr/lib/modules/5.8.11-1-MANJARO/build'
make: *** [Makefile:8: kbuild] Błąd 2
~/Pobrane/standone_pinctrl-amd >>>

Sorry for non-english output. I have no idea what is wrong.

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Coiby Xu (coiby), Got it working! Installing linux58-headers solved problem. Thanks a lot for your hard work!

Revision history for this message
PD (pd1986) wrote :

@Coiby Xu (coiby)
Thanks a log for your contribution

I tried to use the way of "echo out > gpio386/direction" to fix the problem without patching the kernel, but I found Touchpad click sensitivity is less than patching the kernel.

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Hey @Coiby Xu (coiby),
Last question from me :)
How can I use #189 with PopOS? After "make" when I run "modinfo" I got output like that:

name: pinctrl_amd
filename: (builtin)
description: AMD GPIO pinctrl driver
author: Ken Xue <email address hidden>, Jeff Wu <email address hidden>
license: GPL v2
file: drivers/pinctrl/pinctrl-amd

How can I find file to copy?

Revision history for this message
Coiby Xu (coiby) wrote : Re: [Bug 1887190] Re: MSFT Touchpad not working on Lenovo Legion-5 15ARH05

On Sat, Oct 10, 2020 at 11:38:27AM -0000, PD wrote:
>@Coiby Xu (coiby)
>Thanks a log for your contribution
>
It's my pleasure!

>I tried to use the way of "echo out > gpio386/direction" to fix the
>problem without patching the kernel, but I found Touchpad click
>sensitivity is less than patching the kernel.

You shouldn't use "echo out > gpio386/direction" to fix the touchpad. It
will make the GPIO chip keep firing interrupts even you don't use the
touchpad as you can seen from the result by wangjun in #193.

Revision history for this message
Coiby Xu (coiby) wrote : Re: [Bug 1887190] #203 15ARH05

On Sat, Oct 10, 2020 at 12:45:58PM -0000, Piotr Tomaszewski wrote:
>Hey @Coiby Xu (coiby),
>Last question from me :)
>How can I use #189 with PopOS? After "make" when I run "modinfo" I got output like that:
>
>name: pinctrl_amd
>filename: (builtin)
>description: AMD GPIO pinctrl driver
>author: Ken Xue <email address hidden>, Jeff Wu <email address hidden>
>license: GPL v2
>file: drivers/pinctrl/pinctrl-amd
>
>How can I find file to copy?
>

For PopOS, pinctrl-amd is built into the kernel. So you have to re-build
the whole kernel with patched pinctrl-amd.

Revision history for this message
Paulinski (mail-izy) wrote :

Is there any chance that his patch will be part of the official kernel build soon?

Revision history for this message
Coiby Xu (coiby) wrote : Re: [Bug 1887190] Re: MSFT Touchpad not working on Lenovo Legion-5 15ARH05

On Sun, Oct 11, 2020 at 07:07:37PM -0000, Paulinski wrote:
>Is there any chance that his patch will be part of the official kernel
>build soon?

I have yet to submit the patch of fixing the root cause. But I've
submitted a patch of adding polling mode to the i2c-hid module to
https://www.spinics.net/lists/linux-input/msg69458.html last Friday.
After the patch reaches end users like you, you can add
i2c-hid.polling_mode=1 to the kernel boot parameters to make the
touchpad work.

Revision history for this message
Azizkhan (injkgz) wrote :

> i2c-hid.polling_mode=1 to the kernel boot parameters to make the
touchpad work.
you mean that I can just flash 5.9 kernel and then add to grub this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video.use_native_backlight=1 i2c-hid.polling_mode=1"

Revision history for this message
jbuncle (jbuncle) wrote :

I had the same issue (with both Ubuntu 20.04 and 20.10). It does seem to be resolved after installing a 5.9 Kernel with the above patch applied (from @coiby https://www.spinics.net/lists/linux-input/msg69458.html.

I have scripted the process I used (download, patch, compile and install the kernel) for anyone else that's eager to get a working Touchpad on a Ubuntu 20 installation on Lenovo Legion 5 (Obviously there may be unwanted side effects of doing this). This will probably require Secure Boot to be disabled in the BIOS.

See GitHub Gist here: https://gist.github.com/jbuncle/7dacde983b3c33b3b816b10e2fd2308a
Command for convenience: `bash <(curl https://gist.githubusercontent.com/jbuncle/7dacde983b3c33b3b816b10e2fd2308a/raw/build-patched-kernel.sh)`

Note the need for updating GRUB_CMDLINE_LINUX_DEFAULT with i2c-hid.polling_mode=1

(First time I've built the Linux Kernel myself or even commented on here!)

Thanks to @Coiby Xu (coiby)

Revision history for this message
Azizkhan (injkgz) wrote :

@jbuncle (jbuncle)
Yo man, in your script you don't do configs, so after installation user gets all drivers that's included in kernel modules (~6Gb).

Revision history for this message
Coiby Xu (coiby) wrote :

For those who want to try the polling mode i2c-hid, here are the instructions to build a single i2c-hid module without building a whole kernel or downloading the whole kernel source code,

1. After you download the attached file which contains patched i2c-hid-core.c and other headers for building, run make to build this module,

$ make
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '/usr/lib/modules/5.9.0-1-MANJARO/build'
  AR /home/coiby/Desktop/kernel/other/i2c-hid_standalone/built-in.a
  CC [M] /home/coiby/Desktop/kernel/other/i2c-hid_standalone/i2c-hid-core.o
  CC [M] /home/coiby/Desktop/kernel/other/i2c-hid_standalone/i2c-hid-dmi-quirks.o
  LD [M] /home/coiby/Desktop/kernel/other/i2c-hid_standalone/i2c-hid.o
  MODPOST /home/coiby/Desktop/kernel/other/i2c-hid_standalone/Module.symvers
  CC [M] /home/coiby/Desktop/kernel/other/i2c-hid_standalone/i2c-hid.mod.o
  LD [M] /home/coiby/Desktop/kernel/other/i2c-hid_standalone/i2c-hid.ko
make[1]: Leaving directory '/usr/lib/modules/5.9.0-1-MANJARO/build'

2. Copy i2c-hid.ko to override the current one whose path can be found by modinfo

$ modinfo i2c-hid.ko
filename: /lib/modules/5.9.0-1-MANJARO/kernel/drivers/hid/i2c-hid/i2c-hid.ko.xz

$ cp i2c-hid.ko /lib/modules/5.9.0-1-MANJARO/kernel/drivers/hid/i2c-hid/i2c-hid.ko.xz

3. run depmod
$ sudo depmod

4. reboot the system and play with your touchpad

Revision history for this message
Coiby Xu (coiby) wrote :

Additional notes to #211:

Actually rebooting your machine is not necessary for simply testing the module. You can remove the old kernel first,

$ sudo rmmod i2c-hid

and then insert the new module with the parameter "polling_mode=1"
$ sudo insmod i2c-hid.ko polling_mode=1

For have persistent effect, you need to add i2c-hid.polling_mode=1 to the kernel boot parameters to make the
touchpad work after installing this new i2c-hid module following the instructions in #211.

Revision history for this message
Coiby Xu (coiby) wrote :

On Tue, Oct 13, 2020 at 05:27:44AM -0000, Azizkhan wrote:
>> i2c-hid.polling_mode=1 to the kernel boot parameters to make the
>touchpad work.
>you mean that I can just flash 5.9 kernel and then add to grub this line:
>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video.use_native_backlight=1 i2c-hid.polling_mode=1"

This patch hasn't been included in Linux 5.9. And I'm not sure when this patch will be accepted by the subsystem maintainer and eventually reach your distribution. But you can following the instructions in #211 and #212 to try this solution.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Coiby, can you please work on a DMI based workaround in gpiolib-acpi.c? It'll have higher chance to get merged.

Revision history for this message
Coiby Xu (coiby) wrote :

On Tue, Oct 13, 2020 at 01:44:31PM -0000, jbuncle wrote:
>I had the same issue (with both Ubuntu 20.04 and 20.10). It does seem to
>be resolved after installing a 5.9 Kernel with the above patch applied
>(from @coiby https://www.spinics.net/lists/linux-input/msg69458.html.

Glad it works for you. You may want to reply to that email with the
following content to make the patch accepted by the maintainer faster,

Tested-by: Your_name <email address hidden>

The receiver should be <email address hidden>.

And put the following addresses in the CC filed,
Jiri Kosina <email address hidden>
Benjamin Tissoires <email address hidden>
<email address hidden>

You should also put set the reply-to header to <email address hidden> in your client client so the message will show in the same thread. And make sure use the plain text format.

If you don't want go through these hassles, you may send your name to me by email so I'll do it on behalf of you.

>
>I have scripted the process I used (download, patch, compile and install
>the kernel) for anyone else that's eager to get a working Touchpad on a
>Ubuntu 20 installation on Lenovo Legion 5 (Obviously there may be
>unwanted side effects of doing this). This will probably require Secure
>Boot to be disabled in the BIOS.
>
>See GitHub Gist here: https://gist.github.com/jbuncle/7dacde983b3c33b3b816b10e2fd2308a
>Command for convenience: `bash <(curl https://gist.githubusercontent.com/jbuncle/7dacde983b3c33b3b816b10e2fd2308a/raw/build-patched-kernel.sh)`
>
>Note the need for updating GRUB_CMDLINE_LINUX_DEFAULT with i2c-
>hid.polling_mode=1
>
>(First time I've built the Linux Kernel myself or even commented on
>here!)

Congratulations!

>Thanks to @Coiby Xu (coiby)

You are welcome!

Revision history for this message
Coiby Xu (coiby) wrote :

On Thu, Oct 15, 2020 at 05:37:46AM -0000, Kai-Heng Feng wrote:
>Coiby, can you please work on a DMI based workaround in gpiolib-acpi.c?
>It'll have higher chance to get merged.
>
Thank you for the suggestion! Linus Walleij also suggested introducing
a new quirk [1]. Although my main effort is on patching pinctrl-amd.c
without affecting other touchpad together with Hans de Goede [1], I
have spent some time on understanding gpiolib-acpi.c. For now my
conclusion is there is no way to bypass pinctrl-amd by introducing
a new quirk.

[1] https://www.spinics.net/lists/linux-gpio/msg53641.html
[2] https://www.spinics.net/lists/linux-gpio/msg53901.html

Revision history for this message
Coiby Xu (coiby) wrote :

Fix on #211

Another header file hid-ids.h is required to build i2c-hid module. Attached is the updated zip file.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Coiby Xu (coiby)

We have received feedback in our forum that the touchpad no longer works after a resuming from suspend.

I've attached the link - maybe you can take a look at it.

https://forum.manjaro.org/t/i2c-touchpad-does-not-function-after-resuming-from-suspend/31987/5

Revision history for this message
Lu Do (tchio.ludo) wrote :

Just try this morning the #210, it's working well on ubuntu 20.04 !
Thanks @Coiby Xu (coiby)

I also confirmed the suspend will break the touchpad

Revision history for this message
Coiby Xu (coiby) wrote :

On Thu, Oct 15, 2020 at 04:11:49PM -0000, Helmut Stult wrote:
>@Coiby Xu (coiby)
>
>We have received feedback in our forum that the touchpad no longer works
>after a resuming from suspend.
>
>I've attached the link - maybe you can take a look at it.
>
>https://forum.manjaro.org/t/i2c-touchpad-does-not-function-after-
>resuming-from-suspend/31987/5

Thanks for the reporting! I've sent a new version to you.

Revision history for this message
Coiby Xu (coiby) wrote :

On Thu, Oct 15, 2020 at 04:27:05PM -0000, Lu Do wrote:
>Just try this morning the #210, it's working well on ubuntu 20.04 !
>Thanks @Coiby Xu (coiby)
>
>I also confirmed the suspend will break the touchpad

Thank you for testing it! I've sent a new patch to
https://lore.kernel.org/patchwork/patch/1321917/.
But you may not need it since the old patch will only
break the touchpad with the polling mode disabled.

Revision history for this message
Ivan Zakharyaschev (imz) wrote :

I had problems (the touchpad not working and the suspend not working) with ELAN0001:00 04F3:3140 under linux-image-unsigned-5.6.0-1021-oem on Ubuntu, but they are gone if I manually unbind the device from elants_i2c driver and bind it to i2c_hid -- https://bugs.launchpad.net/ubuntu/+source/linux-oem-5.6/+bug/1900254

Revision history for this message
Ivan Zakharyaschev (imz) wrote :

They also mentioned the suspend problem at https://bugzilla.kernel.org/show_bug.cgi?id=207759#c19 , not only the problem of the touchpad that didn't work.

Revision history for this message
Coiby Xu (coiby) wrote :

On Sat, Oct 17, 2020 at 03:23:05PM -0000, Ivan Zakharyaschev wrote:
>I had problems (the touchpad not working and the suspend not working)
>with ELAN0001:00 04F3:3140 under linux-image-unsigned-5.6.0-1021-oem on
>Ubuntu, but they are gone if I manually unbind the device from
>elants_i2c driver and bind it to i2c_hid --
>https://bugs.launchpad.net/ubuntu/+source/linux-oem-5.6/+bug/1900254
>
Thank you for sharing the info! Do you use the same laptop model?
If that's the case, it would surprise me because the root cause
for this laptop model has been found.

Revision history for this message
Benjamin Rogoll (jewlez) wrote :

Hey there guy, can anyone tell me what im doing wrong with the patch provided in #217. The tutorial in #211 doesnt work for me.

p_$$/tmp.o; mkdir -p /home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone/.tmp_$$; trap "rm -rf /home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone/.tmp_$$" EXIT; if ( echo "int main() {}" | gcc -xc -o /dev/null -lelf -) >/dev/null 2>&1; then echo "1"; else echo "0"; fi'
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `make -f ./scripts/Makefile.build obj=/home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone \'
make: *** [Makefile:1752: /home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone] Error 1
make: Leaving directory '/usr/lib/modules/5.8.16-2-MANJARO/build'

help much appreciated

Revision history for this message
Coiby Xu (coiby) wrote :

On Tue, Oct 20, 2020 at 09:28:54AM -0000, Benjamin Rogoll wrote:
>Hey there guy, can anyone tell me what im doing wrong with the patch
>provided in #217. The tutorial in #211 doesnt work for me.
>
>p_$$/tmp.o; mkdir -p /home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone/.tmp_$$; trap "rm -rf /home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone/.tmp_$$" EXIT; if ( echo "int main() {}" | gcc -xc -o /dev/null -lelf -) >/dev/null 2>&1; then echo "1"; else echo "0"; fi'
>/bin/sh: -c: line 0: syntax error near unexpected token `('
>/bin/sh: -c: line 0: `make -f ./scripts/Makefile.build obj=/home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone \'
>make: *** [Makefile:1752: /home/benjamin/Downloads/i2c-hid_standalone(1)/i2c-hid_standalone] Error 1
>make: Leaving directory '/usr/lib/modules/5.8.16-2-MANJARO/build'
>
>help much appreciated
>
Can you run "make V=1" to have more verbose output?

Btw, I would suggest you to try #189 instead because polling could
consume a little more power than interrupting.

Revision history for this message
Francesco Guarneri (ffrisk) wrote :

Hi! Managed to reproduce the steps described in #211 (using the updated archive provided in #217) and #212. The touchpad seems to be working after running

$ sudo rmmod i2c-hid
$ sudo insmod full-path/i2c-hid.ko polling_mode=1

I need to provide the full path to the i2c-hid.ko module, otherwise the system returns "could not load module "i2c-hid.ko: No such file or directory"; not sure if this is already an issue.
However, I am not sure how to add the boot parameter to GRUB. I followed this (https://wiki.ubuntu.com/Kernel/KernelBootParameters) and tried adding either one of these three options:

i2c-hid.polling_mode=1
full-path/i2c-hid.polling_mode=1
full-path/i2c-hid.ko.polling_mode=1

but neither seems to be working. Am i doing something wrong? Using Ubuntu 20.04.1 with kernel 5.8.16. Also, total noob and first time writing here, so hopefully not causing issues.

Revision history for this message
Von (straeker) wrote :

Hi Francesco

I have the same laptop with Ubuntu installed and I am using #211 patch too. It works for me after running:

$ sudo rmmod i2c_hid
$ sudo insmod /path/to/i2c-hid.ko polling_mode=1
$ sudo cp /path/to/i2c-hid.ko /lib/modules/$(uname -r)/kernel/drivers/hid/i2c-hid/i2c-hid.ko
$ sudo depmod

then append i2c_hid.polling_mode=1 to kernel commandline

  use a text editor to open /etc/default/grub as root, then change the line
  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to
  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i2c_hid.polling_mode=1"
  ,finally save the changes

then run:

$ sudo update-grub2
$ sudo update-initramfs -u

reboot the laptop and everything shall be fine

Revision history for this message
Francesco Guarneri (ffrisk) wrote :

> sudo update-initramfs -u

This is what I was missing. Thank you so much!

Revision history for this message
PEDRO PORTO BUARQUE DE GUSMAO (pedropgusmao) wrote :

Hi,

Can I do this with Secure Boot on?

Revision history for this message
Christian (chris-svn) wrote :

@Coiby Xu (coiby)
Thank you very much for the patch in #189. It works like a charm.

@Piotr Tomaszewski (nfm886)
Thanks for posting your solution in #201. I was in the exact same situation and without it, I would probably still be wondering why it didnt work for me.

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Christian (chris-svn),
Glad to help :)

@Coiby Xu (coiby),
Hey Sir, is there easy way to apply this patch on Ubuntu/PopOS distro without build whole kernel?

Revision history for this message
eea (eakb) wrote :

Thank you @Coiby Xu (coiby) and Von (straeker) and everyone else for your work. The standalone patch #217 is working perfectly on a fresh Ubuntu 20.10, installed with secure boot (5.8.0-25-generic). No suspend problems.

@PEDRO PORTO BUARQUE DE GUSMAO (pedropgusmao), Piotr Tomaszewski (nfm886): To make the module work under secure boot, the module needs to be signed first before inserting. Just skip the signing if you don't use secure boot but don't want to rebuild the whole kernel:

- Download the standalone module from #217

- Install "build-essential" package (if it is missing) which is needed to build the module:
$ sudo apt install build-essential

- "make" the module as in #211

- Sign the module before inserting:
$ kmodsign sha512 \
    /var/lib/shim-signed/mok/MOK.priv \
    /var/lib/shim-signed/mok/MOK.der \
    i2c-hid.ko

- Insert and copy the module and update grub and initramfs as in #228

Revision history for this message
Von (straeker) wrote :

The standalone patch #217 is working for MSFT0001:00 04F3:3140 but isn't working perfectly for MSFT0001:00 06CB:7F28. The MSFT0001:00 06CB:7F28 touchpad frequently locks into scroll mode when using multitouch gestures.

Revision history for this message
Coiby Xu (coiby) wrote :

On Tue, Oct 27, 2020 at 07:53:05PM -0000, Von wrote:
>The standalone patch #217 is working for MSFT0001:00 04F3:3140 but isn't
>working perfectly for MSFT0001:00 06CB:7F28. The MSFT0001:00 06CB:7F28
>touchpad frequently locks into scroll mode when using multitouch
>gestures.
Thank you for reporting this problem. The latest version [1] allows
you to adjust the polling interval. Will decreasing
polling_interval_active_us to 1ms fix the problem?

$ echo 1000 > /sys/module/i2c_hid/parameters/polling_interval_active_us
# you may change polling_interval_idle_ms as well
$ echo 2 > /sys/module/i2c_hid/parameters/polling_interval_idle_ms

[1] https://github.com/coiby/standalone_i2c_hid

Revision history for this message
boudicca (shazh) wrote :

@Coilby Xu, all good on fresh Ubuntu 20.10 5.8-26 Generic and Manjaro gnome 20.2-Pre4 Testing.

For Polling method steps

1. Download file from Message #217 file
2. Extract to folder, enter folder and subfolder.
3. run make (needs apt-get make gcc linux-headers #211 instuctions
4. follow #228 for ubuntu, copy replace existing ko file, rmmod insmod then depmod, change Grub2 for Ubuntu
5. reboot Job done. if want test to see,before 4. Follow #212

Thanks Coilby Xu and others.... Simples!

Revision history for this message
boudicca (shazh) wrote :

edit: #236 was for 3140 touchpad

Revision history for this message
Von (straeker) wrote :

@Coiby Xu (coiby)

> Will decreasing
polling_interval_active_us to 1ms fix the problem?
> $echo 1000 > /sys/module/i2c_hid/parameters/polling_interval_active_us

Yes, I installed the latest version from Github, and decreasing polling_interval_active_us seems to fix the problem.

Revision history for this message
Coiby Xu (coiby) wrote : [PATCH 4/4] pinctrl: amd: remove debounce filter setting in irq type setting

Debounce filter setting should be independent from irq type setting
because according to the ACPI specs, there are separate arguments for
specifying debounce timeout and irq type in GpioIo and GpioInt.

This will fix broken touchpads for Lenovo Legion-5 AMD gaming laptops
including 15ARH05 (R7000) and R7000P whose BIOS set the debounce timeout
to 124.8ms which led to kernel receiving only ~7 HID reports per second.

Cc: Hans de Goede <email address hidden>
Cc: Andy Shevchenko <email address hidden>
Cc: <email address hidden>
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
Message-Id: <email address hidden>
Signed-off-by: Coiby Xu <email address hidden>
---
 drivers/pinctrl/pinctrl-amd.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 524d55546b61..5a1d518b563e 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -468,7 +468,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
   pin_reg &= ~BIT(LEVEL_TRIG_OFF);
   pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
   pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
- pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
   irq_set_handler_locked(d, handle_edge_irq);
   break;

@@ -476,7 +475,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
   pin_reg &= ~BIT(LEVEL_TRIG_OFF);
   pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
   pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
- pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
   irq_set_handler_locked(d, handle_edge_irq);
   break;

@@ -484,7 +482,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
   pin_reg &= ~BIT(LEVEL_TRIG_OFF);
   pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
   pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
- pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
   irq_set_handler_locked(d, handle_edge_irq);
   break;

@@ -492,8 +489,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
   pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
   pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
   pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
- pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
- pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
   irq_set_handler_locked(d, handle_level_irq);
   break;

@@ -501,8 +496,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
   pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
   pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
   pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
- pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
- pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
   irq_set_handler_locked(d, handle_level_irq);
   break;

--
2.28.0

Revision history for this message
Andy Shevchenko (andy.shevchenko) wrote :

On Wed, Nov 4, 2020 at 6:05 PM Coiby Xu <email address hidden> wrote:
>
> Debounce filter setting should be independent from irq type setting
> because according to the ACPI specs, there are separate arguments for
> specifying debounce timeout and irq type in GpioIo and GpioInt.
>
> This will fix broken touchpads for Lenovo Legion-5 AMD gaming laptops
> including 15ARH05 (R7000) and R7000P whose BIOS set the debounce timeout
> to 124.8ms which led to kernel receiving only ~7 HID reports per second.

to the kernel

> Cc: Hans de Goede <email address hidden>
> Cc: Andy Shevchenko <email address hidden>
> Cc: <email address hidden>
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190

> Message-Id: <email address hidden>

Link: https://lore.kernel.org/...

--
With Best Regards,
Andy Shevchenko

Revision history for this message
Coiby Xu (coiby) wrote :

On Wed, Nov 04, 2020 at 10:42:38PM +0200, Andy Shevchenko wrote:
>On Wed, Nov 4, 2020 at 6:05 PM Coiby Xu <email address hidden> wrote:
>>
>> Debounce filter setting should be independent from irq type setting
>> because according to the ACPI specs, there are separate arguments for
>> specifying debounce timeout and irq type in GpioIo and GpioInt.
>>
>> This will fix broken touchpads for Lenovo Legion-5 AMD gaming laptops
>> including 15ARH05 (R7000) and R7000P whose BIOS set the debounce timeout
>> to 124.8ms which led to kernel receiving only ~7 HID reports per second.
>
>to the kernel

Thank you for correcting my grammar mistakes!

>
>> Cc: Hans de Goede <email address hidden>
>> Cc: Andy Shevchenko <email address hidden>
>> Cc: <email address hidden>
>> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
>
>> Message-Id: <email address hidden>
>
>Link: https://lore.kernel.org/...
>
>--
>With Best Regards,
>Andy Shevchenko

--
Best regards,
Coiby

Revision history for this message
Mike Boruta (maridius) wrote :

Hello again, I manually applied both the patches present in #239 and in #171 to kernel 5.4.0-52 without success (touch pad still does not work), however I applied the patch listed on #109 with success. My device is a MSFT0001:00 04F3:3186, unlike the 3140 most users have. Have any other users with a 3186 experienced success with the pinctrl-amd patches?

I'm very happy with the polling patch so far, but I would like to have the core issue fixed if possible.

Revision history for this message
Coiby Xu (coiby) wrote : Re: [Bug 1887190] Re: MSFT Touchpad not working on Lenovo Legion-5 15ARH05

On Wed, Nov 04, 2020 at 12:12:24PM -0000, Von wrote:
>@Coiby Xu (coiby)
>
>> Will decreasing
>polling_interval_active_us to 1ms fix the problem?
>> $echo 1000 > /sys/module/i2c_hid/parameters/polling_interval_active_us
>
>Yes, I installed the latest version from Github, and decreasing
>polling_interval_active_us seems to fix the problem.

I notice that if I use xf86-input-synaptics, I would also experience
this problem. So another solution is to use xf86-input-libinput.

Revision history for this message
Coiby Xu (coiby) wrote :

On Sun, Nov 08, 2020 at 03:03:03AM -0000, Mike Boruta wrote:
>Hello again, I manually applied both the patches present in #239 and in
>#171 to kernel 5.4.0-52 without success (touch pad still does not work),
>however I applied the patch listed on #109 with success. My device is a
>MSFT0001:00 04F3:3186, unlike the 3140 most users have. Have any other
>users with a 3186 experienced success with the pinctrl-amd patches?
>
>I'm very happy with the polling patch so far, but I would like to have
>the core issue fixed if possible.

Hi Mike! Can you paste the output of "sudo cat /sys/kernel/debug/gpio" and
also attach your ACPI DSDT table which can be obtained by following the
instructions in #109?

Revision history for this message
Mike Boruta (maridius) wrote :

Definitely! The attached output was compiled from 5.4.0-52 with the patch listed in 171.

Revision history for this message
Baq Domalaq (baq) wrote :

Hi everyone! I have the same problem with my touchpad on Lenovo Ideapad Gaming 3 15ARH05 under Pop!_OS.

My touchpad device number is slightly different:
MSFT0001:00 06CB:CE2D

I've applied a patch in comment #179 (I assumed that's the most fitting solution for me) and it works now! Thank you people for trying to fix this.

Anyway the comments now are very long and confusing. And I'm not sure if I used the best solution. So if anyone can point to something better, let me know.

Also let me know how to help with pushing this to official kernel. I've posted an issue to Pop OS Github repo. I'll also add a comment about my workarounds there.

Have a nice day!

Revision history for this message
Azizkhan (injkgz) wrote :

Hi all!
@Coiby Xu (coiby)
When your patch will be applied to mainline kernel? When we can just update our kernels and do nothing to fix touchpad?

Revision history for this message
Coiby Xu (coiby) wrote :

On Sun, Nov 08, 2020 at 01:14:48PM -0000, Mike Boruta wrote:
>Definitely! The attached output was compiled from 5.4.0-52 with the
>patch listed in 171.

#171 should fix your touchpad. According to your shared gpio-config,
that patch didn't take effect. So I guess you are still using the old
pinctrl-amd module.

Revision history for this message
Coiby Xu (coiby) wrote :

On Sun, Nov 08, 2020 at 04:33:43PM -0000, Baq Domalaq wrote:
>Hi everyone! I have the same problem with my touchpad on Lenovo Ideapad
>Gaming 3 15ARH05 under Pop!_OS.
>
>My touchpad device number is slightly different:
>MSFT0001:00 06CB:CE2D
>
>I've applied a patch in comment #179 (I assumed that's the most fitting
>solution for me) and it works now! Thank you people for trying to fix
>this.
>
>Anyway the comments now are very long and confusing. And I'm not sure if
>I used the best solution. So if anyone can point to something better,
>let me know.
>

The touchpads on Legion-5 could be saved by either polling (#179)
or interrupt (#171). I've submitted both patches upstream for these
two methods. After getting reviewed by the kernel developer community,
I will keep improving them until these patches get accepted by the
maintainer. I would suggest you try #171 before the patches getting
merged into the mainline kernel. If it doesn't work, you can send me
your ACPI DSDT table.

>Also let me know how to help with pushing this to official kernel. I've
>posted an issue to Pop OS Github repo. I'll also add a comment about my
>workarounds there.
>
You can send me your email address. I'll Cc you when submitting the
patch(es). Then you can test the received patch and reply to the email
with a Tested-by tag if the patch(es) works,

Tested-by: Your_name <email address hidden>

>Have a nice day!
>

Revision history for this message
Coiby Xu (coiby) wrote :

On Sun, Nov 08, 2020 at 07:38:15PM -0000, Azizkhan wrote:
>Hi all!
>@Coiby Xu (coiby)
>When your patch will be applied to mainline kernel? When we can just update our kernels and do nothing to fix touchpad?

I'm not sure when these patch(es) will be accepted and merged. It's up
to the maintainers to accept the patch(es). If there is any update, I'll
post the notification here.

Revision history for this message
Coiby Xu (coiby) wrote :

The patch in #239 depends on this patch [1] which requires to build the whole kernel. For now, I would suggest adopting #189 to fix the touchpad for daily use. But if anyone want to test the patch so we can push it into the mainline kernel early, you can send me your email address and I'll Cc you when submitting next version.

https://patchwork.ozlabs.org/project<email address hidden>/.

Revision history for this message
Pop Michael (the-legion) wrote :

Hi! I tried the #189 fix but i just can't make it to work, it gives me some errors. Can anyone makes a noob's guide? :)

Revision history for this message
Pop Michael (the-legion) wrote :

i am back. i am using ubuntu 20.10 with 5.8.0-26-generic kernel. i tried a lot of patches but nothig worked. i keep getting errors. i tried almost everything from #189 except #209.If anyone who fixed his touchpad can make a tutorial or something i would trully appreciate. i hope that the patch will be include in the kernel at some ponit, utill then i will stick to the mouse.

Revision history for this message
Baq Domalaq (baq) wrote :

Hi @Pop Michael (the-legion),

I think your distro is similar to mine (Pop!_OS 20.10) so I'll try to describe what I did. I was struggling with this for some time too, cause it was the first time I've applied a patch and re-built a kernel.

First, check if pinctrl-amd is included in kernel or not:
# modinfo pinctrl-amd

if it says `filename: (builtin)` then continue. Otherwise standalone solution #189 is for you, which is easier cause you don't have to rebuild the kernel.

Download the patch from #179.

Go into root mode:
# sudo -i

Get the kernel source:
# apt-get source linux-image-$(uname -r)

Go into the source:
# cd linux-5.8.0/

Apply the patch:
# patch -p1 < /path/to/patch/0303-pinctrl-amd2.patch

Build the kernel:
# debian/rules binary-headers binary-generic binary-perarch

This will take some time.

Now install newly build kernel:
# dpkg -i linux-image-5.8.0-7625-generic_5.8.0-7625.26~1604441477~20.10~d41e407_amd64.deb linux-headers-5.8.0-7625_5.8.0-7625.26~1604441477~20.10~d41e407_all.deb linux-headers-5.8.0-7625-generic_5.8.0-7625.26~1604441477~20.10~d41e407_amd64.deb

Your files might have different versions. But it should be 3 files: linux-image-*.deb, linux-headers-*.deb and linux-headers-*-generic-*.deb.
I'm not sure if it should be 3 files, maybe 2 is sufficient, but it didn't hurt my system.

Finally reboot. And touchpad should work.

I hope this helps.

Revision history for this message
Baq Domalaq (baq) wrote :

Hi @Coiby Xu (coiby),

thanks for your reply #249. I've sent you my email in DM.

Also I think solutions #171 and #179 are the same. Just last one is in a file.

Revision history for this message
Maxim (pavlenkoms) wrote :

Hi @Coiby Xu (coiby)
I tried #189 and #211 (different combinations) on mate-ubuntu 20.04 with custom kernels 5.8 and 5.9
I tried to install Manjaro with kernel 5.8.18, and after that I rebuilt custom kernel again with all patches
But result is only one: touchpad still doesn't work. Is there any way to debug or figure out what exactly went wrong?

And here is an interresting detail. Touchpad devices disappearing in xinput output from time to time, and could not work even in uefi menu.

Revision history for this message
Pop Michael (the-legion) wrote :

@Baq Domalaq thank you for your help, but i couldn't make it to work. At filename it is (builtin) so i tried your method, but i can't download the file from #179 bcuz there's no file , just a page with some code lines that are also on #171. Anyway , when i typed "apt-get source linux-image-$(uname -r)" in root mode it says "You must put some 'deb-src' URIs in your sources.list" which i don't understand what it means. Fixing this touchpad issue on linux seems to be beyond my knowledge. :) Thanks anyway

Revision history for this message
Baq Domalaq (baq) wrote :

Hey @Pop Michael (the-legion),
You know I can just put the *.deb files in dropbox so you can just run the last command. DM me your email and I'll send a link.

Linuxes are different for every user so no wonder your results were different. Also I could've done more than I wrote above cause I was trying different commands before that.

Revision history for this message
Mike Boruta (maridius) wrote :

@Coiby Xu (coiby)

It seems that the patch in 171 does not work (i.e. touchpad is still dead) on kernels older than 5.8. I tried 5.4.75, 5.7.19, and 5.8.18. I don't really want to look into this further since I'm fine with the newer kernel, but wanted to give you and any other users a heads up in case they find themselves in a similar situation. The kernels I was testing were taken straight from Ubuntu's mainline kernel page, and had only the following changes: CONFIG_PINCTRL_AMD was made into a module, specified line in pinctrl-amd.c was commented out.

Thanks again for all of your help in making the linux experience with this class of laptop much more enjoyable!

Revision history for this message
E (mantsje) wrote :

Mentioned in #15 there is a question about whether using the trackpad increases the amount of interrupts. For me it does do so! Placing my finger on the trackpad does generate mouse events, but it only rapidly generates click events non-stop. It cannot be used to move the pointer but just spams clicks. Would anybody know of a solution?

Revision history for this message
Baq Domalaq (baq) wrote :

Hi @E (mantsje),
Just try one of the patches mentioned here (e.g. #179). My touchpad also was making click events when moving fingers on it.

Revision history for this message
Pedro Ribeiro (pedrib) wrote :

@Coiby Xu (coiby)

I build the next branch of linux-gpio (which contains the patch you mentioned in #251), and the trackpad works just fine without the hid polling on the kernel command line.
You can contact me if you'd like further testing, my email is pedrib_at_gmail_dot_com

Revision history for this message
Pedro Ribeiro (pedrib) wrote :

To be specific, this is the branch I built:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/log/?h=for-next

The kernel I built had 0f2c7af45d7eef8455d7ad39c5326229bf19a2ed as the latest commit.

I have a Legion 5 15ARH05H (slightly different than 15ARH05).

Revision history for this message
Vitaly Guj (vitalyguj) wrote :

On Ubuntu 20.4 LTS kernel 5.9.8 method #254 worked fine.
Requires build dwarves 1.17 and download kernel from mainline

Revision history for this message
Azizkhan (injkgz) wrote :

@pedrib,
am I right new kernel 5.9.10 includes fixes for our touchpad? Branch you gave as i see already included in 5.9.10...

Revision history for this message
Coiby Xu (coiby) wrote :

Hi @Maxim (pavlenkoms),

Is your laptop also a Lenovo Legion-5 model?

On Thu, Nov 12, 2020 at 09:02:54AM -0000, Maxim wrote:
>Hi @Coiby Xu (coiby)
>I tried #189 and #211 (different combinations) on mate-ubuntu 20.04 with custom kernels 5.8 and 5.9
>I tried to install Manjaro with kernel 5.8.18, and after that I rebuilt custom kernel again with all patches
>But result is only one: touchpad still doesn't work. Is there any way to debug or figure out what exactly went wrong?
>
>And here is an interresting detail. Touchpad devices disappearing in
>xinput output from time to time, and could not work even in uefi menu.
Do you mean the touchpad works sometimes after the booting the system
but would fail when booting system next time?
>

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (6.4 KiB)

@Mike Boruta (maridius)

On Sun, Nov 15, 2020 at 08:34:03PM -0000, Mike Boruta wrote:
>@Coiby Xu (coiby)
>
>It seems that the patch in 171 does not work (i.e. touchpad is still
>dead) on kernels older than 5.8. I tried 5.4.75, 5.7.19, and 5.8.18. I
>don't really want to look into this further since I'm fine with the
>newer kernel, but wanted to give you and any other users a heads up in
>case they find themselves in a similar situation. The kernels I was
>testing were taken straight from Ubuntu's mainline kernel page, and had
>only the following changes: CONFIG_PINCTRL_AMD was made into a module,
>specified line in pinctrl-amd.c was commented out.
>
So the patch in 171 works on kernels >=5.8 but doesn't work for older
version like 5.7.19?
>Thanks again for all of your help in making the linux experience with
>this class of laptop much more enjoyable!
>
>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1887190
>
>Title:
> MSFT Touchpad not working on Lenovo Legion-5 15ARH05
>
>Status in Pop!_OS:
> New
>Status in linux package in Ubuntu:
> Confirmed
>Status in xserver-xorg-input-libinput package in Ubuntu:
> Confirmed
>Status in linux package in Arch Linux:
> Fix Committed
>Status in linux package in Fedora:
> Confirmed
>Status in linux package in openSUSE:
> New
>
>Bug description:
> Hello
>
> The MSFT touchpad of this Lenovo Legion-5 15ARH05 laptop is not reacting at all (pointer and click never move when touchpad is touched). This has been reported by other users in various websites, with various linux systems including other Ubuntu systems, but I saw no launchpad bug so I post one. Example of websites covering the issue :
> - https://askubuntu.com/questions/1253830/lenovo-legion-5-touchpad (exactly the same laptop)
> - https://www.linux.org/threads/lenovo-legion-5-touchpad.29536/ (similar laptop)
>
> xinput indentifies it as MSFT0001:00 04F3:3140
>
> Virtual core pointer id=2 [master pointer (3)]
> ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
> ⎜ ↳ MSFT0001:00 04F3:3140 Touchpad id=17 [slave pointer (2)]
> ⎜ ↳ MSFT0001:00 04F3:3140 Mouse id=16 [slave pointer (2)]
> ⎜ ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control id=12 [slave pointer (2)]
> ⎜ ↳ Logitech USB Optical Mouse id=11 [slave pointer (2)]
> ⎣ Virtual core keyboard id=3 [master keyboard (2)]
> ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
> ↳ Ideapad extra buttons id=15 [slave keyboard (3)]
> ↳ Power Button id=6 [slave keyboard (3)]
> ↳ Integrated Camera: Integrated C id=10 [slave keyboard (3)]
> ↳ Video Bus id=7 [slave keyboard (3)]
> ↳ ITE Tech. Inc. ITE Device(8910) Consumer Control id=19 [slave keyboard (3)]
> ↳ Power Button id=9 [slave keyboard (3)]
> ↳ ITE Tech. Inc. ITE Device(8910) Wireless Radio Control id=13 [slave keyboard (3)]
> ↳ ITE Tech. Inc. ITE Device(8910) Keyboard i...

Read more...

Revision history for this message
Coiby Xu (coiby) wrote :

@Pedro Ribeiro (pedrib)

On Sun, Nov 22, 2020 at 07:48:27AM -0000, Pedro Ribeiro wrote:
>@Coiby Xu (coiby)
>
>I build the next branch of linux-gpio (which contains the patch you mentioned in #251), and the trackpad works just fine without the hid polling on the kernel command line.
>You can contact me if you'd like further testing, my email is pedrib_at_gmail_dot_com

Thank you for testing the patch! I'll put you in the Cc list next time.

Revision history for this message
Pedro Ribeiro (pedrib) wrote :

@Azizkhan (injkgz)

I don't think it is, I believe the for-next branch in linux-gpio will only be integrated in 5.11, but @Coiby Xu (coiby) should be able to confirm that.

Revision history for this message
Mike Boruta (maridius) wrote :

@Coiby Xu (coiby)

Yes, that summarizes my findings nicely.

Revision history for this message
Carlos Morales (carlosmorales777) wrote :

Hello,

I would like to report patches #217 and #189 both fix the touchpad MSFT0001:00 06CB:7F28 in a Lenovo Legion 5P-15ARH05H. Based on my preference for interrupts over polling, I will keep #189

Testing was done on Manjaro with kernel 5.9.8-2

Thanks for all the effort in this fix!

Revision history for this message
Pedro Ribeiro (pedrib) wrote :

Don't want to hijack this thread, but has anyone here with a Legion 5 (AMD version) has gotten the backlight working in Discrete graphics mode (only the nvidia GPU enabled)?

Revision history for this message
Coiby Xu (coiby) wrote :

@Azizkhan (injkgz)

On Mon, Nov 23, 2020 at 04:39:29PM -0000, Pedro Ribeiro wrote:
>@Azizkhan (injkgz)
>
>I don't think it is, I believe the for-next branch in linux-gpio will
>only be integrated in 5.11, but @Coiby Xu (coiby) should be able to
>confirm that.
>
It may also be backported to stable trees like 4.19, 5.4.

Revision history for this message
Coiby Xu (coiby) wrote :

@Mike Boruta

On Tue, Nov 24, 2020 at 02:37:34AM -0000, Mike Boruta wrote:
>@Coiby Xu (coiby)
>
>Yes, that summarizes my findings nicely.

That's a bit strange. It should work for at least 5.7 as well. If you
have time, you can show me the result of
"sudo cat /sys/kernel/debug/gpio|grep -A1 pin130" using older Linux after
applying the patch in #171.

Revision history for this message
Coiby Xu (coiby) wrote :

@Pedro Ribeiro

On Wed, Nov 25, 2020 at 10:23:25AM -0000, Pedro Ribeiro wrote:
>Don't want to hijack this thread, but has anyone here with a Legion 5
>(AMD version) has gotten the backlight working in Discrete graphics mode
>(only the nvidia GPU enabled)?

Have you tried installing the proprietary NVIDIA graphics card driver?

Revision history for this message
Paulinski (mail-izy) wrote :

@Pedro Ribeiro

Same problem. Couldn't manage it to make it work

Revision history for this message
Pedro Ribeiro (pedrib) wrote :

Again my apologies to everyone for hijacking this thread, But since people are asking, and I was able to solve the backlight problem after days of pain, here are the instructions. Two caveats though:

- you need to have the laptop in "Discrete" mode in the BIOS (in my experience, Hybrid mode gives little battery life advantage, even in Windows)
- the instructions below are for Debian, but the only different thing to have in mind is the /experimental release in the apt install command, which should be adapted to the Ubuntu release you want to install the drivers from

1. make sure that you remove all nvidia stuff:
apt --purge remove nvidia*
(this includes any nvidia configuration files in /etc/X11/xorg.conf.d)

2. install the proprietary nvidia driver version you want (replace experimental with the target release)
sudo apt install libegl-nvidia0/experimental libgl1-nvidia-glvnd-glx/experimental libglx-nvidia0/experimental libnvidia-eglcore/experimental libnvidia-glcore/experimental libnvidia-ml1/experimental nvidia-alternative/experimental nvidia-driver/experimental nvidia-driver-bin/experimental nvidia-driver-libs/experimental nvidia-egl-common/experimental nvidia-egl-icd/experimental nvidia-kernel-dkms/experimental nvidia-kernel-support/experimental nvidia-modprobe/experimental nvidia-vdpau-driver/experimental xserver-xorg-video-nvidia/experimental libgles-nvidia1/experimental libgles-nvidia2/experimental nvidia-vulkan-icd/experimental libnvidia-cfg1/experimental libcuda1/experimental libnvcuvid1/experimental libnvidia-encode1/experimental nvidia-opencl-icd/experimental nvidia-smi/experimental libnvidia-cbl/experimental libnvidia-rtcore/experimental nvidia-cuda-mps/experimental libnvidia-ptxjitcompiler1/experimental libnvidia-compiler/experimental libnvidia-glvkspirv/experimental nvidia-settings

3. create a file /etc/X11/xorg.conf.d/21-nvidia-brightness.conf with the following contents:
Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection

4. reboot and backlight control should be working!

Revision history for this message
Pedro Ribeiro (pedrib) wrote :

More details about the backlight control can be found in https://forums.developer.nvidia.com/t/legion-5-no-backlight-control-in-discrete-graphics-mode/160292/11

If you have any questions please create a topic in the nvidia forums or open a new bug!

/thread hijack off

Revision history for this message
Mike Boruta (maridius) wrote :

@Coiby Xu (coiby)

Hello Coiby, had some time today so I compiled 5.7.19 from ubuntu mainline (https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.7.19/) with pinctrl_amd configured as a module, applied the patch in #171, and ran the command you provided:

$ sudo cat /sys/kernel/debug/gpio | grep -A1 pin130
pin130 Level trigger| Active low| interrupt is enabled| interrupt is unmasked| disable wakeup in S0i3 state| disable wakeup in S3 state|
 disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| 0x51bc8

Please let me know if I can be of further help!

Revision history for this message
harry (harrylee342) wrote :

Hi all.

Please excuse my novice approach guys but I hope that I am making some kind of contribution!

I to have a Lenovo Legion 5 and I am running Opensuse Tumbleweed with Kernel 5.9.11-1 with Gnome 3.38.
With some help from the Opensuse forum I have the following error;

input: MSFT0001:00 04F3:3186 Touchpad as /devices/platform/AMDI0010:03/i2c-0/i2c-MSFT0001:00/0018:04F3:3186.0001/input/input7

This as you may gather stops my trackpad from working and they have suggested I visit here and ask for
any help!

All the best - Harry

Revision history for this message
Ethan Reker (abaga129) wrote :

After several painstaking hours I finally got it working on Manjaro, so I wanted to share my experience for anyone else that is new to patching the kernel like me. This is my first time ever doing so.

I tried and tried to make this work on Ubuntu Budgie 20.10 following the guide by @Baq Domalaq (baq) but I just couldnt get the ubuntu kernel to build. Manjaro on the other hand was fairly painless.

This only works for Manjaro

1. Clone the kernel repo for linux 5.8
# git clone https://gitlab.manjaro.org/packages/core/linux58.git

2. open the repo
# cd ./linux58

3. Download the patch from #179
# wget https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190/+attachment/5418465/+files/0303-pinctrl-amd2.patch

4. Edit the PKGBUILD file and add '0303-pinctrl-amd2.patch' after the line that has '0303-pinctrl-amd.patch'

5. Update the checksums
# updpkgsums

6. Build the package. This will take some time. You may be prompted for something about PREMPT. Choose CONFIG_PREEMPT_VOLUNTARY.
# makepkg -s

7. Once it's done, you can install the package.
# makepkg -i

In my case, this broke the nvidia driver so I ended up uninstalling the nonfree driver and using the free driver instead. This can be done with the following commands.

8. Remove nonfree driver. Could also be video-nvidia-455xx
# sudo mhwd -r pci video-nvidia-440xx

9. Install the free driver
# sudo mhwd -i pci video-linux

Also installing the free driver fixed the display brightness issue. Everything seems to be working for me now!

In case anyone runs into any issues, this is the guide I followed to build the kernel. https://leduccc.medium.com/compiling-a-custom-linux-kernel-on-manjaro-f09aa103713f

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Mike,

On Sun, Nov 29, 2020 at 08:07:43PM -0000, Mike Boruta wrote:
>@Coiby Xu (coiby)
>
>Hello Coiby, had some time today so I compiled 5.7.19 from ubuntu
>mainline (https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.7.19/) with
>pinctrl_amd configured as a module, applied the patch in #171, and ran
>the command you provided:
>
>$ sudo cat /sys/kernel/debug/gpio | grep -A1 pin130
>pin130 Level trigger| Active low| interrupt is enabled| interrupt is unmasked| disable wakeup in S0i3 state| disable wakeup in S3 state|
> disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| 0x51bc8
>
Obviously, the patch in #171 didn't take into effect because 0x51bc8 means
debounce filter is enabled and the debounce timeout is set to 124.8ms.
So my best guess is
/lib/modules/`uname -r`/kernel/drivers/pinctrl/pinctrl-amd.ko.xz
hasn't been replaced by the patched one.

>Please let me know if I can be of further help!

Revision history for this message
Reinis (reinisi) wrote :

Many thanks to @coiby for providing the #189 fix - works great on the latest Manjaro 5.9.11-3 with the MSFT0001:00 04F3:3140 touchpad on Lenovo Legion 5 15ARH. Just had to install linux59-headers beforehand.

Let me know if there is any way I can help with this issue.

Revision history for this message
Mike Boruta (maridius) wrote :

Hello Coiby,

Hmm, as far as I can tell the proper module is being used since I executed the same steps for both the 5.7.19 and 5.8 kernels. I also confirmed this by running `modinfo pinctrl_amd` and verifying that it is no longer signed. I understand what you are saying regarding 0x51bc8, maybe a different code path is being executed? Perhaps it would be best for someone to independently confirm this before digging in further; I have run through these steps a few times so I don't think I made a silly mistake but anything is possible.

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Mike,

On Sat, Dec 05, 2020 at 09:09:35PM -0000, Mike Boruta wrote:
>Hello Coiby,
>
>Hmm, as far as I can tell the proper module is being used since I
>executed the same steps for both the 5.7.19 and 5.8 kernels. I also
>confirmed this by running `modinfo pinctrl_amd` and verifying that it is
>no longer signed. I understand what you are saying regarding 0x51bc8,
>maybe a different code path is being executed? Perhaps it would be best
>for someone to independently confirm this before digging in further; I
>have run through these steps a few times so I don't think I made a silly
>mistake but anything is possible.

Could you insert some pr_alert code to verify the updated module has been loaded?

  pr_alert("amd_gpio reg_val=%x, pin=%lu (LEVEL_LOW)", pin_reg, d->hwirq);

You can also use the repo https://github.com/coiby/standalone_pinctrl_amd/tree/debug_for_Mike.

And after the system getting rebooted, paste the result of `journalctl -k|grep amd_gpio` here?

Revision history for this message
Logan (frank5151) wrote :

I can confirm Mike's result. However, I'm on Fedora 33 and kernel 5.8.15.

[root@lappy-the-laptop ~]# dmesg | grep -i amd_g
[root@lappy-the-laptop ~]# journalctl -k | grep -i amd_gpio
[root@lappy-the-laptop ~]# modinfo pinctrl-amd
filename: /lib/modules/5.8.15-301.fc33.x86_64/kernel/drivers/pinctrl/pinctrl-amd.ko.xz
description: AMD GPIO pinctrl driver
author: Ken Xue <email address hidden>, Jeff Wu <email address hidden>
license: GPL v2
alias: acpi*:AMDI0030:*
alias: acpi*:AMD0030:*
depends:
retpoline: Y
name: pinctrl_amd
vermagic: 5.8.15-301.fc33.x86_64 SMP mod_unload
[root@lappy-the-laptop ~]# uname -r
5.8.15-301.fc33.x86_64

The pinctrl module I'm using is from the github repo

Revision history for this message
Logan (frank5151) wrote :

The output Coiby requested
[root@lappy-the-laptop ~]# journalctl -k | grep -i amd_
Dec 05 15:55:13 lappy-the-laptop kernel: amd_uncore: AMD NB counters detected
Dec 05 15:55:13 lappy-the-laptop kernel: amd_uncore: AMD LLC counters detected
Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=500e8, pin=130 (before set_type)
Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=50388, pin=130 (LEVEL_LOW)
Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=503c8, pin=130 (before set_type)
Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=50388, pin=130 (LEVEL_LOW)

Revision history for this message
Mike Boruta (maridius) wrote :

Hello Coiby,

I built and installed the module as per the instructions in the branch you linked me to and `journalctl -k|grep amd_gpio` showed nothing. No new printouts in the kernel log. So I recompiled the module again with the pr_alert() statement you printed above and still nothing.

So, I recompiled the kernel from source once again but this time I made the source code changes before compiling the entire kernel (instead of then recompiling the kernel module and overwriting the current one). And this worked! Touchpad works just fine and I see the printouts as expected (0x50388 instead of 0x51bc8).

My understanding was that simply copying the module over to the old one in `/lib/modules/$(uname -r)/kernel/drivers/pinctrl/pinctrl-amd.ko` would suffice, but that does not seem to be the case, at least with this ubuntu-flavored kernel version. I am interested to know why, but I will probably look that up on my own. The important thing is that there shouldnt be any doubt regarding whether or not the fix works on 5.7 as well.

So once again thank you Coiby for your fix and for helping me to get to the bottom of this!

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Coiby Xu (coiby)

Patch #179 no longer works with kernel 5.10.1, because pinctrl-amd.c has already been patched with the current kernel version and GLITCH has been changed.
My touchpad MSFT0001: 00 04F3: 3140 still worked up to 5.10-rc7 with #179.

This is th new code for GLITCH:

-----------------------------------------------------
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
pin_reg = readl(gpio_dev->base + offset * 4);

if (debounce) {
  pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
  pin_reg &= ~DB_TMR_OUT_MASK;
-----------------------------------------------------

Do you have any idea what needs to be changed to make it work again?

Revision history for this message
Helmut Stult (helmut-stult) wrote :

/** pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF; */ did not work.

Revision history for this message
Helmut Stult (helmut-stult) wrote :
Revision history for this message
Giovanni Lena (unixlike) wrote :

@Helmut Stult (helmut-stult) I got it working both on Manjaro and Gentoo with kernel 5.10.1 downloaded from kernel.org with #189. On Gentoo I had to use Manjaro's running .config obtained with make localmodconfig while in chroot from manjaro.

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Mike,

On Sun, Dec 06, 2020 at 09:12:23PM -0000, Mike Boruta wrote:
>Hello Coiby,
>
>I built and installed the module as per the instructions in the branch
>you linked me to and `journalctl -k|grep amd_gpio` showed nothing. No
>new printouts in the kernel log. So I recompiled the module again with
>the pr_alert() statement you printed above and still nothing.
>
>So, I recompiled the kernel from source once again but this time I made
>the source code changes before compiling the entire kernel (instead of
>then recompiling the kernel module and overwriting the current one). And
>this worked! Touchpad works just fine and I see the printouts as
>expected (0x50388 instead of 0x51bc8).
>
>My understanding was that simply copying the module over to the old one
>in `/lib/modules/$(uname -r)/kernel/drivers/pinctrl/pinctrl-amd.ko`
>would suffice, but that does not seem to be the case, at least with this
>ubuntu-flavored kernel version. I am interested to know why, but I will
>probably look that up on my own. The important thing is that there
>shouldnt be any doubt regarding whether or not the fix works on 5.7 as
>well.
>
Since you could still access /sys/kernel/debug/gpio, it means the old
module must have been loaded. The path of the old module could be
/lib/modules/$(uname -r)/kernel/drivers/pinctrl/pinctrl-amd.ko.xz.

So when both old pinctrl-amd.ko.xz and new pinctrl-amd.ko exist, the old
module is loaded by the kernel.

>So once again thank you Coiby for your fix and for helping me to get to
>the bottom of this!
>

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Logan,

On Sun, Dec 6, 2020 at 12:05 PM Logan <email address hidden> wrote:
> The output Coiby requested
> [root@lappy-the-laptop ~]# journalctl -k | grep -i amd_
> Dec 05 15:55:13 lappy-the-laptop kernel: amd_uncore: AMD NB counters detected
> Dec 05 15:55:13 lappy-the-laptop kernel: amd_uncore: AMD LLC counters detected
> Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=500e8, pin=130 (before set_type)
> Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=50388, pin=130 (LEVEL_LOW)
> Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=503c8, pin=130 (before set_type)
> Dec 05 15:55:13 lappy-the-laptop kernel: amd_gpio reg_val=50388, pin=130 (LEVEL_LOW)
                                                     ^^^^^^^^^^^^^
50388 means the glitch filter has been disabled. So the patch has took
info effect. You touchpad should work now.

Revision history for this message
Coiby Xu (coiby) wrote :

Hi @Helmut Stult (helmut-stult)

On Wed, Dec 16, 2020 at 6:32 PM Helmut Stult <email address hidden>
wrote:

> The problem is your last patch
>
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/pinctrl
> /pinctrl-amd.c?h=v5.10&id=47a0001436352c9853d72bf2071e85b316d688a2
> <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/pinctrl/pinctrl-amd.c?h=v5.10&id=47a0001436352c9853d72bf2071e85b316d688a2>
>
There is nothing wrong with this patch. As written in the commit
message, this patch depends on commit 06abe8291bc31839950f7d0362d9979edc88a666
("pinctrl: amd: fix incorrect way to disable debounce filter") and
commit 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings")
to fix the touchpad. And the latter one hasn't been adopted by Linux
kernel v5.10.

Revision history for this message
Coiby Xu (coiby) wrote :

Hi all,

The latest kernel tree (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git) has the complete solution to fix this bug. So we can expect kernel v5.11 to fix this issue without any additional work. Before the release of v5.11, you are suggested to use #189 to save your touchpad.

The complete solution is three patches,
 - 47a0001436352c9853d72bf2071e85b316d688a2 ("pinctrl: amd: remove debounce filter setting in IRQ type setting")
 - 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter")
 - 8dcb7a15a585b6d0fee15751ce11d7a68cfedd56 ("gpiolib: acpi: Take into account debounce settings")

The first two patches has reached the stable tree. If the last one is also backported to LTS kernel, you won't need to install kernel 5.11. But I don't know when this will happen.

Thanks to all who have participated in the process of bug hunting, especially to @wangjun (biggerchina), @Mike Boruta (maridius), @Helmut Stult (helmut-stult) and @Baq Domalaq (baq). I spent about one month of my internship at the Linux Foundation on this bug. So I should also thanks to the Linux Foundation for funding this work.

Revision history for this message
Mike Boruta (maridius) wrote :

Wow, this is great news! Thank you again for your hard work, and to all who helped out :).

Revision history for this message
Baq Domalaq (baq) wrote :

@Coiby Xu (coiby) thanks a lot for your work! You really saved a lot of laptops on linux.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

8dcb7a15a585b6d0fee15751ce11d7a68cfedd56 ("gpiolib: acpi: Take into account debounce settings") is part of a series with 18 patches, so it's safer to only bakcport it for 5.10 kernels.

Revision history for this message
Logan (frank5151) wrote :

I can confirm my touchpad is working now on 5.9.15 using the patch from #189 and using 5.10.1 without any extra on Fedora 33

Revision history for this message
Nicolas Rogues (nrogues) wrote :

Thanks a lot @Coiby Xu (coiby), amazing work. Let's hope the third patch will be backported and 20.04.x LTS will work our the box after this.

Revision history for this message
Azizkhan (injkgz) wrote :

I have installed 5.10.0 kernel which contains fix, but touchpad isn't working.

Revision history for this message
Robin Windey (r0wi) wrote :

I'm on Ubuntu 20.04 with kernel 5.10.1 (https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.10.1/) and the touchpad is working on my Lenovo Legion 5. Thanks for that guys :-)

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Robin Windey (r0wi), Hey, did you did something more like adding kernel parameters or something, or just upgrade kernel is enough?

Revision history for this message
Robin Windey (r0wi) wrote :

@Piotr Tomaszewski (nfm886) i just installed headers (all), image (generic) and modules (generic) from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.10.1/amd64/ via 'dpkg -i *.deb', rebooted with new kernel 5.10.1 and everything worked. So no special config or parameter tweaking was necessary for me.

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Robin Windey (r0wi), I will try it. Thanks for the info

Revision history for this message
Azizkhan (injkgz) wrote :

Robin Windey (r0wi), I tried to do this via ur instructions and via Mainline utility, but my touchpad isn't working...

Revision history for this message
albertoiNET (albertoinet) wrote :

On Ubuntu 20.10 I installed with kernel 5.10.1 with your instructions @Robin Windey (r0wi) and neither works touchpad

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Robin Windey (r0wi), unfortunately it does not works with my touchpad. Tried kernel you linked on PopOS 20.10 and Ubuntu 20.04.1. Both results are same, touchpad not works. What is yours touchpad?

Revision history for this message
Robin Windey (r0wi) wrote :

Could you try to boot in recovery mode and then resume the normal boot process? I think i have the MSFT0001:00 06CB:7F28 touchpad installed but i'll check these days.

Revision history for this message
wangjun (biggerchina) wrote :
Download full text (15.1 KiB)

on fedora 33,with kernel 5.10.2 , i use this patch ,then touchpad work!

diff -Narup a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
--- a/drivers/gpio/gpiolib-acpi.c 2020-12-14 06:41:30.000000000 +0800
+++ b/drivers/gpio/gpiolib-acpi.c 2020-12-22 14:31:53.078877803 +0800
@@ -205,6 +205,68 @@ static void acpi_gpiochip_request_irqs(s
   acpi_gpiochip_request_irq(acpi_gpio, event);
 }

+static enum gpiod_flags
+acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
+{
+ /* GpioInt() implies input configuration */
+ if (agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT)
+ return GPIOD_IN;
+
+ switch (agpio->io_restriction) {
+ case ACPI_IO_RESTRICT_INPUT:
+ return GPIOD_IN;
+ case ACPI_IO_RESTRICT_OUTPUT:
+ /*
+ * ACPI GPIO resources don't contain an initial value for the
+ * GPIO. Therefore we deduce that value from the pull field
+ * and the polarity instead. If the pin is pulled up we assume
+ * default to be high, if it is pulled down we assume default
+ * to be low, otherwise we leave pin untouched. For active low
+ * polarity values will be switched. See also
+ * Documentation/firmware-guide/acpi/gpio-properties.rst.
+ */
+ switch (agpio->pin_config) {
+ case ACPI_PIN_CONFIG_PULLUP:
+ return polarity == GPIO_ACTIVE_LOW ? GPIOD_OUT_LOW : GPIOD_OUT_HIGH;
+ case ACPI_PIN_CONFIG_PULLDOWN:
+ return polarity == GPIO_ACTIVE_LOW ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ /*
+ * Assume that the BIOS has configured the direction and pull
+ * accordingly.
+ */
+ return GPIOD_ASIS;
+}
+
+static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
+ struct acpi_resource_gpio *agpio,
+ unsigned int index,
+ const char *label)
+{
+ int polarity = GPIO_ACTIVE_HIGH;
+ enum gpiod_flags flags = acpi_gpio_to_gpiod_flags(agpio, polarity);
+ unsigned int pin = agpio->pin_table[index];
+ struct gpio_desc *desc;
+ int ret;
+
+ desc = gpiochip_request_own_desc(chip, pin, label, polarity, flags);
+ if (IS_ERR(desc))
+ return desc;
+
+ ret = gpio_set_debounce_timeout(desc, agpio->debounce_timeout);
+ if (ret)
+ gpiochip_free_own_desc(desc);
+
+ return ret ? ERR_PTR(ret) : desc;
+}
+
 static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)
 {
  const char *controller, *pin_str;
@@ -290,8 +352,8 @@ static acpi_status acpi_gpiochip_alloc_e
  if (!handler)
   return AE_OK;

- desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event",
- GPIO_ACTIVE_HIGH, GPIOD_IN);
+ desc = acpi_request_own_gpiod(chip, agpio, 0, "ACPI:Event");
+
  if (IS_ERR(desc)) {
   dev_err(chip->parent,
    "Failed to request GPIO for pin 0x%04X, err %ld\n",
@@ -526,39 +588,6 @@ static bool acpi_get_driver_gpio_data(st
  return false;
 }

-static enum gpiod_flags
-acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio)
-{
- switch (agpio->io_restriction) {
- case ACPI_IO_RESTRICT_INPUT:
- return GPIOD_IN;
- case ACPI_IO_RESTRICT_OUTPUT:
- /*
- * ACPI GPIO resources don't contain an initial value for the
- * GPIO. Therefore we deduce that value from the pull field
- * instead. If the pin is pulled up...

Revision history for this message
wangjun (biggerchina) wrote :

all the changes are extract from the master branch of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git .

Revision history for this message
Robin Windey (r0wi) wrote :

@Piotr Tomaszewski (nfm886) can confirm my touchpad is the MSFT0001:00 06CB:7F28. I booted kernel 5.10.1 into recovery and then resumed regular boot and my touchpad works.

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Robin Windey (r0wi), I booted intro recovery mode to the root prompt then systemctl reboot. Nothing changed. Touhchpad still does not works.
My touchpad is: MSFT0001:00 04F3:3140

Revision history for this message
Robin Windey (r0wi) wrote :

@Piotr Tomaszewski (nfm886) according to #109 it seems like you have the "Elan" touchpad (mine is the "Synaptic" one) so it might behave a little different?

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

@Robin Windey (r0wi), maybe. I hope kernel 5.11 will make Elan's touchpad to work.

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Piotr Tomaszewski

If you use Manjaro Linux, this link should help you ;-)

https://drive.google.com/drive/folders/1f_gSUdyGZIONSbawBG4h9ED11CO0musP

Otherwise look here (are the two patches and the PKGBUILD)

https://drive.google.com/drive/folders/1chjkq-z-qaCd--ALi2ZGAE7EZW0SA8QH

Helmut (schinfo)

manjaro - ENJOY THE SIMPLICITY

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Thanks @Helmut Stult (helmut-stult), kernel from first link works as it should :)

Revision history for this message
koen (kmaris) wrote :

Installed ubuntu 20.10 on ARH05, the gpio workaround makes the mouse work.
Left click and right click button works

Revision history for this message
koen (kmaris) wrote :

Ubuntu 20.10 with kernel :
Linux legion5 5.9.16-050916-generic #202012211331 SMP Mon Dec 21 14:11:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Touchpad works without any work around

Revision history for this message
Daniel Campos (Avanzosc) (dani-ds) wrote :

Someone knows when the patch will be merged in the main repo?
I am using Kubuntu 20.04 LTS with 5.4.0-58-generic kernel and the touchpad is not working and I don't want to start changing the kernel "manually"

Revision history for this message
Stéphane Roussel (stephane-roussel) wrote :

Touchpad works on 20.10 and kernel 5.10.2 only after doing that on each start :

cd /sys/class/gpio/
echo 386 > export
gpio]# cd gpio386
echo out > direction

uname -a : Linux Legion 5.10.2-051002-generic #202012210832 SMP Mon Dec 21 13:52:42 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
boudicca (shazh) wrote :

#322 confirmed works as sudo or root

cd /sys/class/gpio/
echo 386 > export
cd gpio386
echo out > direction

Revision history for this message
boudicca (shazh) wrote :

ignore sudo in #323 echo 386 > export only as root

Coiby Xu (coiby)
description: updated
Revision history for this message
koen (kmaris) wrote :

Touchpad works without workaround on
Ubuntu 20.04 with Kernel 5.9.16
Same goes for ubuntu 20.10.
Easiest way is to use the workaround, install mainline(alternative for ukuu) install kernel 5.9.16
Reboot and relax

Revision history for this message
Robin Windey (r0wi) wrote :

Had access to another Ideapad with touchpad MSFT0001:00 04F3:3140 installed. Kernel 5.10.2-051002-generic #202012210832 did not work out of the box but in combination with #322 it worked so i can confirm, too.

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Kai-Heng Feng,

On Sun, Dec 20, 2020 at 07:30:12AM -0000, Kai-Heng Feng wrote:
>8dcb7a15a585b6d0fee15751ce11d7a68cfedd56 ("gpiolib: acpi: Take into
>account debounce settings") is part of a series with 18 patches, so it's
>safer to only bakcport it for 5.10 kernels.

Although it's part of a patch set, it's rather an independent patch
because it's filling a missing implementation of the ACPI specs. I guess
Windows have already implemented it and that's why the touchpad works
for Windows.

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Robin Windey (r0wi) and Stéphane Roussel (stephane-roussel),

On Fri, Dec 25, 2020 at 08:52:35PM -0000, Robin Windey wrote:
>Had access to another Ideapad with touchpad MSFT0001:00 04F3:3140
>installed. Kernel 5.10.2-051002-generic #202012210832 did not work out
>of the box but in combination with #322 it worked so i can confirm, too.

We shouldn't use #322 because it's equivalent of keeping polling the
touchpad.

Revision history for this message
koen (kmaris) wrote :

@robin Windey

I had no luck with kernel 5.10.2, try 5.9.16

Revision history for this message
wangjun (biggerchina) wrote :

@koen (kmaris) , with kernel 5.10.2 ,you can try #311

Revision history for this message
wangjun (biggerchina) wrote :

and #311 also work with kernel 5.10.3

Changed in linux (Ubuntu):
assignee: nobody → Phan Thanh Long (phanlong2811)
Revision history for this message
Robin Windey (r0wi) wrote :

@wangjun (biggerchina) i can confirm that #311 is working without any workarounds when applied on 5.10.3 with touchpad MSFT0001:00 04F3:3140 and Ubuntu 20.04, thanks!

If anyone on a Debian based system is interested: i've uploaded the patched version as .deb-packages here https://drive.google.com/drive/folders/1ICZmuBx3ecwxtwufhSHbYmfnv9Prw-kc?usp=sharing

@Coiby Xu (coiby) Phan Thanh Long (phanlong2811) any chance to get #311 backported to 5.10?

Revision history for this message
Ethan Reker (abaga129) wrote :

I can also confirm #322 works on manjaro after installing Linux 5.10.rc5.d1122 through the "Manjaro Settings Manager". Thanks!

Revision history for this message
wangjun (biggerchina) wrote :
Revision history for this message
wangjun (biggerchina) wrote :
Download full text (14.7 KiB)

with kernel 5.10.4 , this patch work on fedora 33.

diff -Narup a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
--- a/drivers/gpio/gpiolib-acpi.c 2020-12-14 06:41:30.000000000 +0800
+++ b/drivers/gpio/gpiolib-acpi.c 2020-12-22 14:31:53.078877000 +0800
@@ -205,6 +205,68 @@ static void acpi_gpiochip_request_irqs(s
   acpi_gpiochip_request_irq(acpi_gpio, event);
 }

+static enum gpiod_flags
+acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
+{
+ /* GpioInt() implies input configuration */
+ if (agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT)
+ return GPIOD_IN;
+
+ switch (agpio->io_restriction) {
+ case ACPI_IO_RESTRICT_INPUT:
+ return GPIOD_IN;
+ case ACPI_IO_RESTRICT_OUTPUT:
+ /*
+ * ACPI GPIO resources don't contain an initial value for the
+ * GPIO. Therefore we deduce that value from the pull field
+ * and the polarity instead. If the pin is pulled up we assume
+ * default to be high, if it is pulled down we assume default
+ * to be low, otherwise we leave pin untouched. For active low
+ * polarity values will be switched. See also
+ * Documentation/firmware-guide/acpi/gpio-properties.rst.
+ */
+ switch (agpio->pin_config) {
+ case ACPI_PIN_CONFIG_PULLUP:
+ return polarity == GPIO_ACTIVE_LOW ? GPIOD_OUT_LOW : GPIOD_OUT_HIGH;
+ case ACPI_PIN_CONFIG_PULLDOWN:
+ return polarity == GPIO_ACTIVE_LOW ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ /*
+ * Assume that the BIOS has configured the direction and pull
+ * accordingly.
+ */
+ return GPIOD_ASIS;
+}
+
+static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
+ struct acpi_resource_gpio *agpio,
+ unsigned int index,
+ const char *label)
+{
+ int polarity = GPIO_ACTIVE_HIGH;
+ enum gpiod_flags flags = acpi_gpio_to_gpiod_flags(agpio, polarity);
+ unsigned int pin = agpio->pin_table[index];
+ struct gpio_desc *desc;
+ int ret;
+
+ desc = gpiochip_request_own_desc(chip, pin, label, polarity, flags);
+ if (IS_ERR(desc))
+ return desc;
+
+ ret = gpio_set_debounce_timeout(desc, agpio->debounce_timeout);
+ if (ret)
+ gpiochip_free_own_desc(desc);
+
+ return ret ? ERR_PTR(ret) : desc;
+}
+
 static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)
 {
  const char *controller, *pin_str;
@@ -290,8 +352,8 @@ static acpi_status acpi_gpiochip_alloc_e
  if (!handler)
   return AE_OK;

- desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event",
- GPIO_ACTIVE_HIGH, GPIOD_IN);
+ desc = acpi_request_own_gpiod(chip, agpio, 0, "ACPI:Event");
+
  if (IS_ERR(desc)) {
   dev_err(chip->parent,
    "Failed to request GPIO for pin 0x%04X, err %ld\n",
@@ -526,39 +588,6 @@ static bool acpi_get_driver_gpio_data(st
  return false;
 }

-static enum gpiod_flags
-acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio)
-{
- switch (agpio->io_restriction) {
- case ACPI_IO_RESTRICT_INPUT:
- return GPIOD_IN;
- case ACPI_IO_RESTRICT_OUTPUT:
- /*
- * ACPI GPIO resources don't contain an initial value for the
- * GPIO. Therefore we deduce that value from the pull field
- * instead. If the pin is pulled up we assume default to ...

Revision history for this message
王紫晸 (liliadamth) wrote :

As a rookie, I just want to know how to use it. I just came into contact with Linux and installed ubuntu20.04.1 (20.04.1 with core 5.10.3) on my r7000. Thanks.

Revision history for this message
Robin Windey (r0wi) wrote :

If you like you can dowload the patched 5.10.3 kernel from the link i posted in #332. Just download the two files and install them via dpkg -i *.deb

Revision history for this message
Gerald Bachner (geri1403) wrote :

Tested kernel 5.11.rc1 on Manjaro. Touchpad MSFT0001:00 04F3:3140 works out of the box.
Thanks!

Revision history for this message
王紫晸 (liliadamth) wrote :

@Robin Windey (r0wi)
Thank you very much, it does work. I tried it just now. However, it only works under Nvidia mode (with brightness problems). If I use AMD Graphics mode, it brings a black screen.

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Ubuntu with kernel 5.11-rc2 from mainline - touchpad MSFT0001:00 04F3:3140 Touchpad - works out of the box. There is only problem with nvidia drivers...

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Mike Boruta (maridius),

> On Sun, Nov 29, 2020 at 08:07:43PM -0000, Mike Boruta wrote:
> >@Coiby Xu (coiby)
> >
> >Hello Coiby, had some time today so I compiled 5.7.19 from ubuntu
> >mainline (https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.7.19/) with
> >pinctrl_amd configured as a module, applied the patch in #171, and ran
> >the command you provided:
> >
> >$ sudo cat /sys/kernel/debug/gpio | grep -A1 pin130
> >pin130 Level trigger| Active low| interrupt is enabled| interrupt is unmasked| disable wakeup in S0i3 state| disable wakeup in S3 state|
> > disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| 0x51bc8
> >
> Obviously, the patch in #171 didn't take into effect because 0x51bc8 means
> debounce filter is enabled and the debounce timeout is set to 124.8ms.
> So my best guess is
> /lib/modules/`uname -r`/kernel/drivers/pinctrl/pinctrl-amd.ko.xz
> hasn't been replaced by the patched one.

I had the same issue when using Fedora and find out it's caused by the pinctrl-amd driver being stored into the initramfs. Maybe the same thing happened to ubuntu. You can try re-building the initramfs by running `sudo update-initramfs -u' after replacing the old module with the new one.

Coiby Xu (coiby)
description: updated
Revision history for this message
Eamon O Callaghan (eamonoc) wrote :

Thank you everyone for fixing this, I've been following this thread for the last few weeks and today is the first time I've managed to get it working.

For any noobs like me that are on Ubuntu this is the guide that I followed to upgrade to kernel 5.11 and everything works perfectly for me, both the touchpad and the brightness controls.

Upgrade kernel

    Change current directory to /tmp
    cd /tmp

    Download the latest mainline kernel from 5.11.x branch by copying and pasting this:

    wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11-rc2/amd64/linux-headers-5.11.0-051100rc2_5.11.0-051100rc2.202101032030_all.deb
    wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11-rc2/amd64/linux-headers-5.11.0-051100rc2-generic_5.11.0-051100rc2.202101032030_amd64.deb
    wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11-rc2/amd64/linux-image-unsigned-5.11.0-051100rc2-generic_5.11.0-051100rc2.202101032030_amd64.deb
    wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11-rc2/amd64/linux-modules-5.11.0-051100rc2-generic_5.11.0-051100rc2.202101032030_amd64.deb

Install new kernel
sudo dpkg -i *.deb

Reboot the system
sudo shutdown -r now

    Update packages list
    sudo apt-get update

    Upgrade packages
    sudo apt-get upgrade

    Reboot the system if needed
    sudo shutdown -r now

    Check the OS distro
    lsb_release -a

    Check kernel version
    uname -r

That's it, now you should be running on the Linux Kernel 5.11rc2

Guide taken from this wonderful page:
https://sypalo.com/how-to-upgrade-ubuntu

Thanks to everyone for their hard work, sorry for posting this noob guide here but it took me weeks to figure out an easy way to do it (patching was beyond my abilities).

Revision history for this message
Mike Boruta (maridius) wrote :

Hello Coiby Xu (coiby), thanks a lot for this information! Will definitely try this should I encounter a similar error again; and its just generally good knowledge. Completely forgot about the initramfs.

Revision history for this message
Von (straeker) wrote :

MSFT0001:00 06CB:7F28 Touchpad works with kernel but it's very difficult to do a middle click using the default hid-i2c driver. middle click and right click works better with i2c-hid_standalone.

Revision history for this message
Von (straeker) wrote :

*kernel above 5.9

Revision history for this message
Joe Zhou (joezhouchenye) wrote :

Lenovo R7000P Laptop. Sadly, still not a good solution. The touch pad now works with kernel 5.11.0, but it has problem with Nvidia GPU and the brightness control is not working. I can have Nvidia GPU working and manually do some fixes to enable brightness control with 5.8.0, though touch pad is not working.

Revision history for this message
Adam Felson (adam-ubuntu) wrote :

Before I grab'n'build 5.11, I'd like to know if my issue is similar.
I have a lenovo ideapad 730s.
The touchpad works fine for pointing, single, double and triple clicks.
I have tried both the synaptics and libinput drivers. It's been a while since I was comparing them; IIRC, I'm currently running the synaptics driver as libinput didn't have scrolling/coasting working.

My problem is that palm detection and pressure sensitivity do not work. This makes the laptop pretty much unusable as it is almost impossible to do any text entry without the insertion point jumping to wherever the pointer was left.

Might the 5.11 kernel fix it?

Revision history for this message
Adam Felson (adam-ubuntu) wrote :

with lenovo ideapad 730s, wrist and pressure detection still don't work under 5.11.
with libinput, scroll coasting doesn't work.
I am current back to using synaptics. using synclient to turn PalmDetect on has no effect.

Revision history for this message
Coiby Xu (coiby) wrote :

On Thu, Jan 21, 2021 at 01:05:48PM -0000, Joe Zhou wrote:
>Lenovo R7000P Laptop. Sadly, still not a good solution. The touch pad
>now works with kernel 5.11.0, but it has problem with Nvidia GPU and the
>brightness control is not working. I can have Nvidia GPU working and
>manually do some fixes to enable brightness control with 5.8.0, though
>touch pad is not working.

Newer kernels must have caused regression about brightness control.

You can follow the bug description and #189 to fix the touchpad with 5.8.0,
then you can have both Nvidia GPU and touchpad working.

Revision history for this message
Coiby Xu (coiby) wrote :

On Mon, Jan 25, 2021 at 07:03:55PM -0000, Adam Felson wrote:
>Before I grab'n'build 5.11, I'd like to know if my issue is similar.
>I have a lenovo ideapad 730s.
>The touchpad works fine for pointing, single, double and triple clicks.
>I have tried both the synaptics and libinput drivers. It's been a while since I was comparing them; IIRC, I'm currently running the synaptics driver as libinput didn't have scrolling/coasting working.
>
>My problem is that palm detection and pressure sensitivity do not work.
>This makes the laptop pretty much unusable as it is almost impossible to
>do any text entry without the insertion point jumping to wherever the
>pointer was left.
>
>Might the 5.11 kernel fix it?

Your issue sounds different to this one. But you needn't to build the
kernel to see if the solution here works for you. You can try #189. If
it works for you, then 5.11 could also fix your issue. You may also want
to give https://github.com/coiby/standalone_i2c_hid a try.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-xenial' to 'verification-done-xenial'. If the problem still exists, change the tag 'verification-needed-xenial' to 'verification-failed-xenial'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-xenial
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
tags: added: verification-needed-groovy
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-groovy' to 'verification-done-groovy'. If the problem still exists, change the tag 'verification-needed-groovy' to 'verification-failed-groovy'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

Revision history for this message
Nicolas Rogues (nrogues) wrote :

Following the bot's message, I do not see a new kernel in -proposed ? (with 5.8.0-41-generic rightg now). Is this a bot bug, or is there a newer 5.8 kernel with all patches applied ?

Regarding brightness control, as mentioned early in the thread by Helmut, we also had the issue on this model. No version from 5.4 to 5.8 allowed it to work in discrete GPU mode.

Now things have a little changed since yesterday's update of NVIDIA runtimepm (bug 1895855) solving PRIME support issue, now I can boot in hybrid mode and enjoy brightness control when using the iGPU
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1895855

Revision history for this message
Chelsea Sidrane (chelc) wrote :

Thanks all for this thread!

I have the legion 5 with a MSFT0001:00 04F3:3186 Touchpad
graphics: 0NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] (rev a1)

I got this error message when trying to do what Eamon (342) said (upgrade the kernel), as I too am new to kernel patching:
ERROR (dkms apport): kernel package linux-headers-5.11.0-051100rc2-generic is not supported
Error! Bad return status for module build on kernel: 5.11.0-051100rc2-generic (x86_64)

It said to consult this log:
/var/lib/dkms/nvidia/460.32.03/build/make.log

which is attached.

It seems like maybe this isn't compatible with my nvidia graphics card (1660) for some reason?
Has anyone else has this problem?

So instead I tried to solve my touchpad issues by upgrading to 5.9.16 like Koen said in 325, but my it did not fix things :/

If there are no other "quick fixes" I supposed I will embark on the journey of applying #189. But just wondering -- will #189 work with the kernel I just installed: 5.9.16 or would I have to install 5.9.0-rc7-MANJARO+ ?

Revision history for this message
Chelsea Sidrane (chelc) wrote :

Oh, I understand Nicolas' message now: maybe there is a patched 5.8 kernel I can just install?

tags: added: verification-failed-groovy
removed: verification-needed-groovy
Revision history for this message
Marton Danko (golddragon007) wrote :

I've checked and it's true that working, but not fully. The secondary mouse click doesn't work if I press the right bottom corner of the touchpad (registers primary mouse click).
Rotation, pitching, swipe with 3/4 fingers doesn't seem to work either.

Revision history for this message
Marton Danko (golddragon007) wrote :

Tested on kernel 5.11.0-rc6.

Revision history for this message
Coiby Xu (coiby) wrote :

HI Nicolas,

On Fri, Jan 29, 2021 at 12:07:30PM -0000, Nicolas Rogues wrote:
>Following the bot's message, I do not see a new kernel in -proposed ?
>(with 5.8.0-41-generic rightg now). Is this a bot bug, or is there a
>newer 5.8 kernel with all patches applied ?
>
>Regarding brightness control, as mentioned early in the thread by
>Helmut, we also had the issue on this model. No version from 5.4 to 5.8
>allowed it to work in discrete GPU mode.
>
>Now things have a little changed since yesterday's update of NVIDIA runtimepm (bug 1895855) solving PRIME support issue, now I can boot in hybrid mode and enjoy brightness control when using the iGPU
>https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1895855
>

In hybrid mode, does external monitor work for you?

Revision history for this message
Paras (savnani5) wrote :

Hey everyone, I am also facing this issue, but i am unable to make the touchpad work using the patch in #217 with #211's procedure. I can see some people were able to solve the issue without the patch using Ubuntu 20.04 and kernel 5.10/5.11. I work with ROS and as there is no official support for ROS on Ubuntu 20.04, can anyone please confirm if I can solve this on Ubuntu 18.04 by updating the kernel to 5.10/5.11 version(currently i have 5.4.0-65-generic). Thank You.

Revision history for this message
Baq Domalaq (baq) wrote :

Hi Coiby Xu,

your two pinctrl patches arrived at Pop OS kernel 5.8. But I had to revert them cause without 3rd patch (gpio) they don't help with touchpad. And 3rd patch gives an error during kernel build, so it can't be applied.

Just FYI.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Armin Avdić (ru-fo) wrote :
Download full text (3.4 KiB)

Hi, I want to test kernel in proposed but have no clue what to install, now I'm on
armin@armin-Legion-5:~$ uname -r
5.8.0-41-generic
and when I list available kernels in proposed dont know what to try from this
apt list linux-*image-* | grep proposed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-image-5.10.0-1014-oem/focal-proposed 5.10.0-1014.15 amd64
linux-image-5.4.0-1009-gkeop/focal-updates,focal-security,focal-proposed 5.4.0-1009.10 amd64
linux-image-5.4.0-1035-gcp/focal-proposed 5.4.0-1035.38 amd64
linux-image-5.4.0-1036-aws/focal-proposed 5.4.0-1036.38 amd64
linux-image-5.4.0-1036-gke/focal-proposed 5.4.0-1036.38 amd64
linux-image-5.4.0-1036-oracle/focal-proposed 5.4.0-1036.39 amd64
linux-image-5.4.0-1037-azure/focal-proposed 5.4.0-1037.39 amd64
linux-image-5.4.0-1038-azure/focal-proposed 5.4.0-1038.40 amd64
linux-image-5.4.0-66-generic/focal-proposed 5.4.0-66.74 amd64
linux-image-5.4.0-66-lowlatency/focal-proposed 5.4.0-66.74 amd64
linux-image-5.6.0-1046-oem/focal-proposed 5.6.0-1046.50 amd64
linux-image-5.6.0-1047-oem/focal-proposed 5.6.0-1047.51 amd64
linux-image-5.8.0-41-generic/focal-updates,focal-security,focal-proposed,now 5.8.0-41.46~20.04.1 amd64 [instalirano, automatski]
linux-image-5.8.0-41-lowlatency/focal-updates,focal-security,focal-proposed 5.8.0-41.46~20.04.1 amd64
linux-image-extra-virtual-hwe-20.04-edge/focal-updates,focal-security,focal-proposed 5.8.0.41.46~20.04.27 amd64
linux-image-extra-virtual-hwe-20.04/focal-updates,focal-security,focal-proposed 5.8.0.41.46~20.04.27 amd64
linux-image-generic-hwe-20.04-edge/focal-updates,focal-security,focal-proposed 5.8.0.41.46~20.04.27 amd64
linux-image-generic-hwe-20.04/focal-updates,focal-security,focal-proposed,now 5.8.0.41.46~20.04.27 amd64 [instalirano, automatski]
linux-image-gkeop-5.4/focal-updates,focal-security,focal-proposed 5.4.0.1009.12 amd64
linux-image-gkeop/focal-updates,focal-security,focal-proposed 5.4.0.1009.12 amd64
linux-image-lowlatency-hwe-20.04-edge/focal-updates,focal-security,focal-proposed 5.8.0.41.46~20.04.27 amd64
linux-image-lowlatency-hwe-20.04/focal-updates,focal-security,focal-proposed 5.8.0.41.46~20.04.27 amd64
linux-image-unsigned-5.10.0-1014-oem/focal-proposed 5.10.0-1014.15 amd64
linux-image-unsigned-5.4.0-1009-gkeop/focal-updates,focal-security,focal-proposed 5.4.0-1009.10 amd64
linux-image-unsigned-5.4.0-1035-gcp/focal-proposed 5.4.0-1035.38 amd64
linux-image-unsigned-5.4.0-1036-gke/focal-proposed 5.4.0-1036.38 amd64
linux-image-unsigned-5.4.0-1036-oracle/focal-proposed 5.4.0-1036.39 amd64
linux-image-unsigned-5.4.0-1037-azure/focal-proposed 5.4.0-1037.39 amd64
linux-image-unsigned-5.4.0-1038-azure/focal-proposed 5.4.0-1038.40 amd64
linux-image-unsigned-5.4.0-66-generic/focal-proposed 5.4.0-66.74 amd64
linux-image-unsigned-5.4.0-66-lowlatency/focal-proposed 5.4.0-66.74 amd64
linux-image-unsigned-5.6.0-1046-oem/focal-proposed 5.6.0-1046.50 amd64
linux-image-unsigned-5.6.0-1047-oem/focal-proposed 5.6.0-1047.51 amd64
linux-image-unsigned-5.8.0-41-generic/focal-updates,focal-security,focal-proposed 5.8.0-41.46~20.04.1 amd64
linux-image-unsigned-5.8.0-41-lowlatency/focal-updates,focal-security,focal-pro...

Read more...

Revision history for this message
Armin Avdić (ru-fo) wrote :

Is this linux-image-5.8.0-41-generic/focal-updates,focal-security,focal-proposed,now 5.8.0-41.46~20.04.1 amd64 [instalirano, automatski] kernel from focal-proposed the same as I'm runing now or it includes proposed fixes/changes?
I'm new to this stuf so everything raises 100 question marks above my head.

thx

Revision history for this message
Marton Danko (golddragon007) wrote :

From the command line, I don't know how to do it, I use usually the Mainline Kernel updater's one fork like https://github.com/bkw777/mainline (see installation guide there).

You can check the name of the kernels i.e. here: https://en.wikipedia.org/wiki/Ubuntu_version_history

groovy - 20.10
bionic - 18.04
focal - 20.04
xenial - 16.04

then you install the latest RC version from it, make sure it starts with the same numbers.
After a restart, the newest version will run.
To see RC you need to go to the Settings and enable prerelease or proposed versions or uncheck Hide unstable RC versions, I don't know the exact name of it.

Check #357 when you testing, probably you will face with the same issue, that the right physical click doesn't work as it should be (and some gestures). If that's that case then the test failed, if it works everything properly, then success.

How to run the older kernel, that's I don't know, you need to check with google.

Also, if you can't search for an issue in google, I suggest to not even try to test it, because RC releases can screw up anything and you may be stuck with a buggy machine that you need to reinstall. Do it on your own risk.

I also suggest doing a snapshot with timeshift from your system before you start the process, in case of problem you will be able to restore hopefully to that point your system. (pls google it how to do it)

Revision history for this message
Marton Danko (golddragon007) wrote :

Note, you have only grub if you have legacy installation, if you installed with UEFI, you have something else and you need to look for that a guide!

Revision history for this message
Armin Avdić (ru-fo) wrote :

I think it's not what I want to do, mainline and proposed kernels are not the same thing (I think).
I would like to install fix to the same kernel version that I'm runing or anything else to avoid problems with nvidia driver on mainline kernel releses. I already reinstalled everything 3 times tampering with this bug and would love not to do it again because I've setup a lot of stuf and dont want to do it again. For now I'm using i2c_standalone workaround but it's not running flawlessly (frequently stucks in scrolling mode or taps stops working...) so I want to test proposed solution.

Revision history for this message
Armin Avdić (ru-fo) wrote :

I'm on dual-boot uefi and it's booting with grub?

Changed in linux (Ubuntu):
assignee: Phan Thanh Long (phanlong2811) → nobody
Revision history for this message
Nicolas Rogues (nrogues) wrote :

Hi Coiby

To answer your question in message #359
> In hybrid mode, does external monitor work for you?

The answer is yes, it works. I tested the hotplug of an HDMI external monitor, it was detected by Ubuntu 20.04 and worked by default as an extended desktop (both internal & external display used, not cloned).

Revision history for this message
albertoiNET (albertoinet) wrote :

Tested 5.11.0-051100rc7-generic and it works

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Marton Danko (golddragon007) wrote :

@albertoiNet on that version, if you press the right bottom corner of the touchpad does it do a primary or a secondary click? (it should do a secondary bringing up the context menu). Also, did you tried 3/4 finger gestures by any app? Because that also didn't work for me on another version.

Revision history for this message
albertoiNET (albertoinet) wrote :

@Maton Danko pressing down on right is a secondary click. About multitouch I don't know any multigestures touch app. I'll try to find any app.

Revision history for this message
alex (agolks) wrote :

i'm on focal with 5.4.0-66-generic, it seems touch is in kernel now, but not work very good.
have installed the gnome-tweaks and enabled mouse emulation "finger".
sometimes two clicks for right mouse action work, sometimes not.
very few times the 3 finger middle mouse action work, even.
haven't identified when and how to reproduce.

too old kernel?

Revision history for this message
alex (agolks) wrote :

have update to 5.8.18-050818-generic, used the i2c-hid_standalone module.
this seems to work ok, will let you know if still issues with behaviour.

Revision history for this message
roselove (roselove) wrote :

Hi, I think I personally tried everything from bbs.archlinux.org, forum.manjaro.org, reddit, https://github.com/coiby/standalone_i2c_hid, bugzilla, bugs.launchpad.net, etc...

I tried Coiby solution this very day (2021-02-14).

Nothing ever worked since I updated to 9.7 kernel (coiby solution was nice before that ^^)

Here is my lenovo model : https://psref.lenovo.com/Detail/Legion/Lenovo_Legion_5_15ARH05?M=82B50015FR

Here is my touchpad model :
```
Input device ID: bus 0x18 vendor 0x6cb product 0x7f28 version 0x100
Input device name: "MSFT0001:00 06CB:7F28 Touchpad"
```

evtest gives that btw :
```
Testing ... (interrupt to exit)
expected 24 bytes, got -1

evtest: error reading: No such device
```

Now I'm running on `Kernel: 5.10.15-1-MANJARO`, I never managed to make touchpad OR brightness work \o/, I guess I'll need to reinstall everything someday but if anyone have any clue I guess I'll take it :D

Revision history for this message
boudicca (shazh) wrote :

Touchpad MSFT0001:00 04F3:3140 fixed https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/

Thanks all

Revision history for this message
Marton Danko (golddragon007) wrote :

I've checked the 5.11.0-rc7 and the touchpad still doesn't work properly, on the left and right bottom side the same primary action is being taken instead of secondary on the right and primary on the left!

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (8.0 KiB)

Hi resolve,

On Sun, Feb 14, 2021 at 04:09:09PM -0000, roselove wrote:
>Hi, I think I personally tried everything from bbs.archlinux.org,
>forum.manjaro.org, reddit, https://github.com/coiby/standalone_i2c_hid,
>bugzilla, bugs.launchpad.net, etc...
>
>I tried Coiby solution this very day (2021-02-14).
>
>Nothing ever worked since I updated to 9.7 kernel (coiby solution was
>nice before that ^^)
>
>Here is my lenovo model :
>https://psref.lenovo.com/Detail/Legion/Lenovo_Legion_5_15ARH05?M=82B50015FR
>
>Here is my touchpad model :
>```
>Input device ID: bus 0x18 vendor 0x6cb product 0x7f28 version 0x100
>Input device name: "MSFT0001:00 06CB:7F28 Touchpad"
>```
>
>evtest gives that btw :
>```
>Testing ... (interrupt to exit)
>expected 24 bytes, got -1
>
>evtest: error reading: No such device
>```
>

Did the above error happens when using https://github.com/coiby/standalone_i2c_hid?

Have you tried what's suggested in the bug description?

>Now I'm running on `Kernel: 5.10.15-1-MANJARO`, I never managed to make
>touchpad OR brightness work \o/, I guess I'll need to reinstall
>everything someday but if anyone have any clue I guess I'll take it :D
>

As for the brightness issue, https://github.com/Askannz/optimus-manager/
works for me.

>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1887190
>
>Title:
> MSFT Touchpad not working on Lenovo Legion-5 15ARH05
>
>Status in Pop!_OS:
> New
>Status in linux package in Ubuntu:
> Confirmed
>Status in xserver-xorg-input-libinput package in Ubuntu:
> Confirmed
>Status in linux package in Arch Linux:
> Fix Committed
>Status in linux package in Fedora:
> Confirmed
>Status in linux package in openSUSE:
> New
>
>Bug description:
> Update (based on #296)
> =============
>
> The latest kernel tree
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
> has the complete solution to fix this bug. So we can expect kernel
> v5.11 to fix this issue without any additional work.
>
> Before the release of v5.11, you are suggested to use #189 to save your touchpad. Note that for distributions like Ubuntu and Fedora, the pinctrl-amd driver is built into the initramfs. So you have to rebuild the initramfs after replacing the old module with new one.
> On Fedora, run `sudo dracut --force`; On ubuntu, run `sudo update-initramfs -u`.
>
> The complete solution is three patches,
>  - 47a0001436352c9853d72bf2071e85b316d688a2 ("pinctrl: amd: remove debounce filter setting in IRQ type setting")
>  - 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter")
>  - 8dcb7a15a585b6d0fee15751ce11d7a68cfedd56 ("gpiolib: acpi: Take into account debounce settings")
>
> The first two patches has reached the stable tree. If the last one is
> also backported to LTS kernel, you won't need to install kernel 5.11.
> But I don't know when this will happen.
>
> Original bug report
> ===================
>
> Hello
>
> The MSFT touchpad of this Lenovo Legion-5 15ARH05 laptop is not reacting at all (pointer and click never move when touchpad is touched). This has been reported by other users in va...

Read more...

Revision history for this message
Coiby Xu (coiby) wrote :
Download full text (7.3 KiB)

Hi Maton,

On Mon, Feb 15, 2021 at 08:46:57AM -0000, Maton Danko wrote:
>I've checked the 5.11.0-rc7 and the touchpad still doesn't work
>properly, on the left and right bottom side the same primary action is
>being taken instead of secondary on the right and primary on the left!
>

5.11.0-rc7 is expected to fix your touchpad. Could you paste the output of
"sudo cat /sys/kernel/debug/gpio|grep pin130 -A1" and also the output of
"sudo evest" when you lick the left bottom and right bottom button?

>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1887190
>
>Title:
> MSFT Touchpad not working on Lenovo Legion-5 15ARH05
>
>Status in Pop!_OS:
> New
>Status in linux package in Ubuntu:
> Confirmed
>Status in xserver-xorg-input-libinput package in Ubuntu:
> Confirmed
>Status in linux package in Arch Linux:
> Fix Committed
>Status in linux package in Fedora:
> Confirmed
>Status in linux package in openSUSE:
> New
>
>Bug description:
> Update (based on #296)
> =============
>
> The latest kernel tree
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
> has the complete solution to fix this bug. So we can expect kernel
> v5.11 to fix this issue without any additional work.
>
> Before the release of v5.11, you are suggested to use #189 to save your touchpad. Note that for distributions like Ubuntu and Fedora, the pinctrl-amd driver is built into the initramfs. So you have to rebuild the initramfs after replacing the old module with new one.
> On Fedora, run `sudo dracut --force`; On ubuntu, run `sudo update-initramfs -u`.
>
> The complete solution is three patches,
>  - 47a0001436352c9853d72bf2071e85b316d688a2 ("pinctrl: amd: remove debounce filter setting in IRQ type setting")
>  - 06abe8291bc31839950f7d0362d9979edc88a666 ("pinctrl: amd: fix incorrect way to disable debounce filter")
>  - 8dcb7a15a585b6d0fee15751ce11d7a68cfedd56 ("gpiolib: acpi: Take into account debounce settings")
>
> The first two patches has reached the stable tree. If the last one is
> also backported to LTS kernel, you won't need to install kernel 5.11.
> But I don't know when this will happen.
>
> Original bug report
> ===================
>
> Hello
>
> The MSFT touchpad of this Lenovo Legion-5 15ARH05 laptop is not reacting at all (pointer and click never move when touchpad is touched). This has been reported by other users in various websites, with various linux systems including other Ubuntu systems, but I saw no launchpad bug so I post one. Example of websites covering the issue :
> - https://askubuntu.com/questions/1253830/lenovo-legion-5-touchpad (exactly the same laptop)
> - https://www.linux.org/threads/lenovo-legion-5-touchpad.29536/ (similar laptop)
>
> xinput indentifies it as MSFT0001:00 04F3:3140
>
> Virtual core pointer id=2 [master pointer (3)]
> ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
> ⎜ ↳ MSFT0001:00 04F3:3140 Touchpad id=17 [slave pointer (2)]
> ⎜ ↳ MSFT0001:00 04F3:3140 Mouse id=16 [slave pointer (2)]
> ⎜ ↳ ITE Tech. Inc. ITE Device(8910) Consumer Con...

Read more...

Revision history for this message
Marton Danko (golddragon007) wrote :

Hi Coiby,

Here are they:
$ sudo cat /sys/kernel/debug/gpio|grep pin130 -A1
pin130 Level trigger| Active low| interrupt is enabled| interrupt is unmasked| disable wakeup in S0i3 state| disable wakeup in S3 state|
 disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| debouncing filter disabled| 0x51b00

I did a left, right and middle click. Between them 2-3 sec delay.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (60.8 KiB)

This bug was fixed in the package linux - 5.4.0-66.74

---------------
linux (5.4.0-66.74) focal; urgency=medium

  * focal/linux: 5.4.0-66.74 -proposed tracker (LP: #1913152)

  * Add support for selective build of special drivers (LP: #1912789)
    - [Packaging] Add support for ODM drivers
    - [Packaging] Turn on ODM support for amd64

  * Packaging resync (LP: #1786013)
    - update dkms package versions
    - update dkms package versions

  * Introduce the new NVIDIA 460-server series and update the 460 series
    (LP: #1913200)
    - [Config] dkms-versions -- drop NVIDIA 435 455 and 440-server
    - [Config] dkms-versions -- add the 460-server nvidia driver

  * Enable mute and micmute LED on HP EliteBook 850 G7 (LP: #1910102)
    - ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7

  * SYNA30B4:00 06CB:CE09 Mouse on HP EliteBook 850 G7 not working at all
    (LP: #1908992)
    - HID: multitouch: Enable multi-input for Synaptics pointstick/touchpad device

  * HD Audio Device PCI ID for the Intel Cometlake-R platform (LP: #1912427)
    - SAUCE: ALSA: hda: Add Cometlake-R PCI ID

  * switch to an autogenerated nvidia series based core via dkms-versions
    (LP: #1912803)
    - [Packaging] nvidia -- use dkms-versions to define versions built
    - [Packaging] update-version-dkms -- maintain flags fields
    - [Config] dkms-versions -- add transitional/skip information for nvidia
      packages

  * udpgro.sh in net from ubuntu_kernel_selftests seems not reflecting sub-test
    result (LP: #1908499)
    - selftests: fix the return value for UDP GRO test

  * qede: Kubernetes Internal DNS Failure due to QL41xxx NIC not supporting IPIP
    tx csum offload (LP: #1909062)
    - qede: fix offload for IPIP tunnel packets

  * Use DCPD to control HP DreamColor panel (LP: #1911001)
    - SAUCE: drm/dp: Another HP DreamColor panel brigntness fix

  * kvm: Windows 2k19 with Hyper-v role gets stuck on pending hypervisor
    requests on cascadelake based kvm hosts (LP: #1911848)
    - KVM: x86: Set KVM_REQ_EVENT if run is canceled with req_immediate_exit set

  * Ubuntu 20.10 four needed fixes to 'Add driver for Mellanox Connect-IB
    adapters' (LP: #1905574)
    - net/mlx5: Fix a race when moving command interface to polling mode

  * Fix right sounds and mute/micmute LEDs for HP ZBook Fury 15/17 G7 Mobile
    Workstation (LP: #1910561)
    - ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machines

  * Ubuntu 20.04 - multicast counter is not increased in ip -s (LP: #1901842)
    - net/mlx5e: Fix multicast counter not up-to-date in "ip -s"

  * eeh-basic.sh in powerpc from ubuntu_kernel_selftests timeout with 5.4 P8 /
    P9 (LP: #1882503)
    - selftests/powerpc/eeh: disable kselftest timeout setting for eeh-basic

  * DMI entry syntax fix for Pegatron / ByteSpeed C15B (LP: #1910639)
    - Input: i8042 - unbreak Pegatron C15B

  * CVE-2020-29372
    - mm: check that mm is still valid in madvise()

  * update ENA driver, incl. new ethtool stats (LP: #1910291)
    - net: ena: Change WARN_ON expression in ena_del_napi_in_range()
    - net: ena: ethtool: convert stat_offset to 64 bit resolution
    - net: ena: eth...

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Marton Danko (golddragon007) wrote :

Hi Coiby,

Did you find anything about why it still doesn't work properly on my machine?

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

"This bug was fixed in the package linux - 5.4.0-66.74"

Wait, current kernel in Ubuntu 20.04.2 is 5.8 so can I expect to have it working on Ubuntu 20.04.2 without any hassle or I have to switch kernel?

Revision history for this message
Joe Zhou (joezhouchenye) wrote :

Works fine after installing hwe kernel using apt.(5.8.0.44 Ubuntu 20.04 Lenovo R7000P)

Revision history for this message
Coiby Xu (coiby) wrote :

Hi Marton,

On Tue, Feb 23, 2021 at 05:00:30PM -0000, Marton Danko wrote:
>Hi Coiby,
>
>Did you find anything about why it still doesn't work properly on my
>machine?
>

Your GPIO pin register value for the touchpad is 0x51b00 which means the
root cause has been fixed. I've less certain about the evest result but
I don't find something suspicious when comparing it with my laptop. Can
you create another user and check if the problem still occurs after
logging in?

Revision history for this message
Marton Danko (golddragon007) wrote :

I've done it and it's still registered primary action for that user too, it did not change anything.

Revision history for this message
Azizkhan (injkgz) wrote :

Tried - 5.4.0-66.74, 5.8.0.44 and 5.11 kernels, nothing worked for me, but i2c-hid and another one patches fixes problem. What can i do?

Revision history for this message
Shatadru Banerjee (satadru-bag) wrote :

Can anyone please give a summary of the solution? What works what does not? I am using 5.11 on ubuntu 20.04. The touchpad works (not great though) but I cannot use nvidia gpu, hence stuck with the iGPU. The brightness control does not work perfectly. Is it possible to able to use touchpad and the nvidia GPU at the same time? Am I missing something here?
Thanks in advance.

Revision history for this message
Baq Domalaq (baq) wrote :

Hi Shatadru Banerjee (satadru-bag)

I think you should stick to patches and an official kernel of your distro for now.

I use Pop OS 20.10 with kernel 5.8.*. I used to apply the patch in comment #171 and rebuild the kernel to fix my touchpad.

Now two of the 3 new patches which Coiby Xu mentions in this bug description are landed to latest kernel updates of my distro. But without the third patch the touchpad doesn't work correctly. And the patch #171 doesn't work now like before. So I have to revert patches 47a0001436352c9853d72bf2071e85b316d688a2 and 06abe8291bc31839950f7d0362d9979edc88a666, and then apply the patch #171 to make touchpad work correctly.

I think my NVidia works ok.

I'm going to do that until the third patch arrives to my distro. Or a new version of distro will be released (and hopefully everything will work out of the box). Which is in June I think.

Revision history for this message
Coiby Xu (coiby) wrote :

On Wed, Feb 24, 2021 at 04:20:15PM -0000, Marton Danko wrote:
>I've done it and it's still registered primary action for that user too,
>it did not change anything.

I still think there's something wrong in the user space. I found a
similar bug report [1]. What's the output of "sudo libinput
debug-events" when you click the button at the right corner?

$ sudo libinput debug-events
-event7 DEVICE_ADDED MSFT0001:00 06CB:7F28 Mouse seat0 default group8 cap:p left scroll-nat scroll-button
-event8 DEVICE_ADDED MSFT0001:00 06CB:7F28 Touchpad seat0 default group8 cap:pg size 102x67mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on

-event8 POINTER_BUTTON +5.491s BTN_RIGHT (273) pressed, seat count: 1
  event8 POINTER_BUTTON +5.612s BTN_RIGHT (273) released, seat count: 0
  event8 POINTER_BUTTON +7.796s BTN_LEFT (272) pressed, seat count: 1
  event8 POINTER_BUTTON +7.953s BTN_LEFT (272) released, seat count: 0

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1564738

Revision history for this message
Shatadru Banerjee (satadru-bag) wrote :

Still confused. Anyway, I want to report that with kernel 5.11 I cannot connect to external display using HDMI. Does this problem appear because of using mainline kernel?

Revision history for this message
Marton Danko (golddragon007) wrote :

Hi Coiby,

Thanks, it seems that correctly telling which hardware button do I press.
Right:
-event18 POINTER_BUTTON +0.174s BTN_RIGHT (273) pressed, seat count: 1
 event18 POINTER_BUTTON +0.318s BTN_RIGHT (273) released, seat count: 0
Middle:
 event18 POINTER_BUTTON +3.086s BTN_MIDDLE (274) pressed, seat count: 1
 event18 POINTER_BUTTON +3.362s BTN_MIDDLE (274) released, seat count: 0
Left:
 event18 POINTER_BUTTON +5.132s BTN_LEFT (272) pressed, seat count: 1
 event18 POINTER_BUTTON +5.271s BTN_LEFT (272) released, seat count: 0

And in the mentioned bug report the following resolution works:
"Apparently it's a change they did in GNOME 3.28 and can be fixed by switching to Area mouse click emulation in GNOME Tweaks."

Thanks for your help, and now I need to go to the corner to cry again, why such a stupid default configuration is shipped with the system...

Revision history for this message
Mohamed Abba (kaderabba) wrote :

Hi Baq Domalaq (baq),
how do you revert the patches and apply #170?

Revision history for this message
Baq Domalaq (baq) wrote :

Hi Mohamed,
please DM me about that.

Revision history for this message
Coiby Xu (coiby) wrote :

On Fri, Feb 26, 2021 at 02:28:24PM -0000, Marton Danko wrote:
>Hi Coiby,
>
>Thanks, it seems that correctly telling which hardware button do I press.
>Right:
>-event18 POINTER_BUTTON +0.174s BTN_RIGHT (273) pressed, seat count: 1
> event18 POINTER_BUTTON +0.318s BTN_RIGHT (273) released, seat count: 0
>Middle:
> event18 POINTER_BUTTON +3.086s BTN_MIDDLE (274) pressed, seat count: 1
> event18 POINTER_BUTTON +3.362s BTN_MIDDLE (274) released, seat count: 0
>Left:
> event18 POINTER_BUTTON +5.132s BTN_LEFT (272) pressed, seat count: 1
> event18 POINTER_BUTTON +5.271s BTN_LEFT (272) released, seat count: 0
>
>And in the mentioned bug report the following resolution works:
>"Apparently it's a change they did in GNOME 3.28 and can be fixed by switching to Area mouse click emulation in GNOME Tweaks."
>

Good to know that:)

>Thanks for your help, and now I need to go to the corner to cry again,
>why such a stupid default configuration is shipped with the system...
>

You are welcome!

Revision history for this message
Piotr Tomaszewski (nfm886) wrote :

Tested Ubuntu 20.04.2/20.10 with all updates. Touchpad not working... How to make it works?

Revision history for this message
Helmut Stult (helmut-stult) wrote :

@Coiby Xu (coiby)

My touchpad MSFT0001:00 04F3:3140 works fine with Kernel 5.11, but stops working with the new 5.12-rc1
So far I haven't found the cause.

Revision history for this message
Helmut Stult (helmut-stult) wrote :
Revision history for this message
Helmut Stult (helmut-stult) wrote :

This is the working kernel 5.11

https://linux-hardware.org/?probe=fbcb409c56

Revision history for this message
Helmut Stult (helmut-stult) wrote :

Works again - have to set CONFIG_I2C_HID_ACPI=m in config

Revision history for this message
Helmut Stult (helmut-stult) wrote :
Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

Does this touchpad (and iGPU <-> nVidia switching) work fine in Ubuntu 20.10?

Revision history for this message
Coiby Xu (coiby) wrote :

On Tue, Mar 02, 2021 at 01:40:54AM -0000, Helmut Stult wrote:
>Works again - have to set CONFIG_I2C_HID_ACPI=m in config

Well done!

Revision history for this message
Shatadru Banerjee (satadru-bag) wrote :

I want to politely point out that this thread is not helping anymore; it has become mere chit-chat. Things were confusing to begin with and unfortunately it is becoming more confusing. What is the fix? Does is work with a particular kernel? The use of mainline kernel 5.11 should solve all the problems? Is this nvidia gpu issue related to the solution to the trackpad? Why can't the external monitor work, even with the AMD iGPU? Most importantly, what one should do to have a working touchpad, working nvida gpu and working external monitor? Please reply only if you know what are you going to write.

Revision history for this message
pravin poudel (poudprav) wrote :

Touchpad issue and brightness is different. Touchpad is working with kernel 5.11.
A solution for brightness issue is here: https://gitlab.freedesktop.org/drm/amd/-/issues/1438
but I don't think it is in the kernel yet.

Revision history for this message
Shatadru Banerjee (satadru-bag) wrote :

I did not mention brightness issue. With 5.11.3 the brightness does not work flawlessly however there are more serious problems. 1. External monitor not detected via HDMI, 2. still the wifi is not stable, 3. cannot switch to nvidia.

Revision history for this message
Baq Domalaq (baq) wrote :

Pop OS 20.10 has updated to kernel 5.11 and touchpad now works out of the box without patching.
This is a great day for my laptop!

Revision history for this message
Shatadru Banerjee (satadru-bag) wrote :

This thread has gone from stupid to completely pointless.

Revision history for this message
James Hennig (kissykitty) wrote :

Since this is the main thread on the Internet about this issue, I suppose it is appropriate to post here even though I am using Manjaro.

- This issue is non-present on a Thinkpad 3 14ADA05 with touchpad MSFT0001:00 06CB:CE2D on kernel 5.9.16-1 which uses i2c_hid. It is not elantech or designware (doesn't load the associated specific i2c drivers). Installing an entirely new keyboard panel with a new touchpad, essentially rebuilding the entire laptop does not address this issue. It is the same model touchpad for this specific laptop model even if you order a new one (unless I got bad luck of the draw).

- The issue becomes present on kernel 5.10.23-1 (and previous versions of 5.10) up to 5.12rc3. Have not tried compiling 5.12rc5, but no reason to believe it would work.

The touchpad will fail to be recognized and work on bootup between 1-30 reboots. I have tried many things such as different kernels and GRUB_CMDLINE_LINUX_DEFAULT options, yes even checking to set the kernel config option others are suggesting (Manjaro removed then reinstated the CONFIG_I2C_HID_ACPI=m option). I also tore apart kernels 5.9 and 5.10 to look at the pinctrl-amd.c driver and found that there was no difference between the two on these kernels, so it is something other than what https://launchpadlibrarian.net/500948605/0303-pinctrl-amd2.patch addresses since it works on the former kernel but not the latter. Also, the patch fails to apply on 5.12rc5.

I don't really know how to compare the entire torn-apart kernels 5.9 and 5.10 to try and find what change(s) could possibly cause this bug. Hopefully someone else knows how to?

Might be able to get somewhere if so...

Other mods might be replacing the touchpad with a model not designed for the laptop, but I don't know where to start with that either.

Revision history for this message
James Hennig (kissykitty) wrote :

I don't know what I was comparing before, but I was wrong. The pinctrl-amd.c drivers are different between the two kernels. Apologies. I wonder if just dropping in the 5.9 pinctrl-amd.c driver (+possibly other related needed ones?) into 5.10 (or later) would work?

Changed in pop-os:
status: New → Fix Released
Revision history for this message
Coiby Xu (coiby) wrote :

On Sat, Mar 06, 2021 at 03:24:35PM -0000, Shatadru Banerjee wrote:
>I want to politely point out that this thread is not helping anymore; it
>has become mere chit-chat. Things were confusing to begin with and
>unfortunately it is becoming more confusing. What is the fix? Does is
>work with a particular kernel? The use of mainline kernel 5.11 should
>solve all the problems? Is this nvidia gpu issue related to the solution
>to the trackpad? Why can't the external monitor work, even with the AMD
>iGPU? Most importantly, what one should do to have a working touchpad,
>working nvida gpu and working external monitor? Please reply only if you
>know what are you going to write.

On Sat, Mar 13, 2021 at 03:17:55AM -0000, Shatadru Banerjee wrote:
>I did not mention brightness issue. With 5.11.3 the brightness does not
>work flawlessly however there are more serious problems. 1. External
>monitor not detected via HDMI, 2. still the wifi is not stable, 3.
>cannot switch to nvidia.

On Thu, Apr 01, 2021 at 03:06:02AM -0000, Shatadru Banerjee wrote:
>This thread has gone from stupid to completely pointless.

Sorry to know this thread didn't help you. This thread only deals with
the touchpad issue and it's too long to follow. But I've summarized
what's needed in the beginning of the bug report. As far as I know, the
fix for the touchpad doesn't affect nvidia issue. In fact, I don't
experience any of the issues you mentioned including external monitor
not detected and brightness issue on Manjara with kernel=5.11.6-1
after installing optimus manager [1]. [1] is "a port to Archlinux of the
nvidia-prime solution created by Canonical for Ubuntu" so I assume the
issues of external monitor and brightness don't bother Ubuntu users
either.

[1] https://github.com/Askannz/optimus-manager/

Revision history for this message
Coiby Xu (coiby) wrote :

On Mon, Apr 05, 2021 at 03:22:24PM -0000, James Hennig wrote:
>Since this is the main thread on the Internet about this issue, I
>suppose it is appropriate to post here even though I am using Manjaro.
>
>- This issue is non-present on a Thinkpad 3 14ADA05 with touchpad
>MSFT0001:00 06CB:CE2D on kernel 5.9.16-1 which uses i2c_hid. It is not
>elantech or designware (doesn't load the associated specific i2c
>drivers). Installing an entirely new keyboard panel with a new touchpad,
>essentially rebuilding the entire laptop does not address this issue. It
>is the same model touchpad for this specific laptop model even if you
>order a new one (unless I got bad luck of the draw).

If kernel 5.9.16-1 with i2c_hid driver worked for you, I'd suggest you
stick with the i2c_hid that comes with kernel 5.9.16-1 and build a
stand-alone driver for newer kernel and replace newer i2c_hid driver.

>
>- The issue becomes present on kernel 5.10.23-1 (and previous versions
>of 5.10) up to 5.12rc3. Have not tried compiling 5.12rc5, but no reason
>to believe it would work.
>
>The touchpad will fail to be recognized and work on bootup between 1-30
>reboots. I have tried many things such as different kernels and
>GRUB_CMDLINE_LINUX_DEFAULT options, yes even checking to set the kernel
>config option others are suggesting (Manjaro removed then reinstated the
>CONFIG_I2C_HID_ACPI=m option). I also tore apart kernels 5.9 and 5.10 to
>look at the pinctrl-amd.c driver and found that there was no difference
>between the two on these kernels, so it is something other than what
>https://launchpadlibrarian.net/500948605/0303-pinctrl-amd2.patch
>addresses since it works on the former kernel but not the latter. Also,
>the patch fails to apply on 5.12rc5.
>
>I don't really know how to compare the entire torn-apart kernels 5.9 and
>5.10 to try and find what change(s) could possibly cause this bug.
>Hopefully someone else knows how to?
>
>Might be able to get somewhere if so...
>
>Other mods might be replacing the touchpad with a model not designed for
>the laptop, but I don't know where to start with that either.
>

Revision history for this message
James Hennig (kissykitty) wrote :

Hey there @Coiby Xu thank you,

I think I understand what you mean, basically use your Github for this, standalone_i2c_hid, but copy the i2c drivers from the cloned Manjaro kernel 5.9.16-1 ../src/linux-5.9/drivers/hid/i2c-hid/ directory into the ../i2c-hid_standalone/ directory in your project (replacing all 3 source files without the Makefile), then compile it and replace the according module in my running system.

Just as a reference, directly dropping in /lib/modules/5.9.16-1-MANJARO/kernel/drivers/hid/i2c-hid/i2c-hid.ko.xz into the respective 5.11.6-1-MANJARO ../i2c-hid/ directory, then running "mkinitcpio -P linux511" (to use the new module.. if this is how to do it?) does not work, in case anyone was wondering. Touchpad immediately froze on bootup.

******************************

I was able to compile the Manjaro 5.9.16-1 source files into a module (on 5.11.6-1 using linux511-headers) using your provided Makefile and followed the instructions to copy the compiled module into the 5.11.6-1-MANJARO ../i2c-hid/ directory. Also added the GRUB options and ran "sudo update-grub". It functioned, but did not fix the issue. Froze after 2 reboots.

I also tried compiling the Github project as it is, using the provided source files (on 5.11.6-1 using linux511-headers) and it spit out:
ERROR: modpost "irq_to_desc" (in ../i2c-hid-standalone/i2c-hid.ko) undefined !
../i2c-hid-standalone/Module.symvers Error 1

Also I wanted to point out in your README the instruction to append "i2c_hid.polling_mode=1" to GRUB_CMDLINE_LINUX. Shouldn't this be appended to GRUB_CMDLINE_LINUX_DEFAULT? I don't really know, I've just never seen the non-_DEFAULT line used before. In either case, produces same results.

Thanks for all your help, it was worth a shot. Maybe your code needs to be updated for recent kernels?

I am still trying to play with the idea of focusing on the pinctrl-amd.c driver, but really need some help with what to do with that driver. I am not sure the culprit is the i2c_hid driver, but rather this driver. Maybe I'm wrong, but it certainly is the next place to look...

Fun things to try!

Revision history for this message
James Hennig (kissykitty) wrote :

Well, I spent the past few hours pouring over the entirety of this thread and I didn't try the patches to pinctrl-amd.c provided by @Helmut Stult in post #317. These were downloaded and placed in the same source directory as the other patches for Manjaro kernel 5.11.13-1 and lines were added to the PKGBUILD file for the patches.

- 0303-pinctrl-amd2.patch fails to apply with error "Hunk #1 FAILED at 472". This is presumably because the code that the patch is trying to change is not present in 5.11.13-1, if I am right in my interpretation of it.
- 0303-revert-pinctrl_amd_remove_debounce_filter_setting_in_IRQ_type_setting.patch - Successfully validates, applies and I was able to compile and install 5.11.13-1 and the kernel functions on bootup.

However, this too did not resolve the issue. The touchpad failed on bootup in the expected 1-30 reboot range (Got to 9 reboots), just as if no patch were applied. I am out of ideas and need some help from an expert, @Coiby Xu. There is nothing else for me to try and I'm not a programmer so I don't know how to create a solution from scratch.

Thanks for any help moving forward.

Revision history for this message
James Hennig (kissykitty) wrote :

The solution has been found and should have been rather obvious in the first place... Just try a different distribution.

I decided to try out Linux Mint 20.1 and have been testing it for the past ~6 hours, completely stock (except for all updates installed), no kernel modifications or GRUB options and it works every time on bootup with the touchpad. I am rather surprised that such a relatively old kernel (5.4) works with this new-ish laptop. Perhaps this was why I was so falsely focused on having newer kernels available in a distribution in the first place.

I even tried 40 consecutive reboots whilst messing with the touchpad as the machine was booting and it still worked every time. Let it be known that the fix for the Lenovo IdeaPad 3 14ADA05 is to simply install Linux Mint. I have to imagine that other Ubuntu-based installs also work with this particular laptop, especially since it says "Fix Released" under Ubuntu and Ubuntu-related distributions.

As far as Manjaro goes, also let it be known that something was introduced after Kernel 5.9.16-1 which breaks the ability for the touchpad to reliably work with this laptop. My best educated guess is that something is loaded too early or too late during bootup which gets jumbled up at random. No idea what that could possibly be, but I hope that Manjaro devs might take note. I know that at least @Helmut Stult might still be looking in this thread.

I consider this fixed for my laptop :)

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.