Skip to contentSkip to conversation

HID: multitouch: handle faulty Elo touch device

PATCH In review Benjamin Tissoires 2 participants 3 messages May 21, 2019 – May 22, 2019 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: multitouch: handle faulty Elo touch device

Since kernel v5.0, one single win8 touchscreen device failed. And it turns out this is because it reports 2 InRange usage per touch.

It's a first, and I *really* wonder how this was allowed by Microsoft in the first place. But IIRC, Breno told me this happened *after* a firmware upgrade...

Anyway, better be safe for those crappy devices, and make sure we have a full slot before jumping to the next.
This won't prevent all crappy devices to fail here, but at least we will have a safeguard as long as the contact ID and the X and Y coordinates are placed in the report after the grabage.

---
 drivers/hid/hid-multitouch.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hid/hid-multitouch.c +7 -0
index ef635964cfe1..a344a3cf5398 100644
@@ -642,6 +642,13 @@ static void mt_store_field(struct hid_device *hdev,
 	if (*target != DEFAULT_TRUE &&
 	    *target != DEFAULT_FALSE &&
 	    *target != DEFAULT_ZERO) {
+		if (usage->contactid == DEFAULT_ZERO ||
+		    usage->x == DEFAULT_ZERO ||
+		    usage->y == DEFAULT_ZERO) {
+			hid_dbg(hdev,
+				"ignoring duplicate usage on incomplete");
+			return;
+		}
 		usage = mt_allocate_usage(hdev, application);
 		if (!usage)
 			return;
Signature · 1 line
2.19.2
#1 lore raw
Quoted 8 lines · Benjamin Tissoires

Since kernel v5.0, one single win8 touchscreen device failed. And it turns out this is because it reports 2 InRange usage per touch.

It's a first, and I *really* wonder how this was allowed by Microsoft in the first place. But IIRC, Breno told me this happened *after* a firmware upgrade...

Quoted 5 lines

Anyway, better be safe for those crappy devices, and make sure we have a full slot before jumping to the next.
This won't prevent all crappy devices to fail here, but at least we will have a safeguard as long as the contact ID and the X and Y coordinates are placed in the report after the grabage.

Grmbl, I forgot:

Fixes 01eaac7e5713 ("HID: multitouch: remove one copy of values")

Cheers,
Benjamin

Quoted 28 lines
---
 drivers/hid/hid-multitouch.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hid/hid-multitouch.c +7 -1
index ef635964cfe1..a344a3cf5398 100644
@@ -642,6 +642,13 @@ static void mt_store_field(struct hid_device *hdev,
        if (*target != DEFAULT_TRUE &&
            *target != DEFAULT_FALSE &&
            *target != DEFAULT_ZERO) {
+               if (usage->contactid == DEFAULT_ZERO ||
+                   usage->x == DEFAULT_ZERO ||
+                   usage->y == DEFAULT_ZERO) {
+                       hid_dbg(hdev,
+                               "ignoring duplicate usage on incomplete");
+                       return;
+               }
                usage = mt_allocate_usage(hdev, application);
                if (!usage)
                        return;
--

2.19.2

maintainer
#2 lore raw
Quoted 16 lines · Benjamin Tissoires
Quoted 8 lines · Benjamin Tissoires

Since kernel v5.0, one single win8 touchscreen device failed. And it turns out this is because it reports 2 InRange usage per touch.

It's a first, and I *really* wonder how this was allowed by Microsoft in the first place. But IIRC, Breno told me this happened *after* a firmware upgrade...

Quoted 5 lines

Anyway, better be safe for those crappy devices, and make sure we have a full slot before jumping to the next.
This won't prevent all crappy devices to fail here, but at least we will have a safeguard as long as the contact ID and the X and Y coordinates are placed in the report after the grabage.

Quoted 3 lines

Grmbl, I forgot:

Fixes 01eaac7e5713 ("HID: multitouch: remove one copy of values")

I've now pushed this to for-5.2/fixes. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs