Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch cause Cintiq Pro 32 Touch to randomly lose pen input unless disable with physical button #146

Closed
tysontan opened this issue Jan 25, 2020 · 21 comments

Comments

@tysontan
Copy link

tysontan commented Jan 25, 2020

I recently noticed an oddity on my Cintiq Pro 32 Touch. The pen display would randomly lose pen input completely when touch is enabled. The only workaround is to disable touch sensitivity using the physical button on the face of the display.

Although I can also disable touch in Linux driver, doing so would not prevent the problem from happening.

Extensive tests have been conducted, changing every possible thing on the BIOS settings, port arrangement, Linux driver settings ... to no effect.

It doesn't happen on my Cintiq Pro 24 (no touch), it doesn't happen under Windows. But it happens under Gnome (wayland), and KDE Plasma (xorg).

My distro is Manjaro 18.1.5, Linux 5.4. AMDGPU Polaris 10/11 cards, tested on C232 / C236 / Z370 / Z390 motherboards, Wacom Link Plus. The Cintiq Pro 32 Touch is a special model for China, it has only USB type-C input, Wacom Link Plus is required to use this product on a desktop PC, although it wasn't shipped with one. -_-

This bug must have been around for quite some time. The memory of horror goes way back in time, although I didn't draw so often back then to notice the pattern.

@tattsan
Copy link

tattsan commented Feb 7, 2020

Same here. I use Cintiq Pro 32 on ThinkPad X1 Carbon gen3, with Arch Linux.
This problem has been seen since kernel 5.3.x, so I used 5.2.14 for a while.

@jigpu
Copy link
Member

jigpu commented Feb 7, 2020

@tattsan can you let us know if you are also using one of the China models? If not, are you also using USB-C or using the USB-A / DisplayPort connections instead?

@tattsan
Copy link

tattsan commented Feb 7, 2020

My Cintiq Pro 32 has DisplayPort, HDMI, USB-A, USB-C ports. I am using USB-A / DisplayPort connection.

I don't need touch function, so I always disable it by touch key panel. But every time I start the tablet up, it is enabled;-)

@dnisyd
Copy link

dnisyd commented Feb 21, 2020

I have a similiar problem on my Wacom Intuos Pro S when using bluetooth. I am resting my palm on the tablet while having the pen close to the surface and sometimes it recognizes touch instead of the pen. It sounds similiar to the problem described here. It does not occur when I am using it wired with usb-c.

Up-to-date input-wacom-dkms from git repository here and am on Arch Linux with Kernel 5.5.4

@tysontan
Copy link
Author

tysontan commented Feb 21, 2020

@dantempla No, It's a totally different thing. You situation is exactly how the device should normally behave. Palm rejection depends on touch sensitivity and stylus height, human cannot sense or control how high exactly the stylus is off the surface so the pen goes in or out the range as your hands moving. It'll never be reliable.

I guess the reason you found it happens more on Bluetooth is either because the stylus maximum height range is lower on Bluetooth mode, or because in BT mode the report rate is so low that the stylus input events went missing in a few ms and the driver switched to use touch input event.

The bug we are discussing here, does not require the hand or the pen to be placed on the surface to trigger. It happens randomly as long as the touch function is ON. When it happens, the pen input is completely dead, and it'll stay dead until it randomly decided to come back.

@dnisyd
Copy link

dnisyd commented Feb 21, 2020

@tysontan Oh, okay. I understand and thank you for the guesses on my problem, they sound reasonable. The problem does not occur on Windows 10, so I guess it must be a software thing.

@tysontan
Copy link
Author

