]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - pending-5.1/hid-multitouch-handle-faulty-elo-touch-device.patch
move existing queues out of the way for the moment...
[thirdparty/kernel/stable-queue.git] / pending-5.1 / hid-multitouch-handle-faulty-elo-touch-device.patch
1 From 81bcbad53bab4bf9f200eda303d7a05cdb9bd73b Mon Sep 17 00:00:00 2001
2 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
3 Date: Tue, 21 May 2019 15:38:31 +0200
4 Subject: HID: multitouch: handle faulty Elo touch device
5
6 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
7
8 commit 81bcbad53bab4bf9f200eda303d7a05cdb9bd73b upstream.
9
10 Since kernel v5.0, one single win8 touchscreen device failed.
11 And it turns out this is because it reports 2 InRange usage per touch.
12
13 It's a first, and I *really* wonder how this was allowed by Microsoft in
14 the first place. But IIRC, Breno told me this happened *after* a firmware
15 upgrade...
16
17 Anyway, better be safe for those crappy devices, and make sure we have
18 a full slot before jumping to the next.
19 This won't prevent all crappy devices to fail here, but at least we will
20 have a safeguard as long as the contact ID and the X and Y coordinates
21 are placed in the report after the grabage.
22
23 Fixes: 01eaac7e5713 ("HID: multitouch: remove one copy of values")
24 CC: stable@vger.kernel.org # v5.0+
25 Reported-and-tested-by: Breno Leitao <leitao@debian.org>
26 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
27 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30 ---
31 drivers/hid/hid-multitouch.c | 7 +++++++
32 1 file changed, 7 insertions(+)
33
34 --- a/drivers/hid/hid-multitouch.c
35 +++ b/drivers/hid/hid-multitouch.c
36 @@ -641,6 +641,13 @@ static void mt_store_field(struct hid_de
37 if (*target != DEFAULT_TRUE &&
38 *target != DEFAULT_FALSE &&
39 *target != DEFAULT_ZERO) {
40 + if (usage->contactid == DEFAULT_ZERO ||
41 + usage->x == DEFAULT_ZERO ||
42 + usage->y == DEFAULT_ZERO) {
43 + hid_dbg(hdev,
44 + "ignoring duplicate usage on incomplete");
45 + return;
46 + }
47 usage = mt_allocate_usage(hdev, application);
48 if (!usage)
49 return;