Bug 1628715 - Elan touchpad unable to perform right-click in kernel later than 4.17.19-200.fc28
Summary: Elan touchpad unable to perform right-click in kernel later than 4.17.19-200....
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 28
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Benjamin Tissoires
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-13 18:58 UTC by barish
Modified: 2019-08-21 22:56 UTC (History)
34 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-02 14:52:38 UTC
Type: Bug


Attachments (Terms of Use)
dmesg output for kernel 4.18.10 on ThinkPad Yoga L380 (95.70 KB, text/plain)
2018-10-09 08:27 UTC, Pascal
no flags Details
libinput record of right click, left click and trying to move a window (321.28 KB, text/plain)
2018-10-09 08:31 UTC, Pascal
no flags Details
libinput record of right click, left click and window drag (153.17 KB, text/plain)
2018-10-09 10:13 UTC, Pascal
no flags Details
elan_i2c.patch (18.62 KB, patch)
2018-10-09 14:31 UTC, Benjamin Tissoires
no flags Details | Diff
T480s, Logs from Kernel 4.18.10-200 (35.08 KB, text/gz)
2018-10-09 15:40 UTC, Michael
no flags Details
T480s, Logs from Kernel 4.19-rc7(patched) (153.83 KB, text/plain)
2018-10-09 16:28 UTC, Michael
no flags Details
T480s, Logs from Kernel 4.19-rc7(patch+fix) (186.24 KB, text/plain)
2018-10-09 17:49 UTC, Michael
no flags Details
elan_i2c_v2.patch (20.37 KB, patch)
2018-10-12 13:56 UTC, Benjamin Tissoires
no flags Details | Diff
libinput record, T480s, logs from kernel-4.18.13-201 patched with elan_i2c_v2 (66.61 KB, text/plain)
2018-10-12 22:17 UTC, Mihai Harpau
no flags Details
Lenovo P52, 4.18.16-300.p52.1.fc29.x86_64 with elan patches included (6.29 KB, text/plain)
2018-11-02 22:31 UTC, Stefan Becker
no flags Details
libinput records for two versions of libinput (2.38 KB, text/plain)
2019-02-02 10:03 UTC, Pascal
no flags Details

Description barish 2018-09-13 18:58:47 UTC
Description of problem:

After updating to kernel-4.18.5-200.fc28.x86_64 (Gnome on xorg), my ThinkPad T480s was no longer able to perform right-click. External mice have not been affected. Changing right-click emulation options (two-finger, bottom right corner, etc.) does not resolve issue. Rolling back to 4.17.19-200.fc28 is the only way to regain right-click. 

Issue persists on kernel-4.18.7-250.vanilla.knurd.1.fc28.x86_64 as well

Version-Release number of selected component (if applicable):

libinput 1.11.3

Libinput output for touchpad:
Device:           Elan Touchpad
Kernel:           /dev/input/event17
Group:            9
Seat:             seat0, default
Size:             98x61mm
Capabilities:     pointer gesture
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    none
Disable-w-typing: enabled
Accel profiles:   none
Rotation:         n/a

Comment 1 Peter Hutterer 2018-09-13 23:38:52 UTC
This is https://bugzilla.kernel.org/show_bug.cgi?id=200899, we should pick up that patch for the fedora kernel

Comment 2 barish 2018-09-14 14:30:13 UTC
(In reply to Peter Hutterer from comment #1)
> This is https://bugzilla.kernel.org/show_bug.cgi?id=200899, we should pick
> up that patch for the fedora kernel

Ahh okay, well I'm glad there's already a resolution. Any idea when to expect this patch? We have a good number of T480s in our fleet running Fedora and automation has pushed them all to 4.18.5-200

Comment 3 barish 2018-09-14 14:42:44 UTC
(In reply to Peter Hutterer from comment #1)
> This is https://bugzilla.kernel.org/show_bug.cgi?id=200899, we should pick
> up that patch for the fedora kernel

Sorry one more thing, trying to apply this patch manually but /usr/src/kernels/4.18.5-200.fc28.x86_64//drivers/hid/hid-multitouch.c doesn't exist, my /drivers/hid/ directory only contains the following files/directories and the patch command fails:

drwxr-xr-x. 2 root root 4.0K Sep 11 17:58 i2c-hid/
drwxr-xr-x. 2 root root 4.0K Sep 11 17:58 intel-ish-hid/
-rw-r--r--. 1 root root  32K Sep  4 09:08 Kconfig
-rw-r--r--. 1 root root 5.1K Sep  4 09:08 Makefile
drwxr-xr-x. 2 root root 4.0K Sep 11 17:58 usbhid/

Comment 4 Fedora Update System 2018-09-17 15:04:20 UTC
kernel-headers-4.18.8-200.fc28 kernel-4.18.8-200.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-f93103ae20

Comment 5 Fedora Update System 2018-09-17 15:05:42 UTC
kernel-headers-4.18.8-100.fc27 kernel-4.18.8-100.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-3b2c23b946

Comment 6 Fedora Update System 2018-09-17 18:28:12 UTC
kernel-4.18.8-100.fc27, kernel-headers-4.18.8-100.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-3b2c23b946

Comment 7 Fedora Update System 2018-09-17 19:24:47 UTC
kernel-4.18.8-200.fc28, kernel-headers-4.18.8-200.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-f93103ae20

Comment 8 barish 2018-09-18 14:46:31 UTC
(In reply to Fedora Update System from comment #7)
> kernel-4.18.8-200.fc28, kernel-headers-4.18.8-200.fc28 has been pushed to
> the Fedora 28 testing repository. If problems still persist, please make
> note of it in this bug report.
> See https://fedoraproject.org/wiki/QA:Updates_Testing for
> instructions on how to install test updates.
> You can provide feedback for this update here:
> https://bodhi.fedoraproject.org/updates/FEDORA-2018-f93103ae20

This update has been tested and has not resolved the issue for the Elan Touchpad used on the ThinkPad T480s

Comment 9 Pascal 2018-09-18 18:49:24 UTC
(In reply to Fedora Update System from comment #7)
> kernel-4.18.8-200.fc28, kernel-headers-4.18.8-200.fc28 has been pushed to
> the Fedora 28 testing repository. If problems still persist, please make
> note of it in this bug report.
> See https://fedoraproject.org/wiki/QA:Updates_Testing for
> instructions on how to install test updates.
> You can provide feedback for this update here:
> https://bodhi.fedoraproject.org/updates/FEDORA-2018-f93103ae20

Also tested the new kernel version. Problem still persists.
I'm using a ThinkPad Yoga L380.

The Touchpad does work correctly with clicks (not pressing down the pyhiscal touchpad to click). When using two fingers and pressing down the touchpad (pyhiscal) the right click does not work.

Also:
When using two fingers to drag objects like windows, this is also not possible.
Pressing down the touchpad and using the second finger to drag results in no movement of the window. When doing this in a Browser like Chrome the same dragging motion results in a vertical-only scrolling motion.

Also when pressing down on the pyhsical button to left click, it is often recognized as a double click.

Comment 10 Laura Abbott 2018-09-18 22:03:41 UTC
You can see the fixes I picked up at https://src.fedoraproject.org/rpms/kernel/c/473a8aafe6eae66e8053b11aba38df07b285349e?branch=f28 . If there's another one please let me know

Comment 11 Fedora Update System 2018-09-20 15:56:29 UTC
kernel-headers-4.18.9-100.fc27 kernel-4.18.9-100.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d77cc41f35

Comment 12 Fedora Update System 2018-09-20 19:12:54 UTC
kernel-4.18.8-200.fc28, kernel-headers-4.18.8-200.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 barish 2018-09-20 20:45:52 UTC
Neither the latest stable update, nor the latest vanilla fedora knurd have resolved this issue. I am still running 4.17.19-200.fc28.x86_64 to maintain my touchpad function. Can this please be fixed? This model laptop had been working perfectly up until this point.

Comment 14 Fedora Update System 2018-09-21 08:32:59 UTC
kernel-4.18.9-100.fc27, kernel-headers-4.18.9-100.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d77cc41f35

Comment 15 David H. Gutteridge 2018-09-24 00:15:50 UTC
(Adding myself to the CC list for visibility.)

Comment 16 barish 2018-09-25 20:13:29 UTC
(In reply to Peter Hutterer from comment #1)
> This is https://bugzilla.kernel.org/show_bug.cgi?id=200899, we should pick
> up that patch for the fedora kernel

This issue has not been resolved yet and I know it seems really minor, but when you use the touchpad exclusively, can't secondary click anything, and then forget it's broken and single click everything you meant to right click, it makes the OS unbearable to use.

Comment 17 Fedora Update System 2018-09-26 20:16:58 UTC
kernel-4.18.9-100.fc27, kernel-headers-4.18.9-100.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Michael 2018-10-04 16:39:18 UTC
I compiled upstream 4.19-rc6 today. Right and middle-click with two, respectively three fingers does not work. So I guess this bug might still be open? Also the official kernel package from the fedora repository 4.18.10-200 did not fix the issue.

I then used git bisect to find the commit which broke the functionality for me and I ended up with:

Commit: df077237cf55928f5ac4b2770488a0aa4d3cd095

Author: Benjamin Tissoires <benjamin.tissoires@redhat.com>  2018-05-23 02:30:07
Committer: Dmitry Torokhov <dmitry.torokhov@gmail.com>  2018-05-24 01:49:22
Parent: 21c48dbde0944e3d52468008321900af3bdafcf1 (Input: elantech - add support for SMBus devices)
Branches: master, remotes/origin/master
Follows: v4.16-rc7
Precedes: v4.18-rc1

    Input: elantech - detect new ICs and setup Host Notify for them

Comment 19 Benjamin Tissoires 2018-10-09 06:54:30 UTC
barish, can you provide us some logs so we can actually debug the issue?
I would need:
- a dmesg from the boot on the 4.18 kernel,
- an evemu-record of the touchpad (package evemu) when you are actually using the right click (still on the v4.18 kernel)
- While you are capturing the evemu trace, it would be interesting to see the 'libinput debug-events' trace in parallel (beware to not capture the password of 'sudo' while libinput debug-event is running. We won't see the actual characters, but we will see the length)

FYI, I specifically enabled the t480s with the patch you mentioned. So either the model I had had a different touchpad unit (which might explain), either there is a userspace misconfiguration. Any cases, the logs will show us what is going.

Comment 20 Benjamin Tissoires 2018-10-09 07:06:47 UTC
Peter mentioned that if you are on f28, which should be the case, you can replace the 2 recordings of evemu+libinput debug-event by a single call to "sudo libinput record".

You just need libinput-utils to be installed to be able to run the 'record' command

Comment 21 Pascal 2018-10-09 08:27:50 UTC
Created attachment 1491990 [details]
dmesg output for kernel 4.18.10 on ThinkPad Yoga L380

Hello,

like barish and Michael I still have problems with the Elan touchpad since kernel version 4.18-x

I am using a ThinkPad Yoga L380. All touchpad presses are now registered as BTN_LEFT clicks.

On 4.17-x i had to use two fingers to press on the touchpad to perform a right click (it was never the way, that i needed to press on the right side of the touchpad to perform a right click). Now i can just use the double finger tapping to right click.

Also when i need to move a window i can't just grab its top bar by clicking on the touchpad and moving it with another finger. Instead i need to double tab the top bar before moving it with a single finger, which is pretty annoying, when reaching the end ot the touchpad surface.

I attached the requested dmesg log from this morning.

Comment 22 Pascal 2018-10-09 08:31:46 UTC
Created attachment 1491992 [details]
libinput record of right click, left click and trying to move a window

I forgot to add the requested libinput record output of me performing a right click by using to fingers and clicking (like on 4.17-x) followed by a left click and then i tried to move a window (which is not possible without using the tab method).

Comment 23 Benjamin Tissoires 2018-10-09 08:55:01 UTC
so, we have:
    #   Event code 273 (BTN_RIGHT)
...
    # Properties:
    #    Property 0 (INPUT_PROP_POINTER)

Can you confirm that you have 2 physical buttons under the touchpad?

We never see a BTN_RIGHT event in the log, so I suspect you have a clickpad (the entire surface is depressible), and so the kernel exports the wrong device type.

Comment 24 Pascal 2018-10-09 10:13:14 UTC
Created attachment 1492024 [details]
libinput record of right click, left click and window drag

Yes, it seems you are right. The touchpad is in fact a clickpad.
I just checked the libinput record under kernel version 4.17.x and it does not show any Event Code for BTN_RIGHT.
The name and ID do also differ between both kernel versions.

Do you know the reason, why it does export it in this wrong way?

Comment 25 Benjamin Tissoires 2018-10-09 10:23:15 UTC
(In reply to Pascal from comment #24)
> Created attachment 1492024 [details]
> libinput record of right click, left click and window drag
> 
> Yes, it seems you are right. The touchpad is in fact a clickpad.

\o/ that means we have found the cause of the bug

> I just checked the libinput record under kernel version 4.17.x and it does
> not show any Event Code for BTN_RIGHT.
> The name and ID do also differ between both kernel versions.
> 
> Do you know the reason, why it does export it in this wrong way?

Yes. The reason is that starting with kernel v4.18, a different kernel module is driving the touchpad. In v4.17 and before, the touchpad was using PS/2 through the kernel module psmouse (and its extension elantech). Starting with v4.18, those touchpads are switched to I2C and are driven by elan_i2c.

The benefit of using I2C is that you can now have better latency: 5 fingers will be reported every 2 ms, while on PS/2 it took roughly 20ms IIRC. You can also have better and finer support of multitouch.

However, the elan_i2c module was first written for I2C only touchpads. For those dual PS/2 - I2C touchpads, the Windows driver fetches everything it needs in PS/2, and then rely on that for the I2C mode. *But* the I2C part of the firmware doesn't necessary have all of the bits in place to report the various modes. On the P52, for example, the touchpad is simply dead as the query functions just fail, so elan_i2c bails out.

Anyway, a long story to say that I am currently working on the P52 ATM, and the fixes for it should also benefit here by using the PS/2 information.

Note that we can force the touchpad to stick to PS/2 temporary. However, last time I gave such advice to fix one corner case, this spread as "the solution for everything", and it introduced more problems, especially while debugging. So I rather wait until I have a fix. Apologies for the inconvenience.

Comment 26 Benjamin Tissoires 2018-10-09 14:31:15 UTC
Created attachment 1492100 [details]
elan_i2c.patch

Please find attached a patch that solves the issue on the P52.

Please test on the t480s as well.

I am submitting a koji build for those who are afraid of rebuilding locally :)

Comment 27 Benjamin Tissoires 2018-10-09 15:03:28 UTC
https://koji.fedoraproject.org/koji/taskinfo?taskID=30148153

so far, so good, should be done in a few hours

Comment 28 Michael 2018-10-09 15:40:51 UTC
Created attachment 1492123 [details]
T480s, Logs from Kernel 4.18.10-200

Comment 29 Michael 2018-10-09 15:42:30 UTC
(In reply to Michael from comment #28)
> Created attachment 1492123 [details]
> T480s, Logs from Kernel 4.18.10-200

I added the logs. Right- and Middle click were only recognized as left button clicks.

I also tried your patch against kernel 4.19-rc7 without any effect.

(Thanks for the detailed description on how to get the logs.)

Comment 30 Benjamin Tissoires 2018-10-09 16:23:09 UTC
Michael, do you have the evemu-record of the touchapd with the patched kernel?

Comment 31 Michael 2018-10-09 16:28:46 UTC
Created attachment 1492144 [details]
T480s, Logs from Kernel 4.19-rc7(patched)

Here you are :)

libinput still reports just BTN_LEFT: So nothing interesting to show there.

Comment 32 Benjamin Tissoires 2018-10-09 16:48:21 UTC
(In reply to Michael from comment #31)
> Created attachment 1492144 [details]
> T480s, Logs from Kernel 4.19-rc7(patched)
> 
> Here you are :)

Thanks

> 
> libinput still reports just BTN_LEFT: So nothing interesting to show there.


At this point, I am more interested in the description of the device. Once it reports itself as a buttonpad, libinput will properly handle the BTN_LEFT.

And looking into the patch, I forgot to check on "elan,buttonpad" in elan_i2c. So this explains why there is no change. It should be a matter of addingdiff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 6a22e3d8d12d..5c47a577448d 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1201,6 +1201,9 @@ static int elan_probe(struct i2c_client *client,
        if (error)
                return error;
 
+       if (device_property_read_bool(&client->dev, "elan,buttonpad"))
+               data->clickpad = 1;
+
        dev_info(dev,
                 "Elan Touchpad: Module ID: 0x%04x, Firmware: 0x%04x, Sample: 0x%04x, IAP: 0x%04x\n",
                 data->product_id,

Can I ask you to quickly test this addition to the patch above?

Comment 33 Michael 2018-10-09 17:49:57 UTC
Created attachment 1492149 [details]
T480s, Logs from Kernel 4.19-rc7(patch+fix)

Works again! I attached the logs from evemu for verification.

Thanks for your help!

Comment 34 Laura Abbott 2018-10-09 18:39:38 UTC
Glad to see this got worked out, Please let us know when there's a patch that's ready to apply to Fedora.

Comment 35 Pascal 2018-10-10 06:28:33 UTC
Hello Benjamin,

thank you for the explanation of the situation and the cause of the bug.

I build kernel 4.18.12 with both patches and I can confirm that it solves the bug completely on my Yoga L380. Everything works again and the clickpad is recognized correctly.

So this might be the solution for all Elan clickpad issues and also for the problems with Touchpad + HW buttons on TP P52 and P72.

Thank you for your help :)

Comment 36 Benjamin Tissoires 2018-10-12 13:56:31 UTC
Created attachment 1493337 [details]
elan_i2c_v2.patch

Here is the updated (hopefully final) patch that I am going to submit in a few minutes.

There has not been much changes, some typos, doc and rename of some properties. I am confident it still works, but I'd be glad if someone could give it a try so I am sure it still fixes the T480s.

Comment 37 Michael 2018-10-12 20:14:22 UTC
Works fine :-)!

Comment 38 Mihai Harpau 2018-10-12 22:17:28 UTC
Created attachment 1493437 [details]
libinput record, T480s, logs from kernel-4.18.13-201 patched with elan_i2c_v2

It works really nice :)

Comment 39 barish 2018-10-12 23:01:58 UTC
(In reply to Benjamin Tissoires from comment #36)
> Created attachment 1493337 [details]
> elan_i2c_v2.patch
> 
> Here is the updated (hopefully final) patch that I am going to submit in a
> few minutes.
> 
> There has not been much changes, some typos, doc and rename of some
> properties. I am confident it still works, but I'd be glad if someone could
> give it a try so I am sure it still fixes the T480s.

Awesome! Took me a hot minute to learn how to compile a kernel but this patch did the trick thank you!

Comment 40 franciserol 2018-10-18 13:57:35 UTC
Hi, 

Need some help.  I currently use a thinkpad P52 and have run into the issue where touchpad completely stops working on any 4.18 kerenel to get around the issue I had been using a 4.17 kernel.  This morning after updating I know no longer have the 4.17 kernel and instead 3 4.18 kernels to choose from.  The latest kernel 4.18.13.200.fc38.x86_64 this issue is still present.  Touchpad not working at all.  I no longer have a 4.17 kernel to revert back to.  Please any assistance would be greatly appreciated.

Comment 41 Benjamin Tissoires 2018-10-18 14:01:54 UTC
(In reply to franciserol from comment #40)
> Need some help.  I currently use a thinkpad P52 and have run into the issue
> where touchpad completely stops working on any 4.18 kerenel to get around
> the issue I had been using a 4.17 kernel.  This morning after updating I
> know no longer have the 4.17 kernel and instead 3 4.18 kernels to choose
> from.  The latest kernel 4.18.13.200.fc38.x86_64 this issue is still
> present.  Touchpad not working at all.  I no longer have a 4.17 kernel to
> revert back to.  Please any assistance would be greatly appreciated.

Yep, this is a known issue. I submitted the series upstream this week (https://patchwork.kernel.org/project/linux-input/list/?series=30187) and I need to send a v2 based from the reviews. When this gets upstream, we will ask the fedora maintainers to take the patches in the v4.18 series, but we can't really backport patches that are not accepted upstream yet.

Apologies for the inconvenience.

Comment 42 franciserol 2018-10-18 14:10:42 UTC
ok thx Benjamin will probably have to switch to using my old macbook pro till this is resolved.

Comment 43 barish 2018-10-18 18:19:15 UTC
(In reply to franciserol from comment #42)
> ok thx Benjamin will probably have to switch to using my old macbook pro
> till this is resolved.

If you're not able to build your own patched kernel, you can use koji to download the last 4.17 kernel and its associate packages. Install the RPM files for kernel, kernel-core, kernel-devel, and kernel-modules

koji download-build kernel-4.17.19-200.fc28 -a x86_64

Comment 44 Stefan Becker 2018-11-02 19:58:07 UTC
Got a brand-new P52 yesterday and of course installed the brand-new F29 on it. As F29 only has kernel 4.18 I ran into this issue :-(

(In reply to Benjamin Tissoires from comment #41)
> Yep, this is a known issue. I submitted the series upstream this week
> (https://patchwork.kernel.org/project/linux-input/list/?series=30187) and I

Thanks for the patch series, works like a charm applied on top of the f29 HEAD of the Fedora kernel rpm branch. Any updates about the progress on the patch series, i.e. will it make it to 4.19?

BTW: maybe this will save others some time, here is the scratch build on koji with the rpms: https://koji.fedoraproject.org/koji/taskinfo?taskID=30609175

* Fri Nov 02 2018 Stefan Becker <XXX> 4.18.16-300.p52.1
- Add patches for Lenovo P52 ELAN touchpad (rhbz 1628715)

Comment 45 barish 2018-11-02 20:57:37 UTC
(In reply to Benjamin Tissoires from comment #41)
> (In reply to franciserol from comment #40)
> > Need some help.  I currently use a thinkpad P52 and have run into the issue
> > where touchpad completely stops working on any 4.18 kerenel to get around
> > the issue I had been using a 4.17 kernel.  This morning after updating I
> > know no longer have the 4.17 kernel and instead 3 4.18 kernels to choose
> > from.  The latest kernel 4.18.13.200.fc38.x86_64 this issue is still
> > present.  Touchpad not working at all.  I no longer have a 4.17 kernel to
> > revert back to.  Please any assistance would be greatly appreciated.
> 
> Yep, this is a known issue. I submitted the series upstream this week
> (https://patchwork.kernel.org/project/linux-input/list/?series=30187) and I
> need to send a v2 based from the reviews. When this gets upstream, we will
> ask the fedora maintainers to take the patches in the v4.18 series, but we
> can't really backport patches that are not accepted upstream yet.
> 
> Apologies for the inconvenience.

Hey just piggybacking on Stefan as I've been unable to find time to until I got the email notification, but it's still very time consuming having to rebuild my kernel every time a new one is released. My device is managed by Chef so dnf update is run every 30 minutes in the background and I don't realize I have a new kernel until I reboot and lose right-click again.

Comment 46 Stefan Becker 2018-11-02 22:31:24 UTC
Created attachment 1500694 [details]
Lenovo P52, 4.18.16-300.p52.1.fc29.x86_64 with elan patches included

I now realize that I should have been more precise:

* F29 kernel: trackpad & touchpad on the Lenovo P52 do not work at all
* F29 kernel + elan patches: trackpad & touchpad do work

So for me this is not simply a "missing button functionality".

The only thing that doesn't work is the middle button in the button row below the touchpad. I don't see anything in the evemu record when I press that button.

All other 5 buttons (3 trackpad + left/right touchpad) and single, double, triple, ... tap on the touchpad work OK.

Comment 47 Benjamin Tissoires 2018-11-05 10:12:18 UTC
(In reply to barish from comment #45)
> Hey just piggybacking on Stefan as I've been unable to find time to until I
> got the email notification, but it's still very time consuming having to
> rebuild my kernel every time a new one is released. My device is managed by
> Chef so dnf update is run every 30 minutes in the background and I don't
> realize I have a new kernel until I reboot and lose right-click again.

Again, apologies for the inconvenience. I have been side tracked last week and couldn't get the changes upstream.

Upstream requested a little bit of changes in a v2, but this turned out to be some more deeper changes in the elan_i2c driver. And I want to get this right which explains why I haven't been able to submit a quick v2.

(In reply to Stefan Becker from comment #46)
> The only thing that doesn't work is the middle button in the button row
> below the touchpad. I don't see anything in the evemu record when I press
> that button.

Thanks for bringing this up. I didn't realized the BTN_MIDDLE was not reported. I'll fix that in the v2.

Comment 48 Stefan Becker 2018-11-06 21:36:13 UTC
(In reply to Stefan Becker from comment #46)
> The only thing that doesn't work is the middle button in the button row
> below the touchpad. I don't see anything in the evemu record when I press
> that button.

Strange, I'm still running the same kernel, but now that middle button works! Maybe it depends on the phase of the moon if it works or not....

Comment 49 Stefan Becker 2018-11-06 21:36:14 UTC
(In reply to Stefan Becker from comment #46)
> The only thing that doesn't work is the middle button in the button row
> below the touchpad. I don't see anything in the evemu record when I press
> that button.

Strange, I'm still running the same kernel, but now that middle button works! Maybe it depends on the phase of the moon if it works or not....

Comment 50 Michael 2018-11-17 09:30:49 UTC
Sorry to bother you again, but is there a branch for the kernel where one can checkout the progress? I noticed that nothing has been merged yet to 4.20-rc1/rc2.

Thanks in advance!

Comment 51 Stefan Becker 2018-11-19 17:36:38 UTC
Patch series applies cleanly also on 4.19.2. New scratch build on koji https://koji.fedoraproject.org/koji/taskinfo?taskID=30991677

Comment 52 Romain DEP. 2018-11-24 16:57:38 UTC
Hi Benjamin,

I compiled a 4.20.0-rc3 kernel with your patches applied: https://lkml.org/lkml/2018/10/12/633 and it did a great job at fixing my touchpad,

Any chance to have it backported in f29/4.19?
Thanks for the great work :)

Comment 53 Stefan Becker 2018-12-12 07:57:33 UTC
Patch series applies cleanly on 4.19.8. New scratch build on koji https://koji.fedoraproject.org/koji/taskinfo?taskID=31418467

Comment 54 Stefan Becker 2018-12-12 19:24:50 UTC
@Benjamin I just discovered your new patch series https://patchwork.kernel.org/project/linux-input/list/?series=55699. Is that workaround supposed to be to replace the original series https://patchwork.kernel.org/project/linux-input/list/?series=30187? It is marked for 4.18+ stable, i.e. will it make it to 4.19 and 4.20?

Comment 55 Benjamin Tissoires 2018-12-12 20:54:29 UTC
> @Benjamin I just discovered your new patch series https://patchwork.kernel.org/project/linux-input/list/?series=55699. Is that workaround supposed to be to replace the original series https://patchwork.kernel.org/project/linux-input/list/?series=30187?

Well, depends for which. This series "fixes" the P52 and the P72 that have no touchpad since 4.18. I am still planning on properly fixing the previous series, but I really lack of time to make it happen.

For the t480s, which is this bug, I have asked Peter if he could quirk it in libinput until the kernel fix is in place (https://gitlab.freedesktop.org/libinput/libinput/issues/177)

> It is marked for 4.18+ stable, i.e. will it make it to 4.19 and 4.20?

If this gets accepted by Dmitry (I do not see any reasons why not), it will then be backported in these kernel versions, yes.

These two workarounds should buy me enough time to properly fix the elan_i2c/elantech interactions without having too many drawbacks of switching over an over the driver used by people.

Comment 56 Stefan Becker 2018-12-14 14:48:56 UTC
Workaround for P52 works for me. New scratch build for F29: https://koji.fedoraproject.org/koji/taskinfo?taskID=31456822

Comment 57 barish 2018-12-27 17:41:32 UTC
Was this fix officially resolved and pushed upstream? My T480s with Elan Touchpad suddenly regained right click with two fingers and bottom right corner, running 4.19.10-300.fc29.x86_64. However I have some coworkers with the same laptop who report the issue persists.

Comment 58 Michael 2018-12-27 18:20:51 UTC
The workaround in libinput 1.12.4 solved the problems also on my side!

Do you keep this bug report open to track the progress on the refactored patch for the kernel?

Comment 59 Benjamin Tissoires 2019-01-02 14:52:38 UTC
As mentioned, libinput 1.12.4 has a quirk for the t480s.
Regarding the kernel, I pushed a revert-like for the p52/p72, so now all those three machines should be fine. The patch has been backported to 4.19, so I guess if it's not already in F29, it will be in the next week or so.

The proper kernel support is still on its way, but I think we can close the Fedora bug right now.

Comment 60 Stefan Becker 2019-01-04 06:44:56 UTC
I can confirm that with kernel-4.19.13-300.fc29.x86_64 TrackPoint & Touchpad including all 6 buttons work OOTB on my Lenovo P52.

Comment 62 Pascal 2019-02-02 09:30:06 UTC
(In reply to Benjamin Tissoires from comment #59)
> As mentioned, libinput 1.12.4 has a quirk for the t480s.
> Regarding the kernel, I pushed a revert-like for the p52/p72, so now all
> those three machines should be fine. The patch has been backported to 4.19,
> so I guess if it's not already in F29, it will be in the next week or so.
> 
> The proper kernel support is still on its way, but I think we can close the
> Fedora bug right now.

Hello Benjamin,

i have to come back to this issue one more time. It seems that all the P50/P70s and the T480s work fine for now. But you forgot about my ThinkPad L380 Yoga, which has the same issue (Touchpad does not get recognized as a ClickPad).

I recently upgraded to Fedora 29 running Kernel 4.20.5. My right click still does not work though. The patches you posted earlier work fine for me, but i don't want to recompile this every time on my own machine. So i looked into the quirk which got applied to libinput and also added a similiar case for my L380 Yoga. After building this custom version though, my right click still does not work. I looked into the report of 'libinput debug-events' and found this message:

event16 - Elan Touchpad: kernel bug: clickpad advertising right button

Can you help me to get my ThinkPad L380 Yoga to work?

Comment 63 Pascal 2019-02-02 10:03:17 UTC
Created attachment 1526247 [details]
libinput records for two versions of libinput

I attached you the libinput record for the standard libinput 1.12.6 and my custom version with a quirk added for the L380 in a similar fashion to this: https://gitlab.freedesktop.org/libinput/libinput/merge_requests/137/diffs

Both show an Event code for the BTN_RIGHT which should not be there. So it still does not get recognized correctly as a ClickPad.

Comment 64 Ed Ceaser 2019-02-15 17:51:42 UTC
What is currently blocking this from being merged into the Kernel? I have to keep reapplying this patch even on 4.20.8 -- the kernel bug linked in this thread appears to be a different issue, at least from the comments there. Does someone need to actually file a bug for the T480s (et al) touchpad issue to get this finally merged?

Comment 65 Jacek 2019-08-21 22:56:27 UTC
Was it already patched in kernel and merged?
If it was - which version of kernel was the first with this patch merged?
I'm having similar problems on other distro on kernel 5.2.9 with some HP Pavilion's touchpad and created libinput quirk which is basicly the same as quirks for this clickpad.


Note You need to log in before you can comment on or make changes to this bug.