Skip to contentSkip to conversation

backport: Input: wacom_w8001 - w8001_MAX_LENGTH should be 13

PATCH In review Aaron Armstrong Skomra 2 participants 3 messages Jul 13, 2016 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/4 backport: Input: wacom_w8001 - w8001_MAX_LENGTH should be 13

Somehow the patch that added two-finger touch support forgot to update W8001_MAX_LENGTH from 11 to 13.

[[email protected]: Imported into input-wacom repository (12afb34)]
[[email protected]: backported from input-wacom repository (d1906df)]
---
 2.6.30/wacom_w8001.c | 2 +-
 2.6.36/wacom_w8001.c | 2 +-
 2.6.38/wacom_w8001.c | 2 +-
 3.7/wacom_w8001.c    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
2.6.30/wacom_w8001.c +1 -1
index 15e401e..134dac5 100755
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Jaya Kumar <[email protected]>");
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-#define W8001_MAX_LENGTH	11
+#define W8001_MAX_LENGTH	13
 #define W8001_LEAD_MASK		0x80
 #define W8001_LEAD_BYTE		0x80
 #define W8001_TAB_MASK		0x40
2.6.36/wacom_w8001.c +1 -1
index 03db1de..34414a8 100755
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Jaya Kumar <[email protected]>");
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-#define W8001_MAX_LENGTH	11
+#define W8001_MAX_LENGTH	13
 #define W8001_LEAD_MASK		0x80
 #define W8001_LEAD_BYTE		0x80
 #define W8001_TAB_MASK		0x40
2.6.38/wacom_w8001.c +1 -1
index 1a33fad..ed04bb9 100644
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Jaya Kumar <[email protected]>");
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-#define W8001_MAX_LENGTH	11
+#define W8001_MAX_LENGTH	13
 #define W8001_LEAD_MASK		0x80
 #define W8001_LEAD_BYTE		0x80
 #define W8001_TAB_MASK		0x40
3.7/wacom_w8001.c +1 -1
index bab3c6a..b1b4127 100644
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Jaya Kumar <[email protected]>");
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-#define W8001_MAX_LENGTH	11
+#define W8001_MAX_LENGTH	13
 #define W8001_LEAD_MASK		0x80
 #define W8001_LEAD_BYTE		0x80
 #define W8001_TAB_MASK		0x40
Signature · 1 line
1.9.1
maintainer
#2 lore raw
Quoted 11 lines · Aaron Armstrong Skomra

Somehow the patch that added two-finger touch support forgot to update W8001_MAX_LENGTH from 11 to 13.

[[email protected]: Imported into input-wacom repository (12afb34)]
[[email protected]: backported from input-wacom repository (d1906df)]
Quoted 6 lines
---
 2.6.30/wacom_w8001.c | 2 +-
 2.6.36/wacom_w8001.c | 2 +-
 2.6.38/wacom_w8001.c | 2 +-
 3.7/wacom_w8001.c    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Please be more careful with git and prevent it from sending stuff to people and mailing lists you don't mean to...

greg k-h

#3 lore raw

PATCH 3/4 backport: Input: wacom_w8001 - ignore invalid pen data packets

In reply to a message not in the archive

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

NOTE: The w8001 struct has no touch_dev member in 2.6.36 or 2.6.30.

[[email protected]: Imported into input-wacom repository (9e72ac7)]
[[email protected]: backported from input-wacom repository (0ae81e81)]
---
 2.6.38/wacom_w8001.c | 9 +++++++++
 3.7/wacom_w8001.c    | 9 +++++++++
 2 files changed, 18 insertions(+)
2.6.38/wacom_w8001.c +9 -0
index ed04bb9..de7b8ef 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) sometimes
+		 * 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;
3.7/wacom_w8001.c +9 -0
index b1b4127..0c9191c 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) sometimes
+		 * 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