I used the scripts from @jigpu (https://gist.githubusercontent.com/jigpu/b7b47e4bede584cec8562f666fd84af4/raw/af36c0a0fc2c019750472443369915ad7ea97737/capture.sh) to capture a log when the bug was triggered. On Arch you need to install the foloowing package to run the script:

  1. evemu
  2. hid-tools

During the capture, pen input stay dead for most of the time until it got back to life in the last few seconds. Here is the captured file:
record_1582336262.tar.gz

@tattsan maybe you can also attempt the capture so we have more data? Thanks!

@tysontan
Copy link
Author

tysontan commented Feb 22, 2020

Additionally, I found out that even after turning OFF Touch by using the physical button, the pen input would still die at rare occasions. It's much less frequent than leaving the Touch is ON though.

Now my Linux kernel is 5.5.2. But probably unrelated. It might just be me drawing all day recently, and as a result, easier to notice when the pen input suddenly dies.

@tattsan
Copy link

tattsan commented Feb 22, 2020

Thanks @tysontan ! I will try that script.
I hadn't seen this bug when I was using kernel 5.2.14 or older, and came across it when I upgraded the kernel to 5.3.

@tattsan
Copy link

tattsan commented Feb 22, 2020

Here is my log:
record_1582354444.tar.gz

I waited until the pen is recognized again, but the pen did't came back.

@tattsan
Copy link

tattsan commented Feb 22, 2020

The above record_1582354444.*.log are logs of the Pen device.
I also recorded the Touch device, here is the archive:
record_1582357476.tar.gz

@jigpu
Copy link
Member

jigpu commented Feb 24, 2020

Thanks @tysontan. Looks like we're still getting valid data from the tablet at the beginning of the log, but no events are leaving the kernel. This smells a lot like touch state corruption, which could make the kernel accidentally enable arbitration when it shouldn't. I know I wrote a script to find corruption in the touch logs, but I'm not sure where I left it... Hopefully I don't have to end up re-writing it...

@jigpu
Copy link
Member

jigpu commented Mar 5, 2020

Made a bit of progress on this. I've built a tool to monitor the status of multitouch devices to see when the touch state gets corrupted and used this to find a minimal HID recording which triggers the bug (below). Together, this has allowed me to bisect the problem to commit 13b5f03

The issue seems to be with how we're counting the number of expected touches, and this commit definitely changes that behavior, so I'll see if I can understand what is wrong.

D: 0
R: 833 06 00 ff 09 01 a1 01 75 08 26 ff 00 15 00 85 06 95 3f 09 01 91 02 85 05 95 3f 09 01 81 02 c0 05 0d 09 04 a1 01 85 81 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 75 08 09 51 95 01 81 02 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 56 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 81 02 09 54 95 01 75 08 15 00 25 0a 81 02 09 55 85 84 95 01 75 08 15 00 25 0a b1 02 85 87 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 04 a1 01 85 88 09 22 a1 02 09 42 15 00 25 01 75 01 95 01 81 02 95 07 81 03 05 01 65 11 55 0e 35 00 46 43 1b 26 00 3c 75 10 95 01 09 30 81 02 46 56 0f 26 c0 21 09 31 81 02 c0 05 0d 09 56 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 81 02 c0 05 0d 09 0e a1 01 85 83 09 23 a1 02 09 52 09 53 15 00 25 0a 75 08 95 02 b1 02 c0 c0
N: Wacom Co., Ltd. Cintiq Pro 32 Touch
P: usb-0000:00:14.0-4.4.3.1/input0
I: 3 056a 0356
D: 0
E: 64.058422 64 81 01 00 8d 0d 17 13 01 01 aa 0f ff 0f 01 02 23 13 ca 0e 01 03 29 19 67 16 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 60 08 04
E: 64.063657 64 81 00 00 8d 0d 17 13 01 01 bb 0f f7 0f 01 02 2a 13 cb 0e 01 03 23 19 64 16 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 97 08 04
E: 64.069584 64 81 01 01 da 0f ea 0f 01 02 32 13 cc 0e 00 03 23 19 64 16 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff cd 08 03
E: 64.074451 64 81 01 01 fb 0f dd 0f 01 02 3b 13 cd 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 03 09 02
E: 64.079446 64 81 01 01 27 10 cf 0f 01 02 45 13 ce 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3a 09 02
E: 64.085413 64 81 01 01 4f 10 c6 0f 01 02 51 13 d1 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 70 09 02
E: 64.090428 64 81 01 01 7b 10 c0 0f 01 02 5d 13 d4 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff a6 09 02
E: 64.096749 64 81 01 01 93 10 c0 0f 01 02 70 13 d9 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff dd 09 02
E: 64.101632 64 81 00 01 93 10 c0 0f 01 02 7f 13 df 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 13 0a 02
E: 64.107450 64 81 00 02 7f 13 df 0e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 49 0a 01

jigpu added a commit to jigpu/input-wacom that referenced this issue Mar 23, 2020
… per collection basis"

This reverts commit 15893fa40109f5e7c67eeb8da62267d0fdf0be9d.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Ref: linuxwacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Fixes: 15893fa40109 ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
@jigpu
Copy link
Member

jigpu commented Mar 23, 2020

I've spent a long time looking at this issue and I think the best way forward is to revert the buggy commit and then potentially revisit the feature it was introducing at a later time. I've pushed up a new branch to my repository which contains the revert as well as another touch-related fix.

Follow the instructions to build the driver. Instead of downloading the latest driver release, however, run the following two commands to check out the branch with the fix:

git clone https://github.com/jigpu/input-wacom
git checkout touch-fixes

Please let me know if this branch fixes the behavior for you. I'll be submitting these fixes upstream once I get the green light from you and after finishing my own final tests.

jigpu added a commit to jigpu/input-wacom that referenced this issue Mar 23, 2020
… per collection basis"

This reverts commit 15893fa40109f5e7c67eeb8da62267d0fdf0be9d.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Ref: linuxwacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa40109 ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
@tysontan
Copy link
Author

Thank you Jason! I'm rushing some tasks at the moment. I will test it a bit later and report back to you.

@tattsan
Copy link

tattsan commented Apr 5, 2020

Thank you so mutch. I built and installed the module yesterday, with no trouble for now.
I will continue testing the module.

@tysontan
Copy link
Author

tysontan commented Apr 5, 2020

Thank you tattsan!

I've been testing the patch today as well. So far I haven't noticed any problem. Please give me a few more days so that I can be absolutely sure of it.

@tysontan
Copy link
Author

tysontan commented Apr 8, 2020

After using the patched version heavily for a few days, I never noticed any problem. I think it's safe. Thank you again jigpu!

@jigpu
Copy link
Member

jigpu commented Apr 8, 2020

Thanks for the thorough testing @tysontan and @tattsan. I've just sent the patch upstream and will let you know when its been accepted.

@tattsan
Copy link

tattsan commented Apr 9, 2020

I've also been with no troubles too. Thank you!

ruscur pushed a commit to ruscur/linux that referenced this issue Apr 17, 2020
… per collection basis"

This reverts commit 15893fa.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: linuxwacom/input-wacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
jigpu added a commit that referenced this issue Apr 30, 2020
… per collection basis"

This reverts commit 15893fa40109f5e7c67eeb8da62267d0fdf0be9d.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: #146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa40109 ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[jason.gerecke@wacom.com: Imported into input-wacom (b43f977dd281)]
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
jigpu added a commit that referenced this issue Apr 30, 2020
…uches on a per collection basis"

This reverts commit 15893fa40109f5e7c67eeb8da62267d0fdf0be9d.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: #146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa40109 ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[jason.gerecke@wacom.com: Imported into input-wacom (b43f977dd281)]
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
[jason.gerecke@wacom.com: Backported from input-wacom (f4a09e4)]
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
MilhouseVH pushed a commit to MilhouseVH/linux that referenced this issue May 14, 2020
… per collection basis"

commit b43f977 upstream.

This reverts commit 15893fa.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: linuxwacom/input-wacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
woodsts pushed a commit to woodsts/linux-stable that referenced this issue May 14, 2020
… per collection basis"

commit b43f977 upstream.

This reverts commit 15893fa.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: linuxwacom/input-wacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cmaiolino pushed a commit to cmaiolino/linux that referenced this issue Jun 1, 2020
… per collection basis"

This reverts commit 15893fa.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: linuxwacom/input-wacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/linux-mvista that referenced this issue Jun 4, 2020
… per collection basis"

Source: kernel.org
MR: 103894
Type: Integration
Disposition: Merged from git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable linux-5.4.y
ChangeID: 1017955fab5b3cc18a3881719ebe56bc7c6e6b1b
Description:

commit b43f977 upstream.

This reverts commit 15893fa.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: linuxwacom/input-wacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
cesfahani pushed a commit to cesfahani/ubuntu-focal-ga401i that referenced this issue Jun 24, 2020
… per collection basis"

BugLink: https://bugs.launchpad.net/bugs/1878649

commit b43f977dd281945960c26b3ef67bba0fa07d39d9 upstream.

This reverts commit 15893fa.

The referenced commit broke pen and touch input for a variety of devices
such as the Cintiq Pro 32. Affected devices may appear to work normally
for a short amount of time, but eventually loose track of actual touch
state and can leave touch arbitration enabled which prevents the pen
from working. The commit is not itself required for any currently-available
Bluetooth device, and so we revert it to correct the behavior of broken
devices.

This breakage occurs due to a mismatch between the order of collections
and the order of usages on some devices. This commit tries to read the
contact count before processing events, but will fail if the contact
count does not occur prior to the first logical finger collection. This
is the case for devices like the Cintiq Pro 32 which place the contact
count at the very end of the report.

Without the contact count set, touches will only be partially processed.
The `wacom_wac_finger_slot` function will not open any slots since the
number of contacts seen is greater than the expectation of 0, but we will
still end up calling `input_mt_sync_frame` for each finger anyway. This
can cause problems for userspace separate from the issue currently taking
place in the kernel. Only once all of the individual finger collections
have been processed do we finally get to the enclosing collection which
contains the contact count. The value ends up being used for the *next*
report, however.

This delayed use of the contact count can cause the driver to loose track
of the actual touch state and believe that there are contacts down when
there aren't. This leaves touch arbitration enabled and prevents the pen
from working. It can also cause userspace to incorrectly treat single-
finger input as gestures.

Link: linuxwacom/input-wacom#146
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 15893fa ("HID: wacom: generic: read the number of expected touches on a per collection basis")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
@Pinglinux
Copy link
Member

Patch has been reverted upstream and in input-wacom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants