Skip to contentSkip to conversation

Input: wacom_w8001 - Ignore invalid pen data packets

PATCH Applied Ping Cheng 3 participants 3 messages May 24, 2016 – Jun 23, 2016

Subsystems (2)
lore
Share & tools
lore

Ping Cheng

author
#0 lore raw

PATCH 2/2 Input: wacom_w8001 - Ignore invalid pen data packets

ThinkPad X60 Tablet PC (pen only device) sometime posts packets that are larger than W8001_PKTLEN_TPCPEN.

---
 drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/input/touchscreen/wacom_w8001.c +9 -0
index b1b4127..d5dcda2 100644
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
 		w8001->idx = 0;
 		parse_multi_touch(w8001);
 		break;
+
+	default:
+		/*
+		 * ThinkPad X60 Tablet PC (pen only device) sometime sends
+		 * invalid data packets that are larger than W8001_PKTLEN_TPCPEN.
+		 * Let's start over again.
+		 */
+		if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
+			w8001->idx = 0;
 	}
 
 	return IRQ_HANDLED;
Signature · 1 line
1.9.1
Reviewed-by on v1 2/2
#1 lore raw
Quoted 6 lines · Ping Cheng

ThinkPad X60 Tablet PC (pen only device) sometime posts packets that are larger than W8001_PKTLEN_TPCPEN.

Cheers,
Peter

Quoted 26 lines
---
 drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/input/touchscreen/wacom_w8001.c +9 -0
index b1b4127..d5dcda2 100644
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
 		w8001->idx = 0;
 		parse_multi_touch(w8001);
 		break;
+
+	default:
+		/*
+		 * ThinkPad X60 Tablet PC (pen only device) sometime sends
+		 * invalid data packets that are larger than W8001_PKTLEN_TPCPEN.
+		 * Let's start over again.
+		 */
+		if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
+			w8001->idx = 0;
 	}
 
 	return IRQ_HANDLED;
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw
Quoted 9 lines · Peter Hutterer
Quoted 6 lines · Ping Cheng

ThinkPad X60 Tablet PC (pen only device) sometime posts packets that are larger than W8001_PKTLEN_TPCPEN.

Applied, thank you.

Quoted 31 lines

Cheers,
Peter

Quoted 26 lines
---
 drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/input/touchscreen/wacom_w8001.c +9 -0
index b1b4127..d5dcda2 100644
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
 		w8001->idx = 0;
 		parse_multi_touch(w8001);
 		break;
+
+	default:
+		/*
+		 * ThinkPad X60 Tablet PC (pen only device) sometime sends
+		 * invalid data packets that are larger than W8001_PKTLEN_TPCPEN.
+		 * Let's start over again.
+		 */
+		if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
+			w8001->idx = 0;
 	}
 
 	return IRQ_HANDLED;
Signature · 1 line
1.9.1
Signature · 1 line
Dmitry