FS#77733 - "-funsigned-char" fallout - FocalTech Touchpad multi finger actions erratic behaviour

Attached to Project: Arch Linux
Opened by Barry (smukie) - Sunday, 05 March 2023, 17:52 GMT
Last edited by Toolybird (Toolybird) - Saturday, 10 June 2023, 03:10 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:

After upgrading to kernel 6.2.1 any action that involves having more than 1 finger on the touchpad causes the mouse pointer to jump erratically up and/or to the right. So when I use a single finger to move the pointer, tap to click or edge scrolling everything works as expected. When I use 2 finger scrolling or click and hold the pad button and then with another finger try to move the pointer such as for moving/resizing a window or selecting text the pointer jumps around making it impossible to use any of these functions. Booting to the lts kernel 6.1.15 all of the 2 finger functionality works exactly as expected.


Additional info:
* package version(s) Linux-6.2.1, Linux-6.2.2
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:

On a laptop with a FocalTechPS/2 FocalTech Touchpad install either kernel 6.2.1 or 6.2.2.
Try to move or resize a window with click and hold.
Try to scroll a window using 2 finger scrolling
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 10 June 2023, 03:10 GMT
Reason for closing:  Fixed
Comment by Toolybird (Toolybird) - Monday, 06 March 2023, 06:17 GMT
It sounds like an unfortunate kernel regression. The focaltech driver [1] hasn't been touched in years, so the problem must be in some other part of the input subsystem. General advice for kernel regressions here [2]. You might have to report it upstream. Please let us know what you find out.

[1] https://github.com/archlinux/linux/blob/master/drivers/input/mouse/focaltech.c
[2] https://wiki.archlinux.org/title/Kernel#Debugging_regressions
Comment by Barry (smukie) - Monday, 06 March 2023, 20:58 GMT
I'll have a go at debugging.
Comment by Keith (keithg) - Sunday, 12 March 2023, 20:43 GMT
I confirm that this affects me as well. Also note that booting kernel 6.1.9 fixes the issue for me. I did a quick search on the kernel and I could not find any mention of this regression. I am not in a position to troubleshoot this regression as this is not my personal computer but that of a family member that I periodically maintain. I just want to make sure that the kernel team is aware of this regression. What steps can/should I take?
Comment by Barry (smukie) - Tuesday, 14 March 2023, 16:39 GMT
I've almost completed bisecting the kernel (takes 5 hours to compile on my machine). Then I'll raise it on the kernel bugzilla. 6.2.0 appears to be the first broken release. I have 1 more bisect cycle to complete in order to identify the broken commit.
Comment by Barry (smukie) - Friday, 17 March 2023, 14:03 GMT Comment by loqs (loqs) - Friday, 17 March 2023, 16:45 GMT
What if you change most uses of char to signed char in drivers/input/mouse/focaltech.c ? As in the attached patch which is applied in kernel linked below:

https://drive.google.com/file/d/1HECFPQkeamoIYEIZkl0zqCJz8QcaZ5ug/view?usp=share_link linux-6.2.6.arch1-1.1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1EY4SZ0sh9yNvumJdlIUR83xp9muBn3lR/view?usp=share_link linux-headers-6.2.6.arch1-1.1-x86_64.pkg.tar.zst
Comment by Barry (smukie) - Saturday, 18 March 2023, 01:10 GMT
I've applied the attached patch and rebuilt the kernel from source and can confirm that the patch resolves the issue.
Comment by Toolybird (Toolybird) - Saturday, 18 March 2023, 21:33 GMT
Good work on the bisection! This might explain a few other kernel bugs we've seen lately. FTR here's the link [1]

[1] https://github.com/archlinux/linux/commit/3bc753c06dd02a3517c9b498e3846ebfc94ac3ee
Comment by Toolybird (Toolybird) - Saturday, 18 March 2023, 21:39 GMT
Dupe  FS#77829 
Comment by loqs (loqs) - Saturday, 18 March 2023, 22:10 GMT
@smukie here is an updated version of the patch to try. This one reduces the number of casts slightly. If it is going to take you too long to test it I would not bother.

I would suggest on the kernel bug report adding to the CC list:
Dmitry Torokhov <dmitry.torokhov@gmail.com> (maintainer:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...)
and possibly consider also adding:
Hans de Goede <hdegoede@redhat.com> (added the focaltech driver to the kernel)
Jason A. Donenfeld <Jason@zx2c4.com> (authored the breaking commit)
Comment by Barry (smukie) - Sunday, 19 March 2023, 21:11 GMT
Tested the new patch and it also works fine.
Comment by loqs (loqs) - Sunday, 19 March 2023, 21:31 GMT

Loading...