linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets
@ 2016-05-24  3:04 Ping Cheng
  2016-05-24  5:04 ` Peter Hutterer
  0 siblings, 1 reply; 3+ messages in thread
From: Ping Cheng @ 2016-05-24  3:04 UTC (permalink / raw)
  To: linux-input, dmitry.torokhov
  Cc: peter.hutterer, benjamin.tissoires, Ping Cheng

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

Reported-by: Chris J Arges <christopherarges@gmail.com>
Tested-by: Chris J Arges <christopherarges@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index b1b4127..d5dcda2 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -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;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets
  2016-05-24  3:04 [PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets Ping Cheng
@ 2016-05-24  5:04 ` Peter Hutterer
  2016-06-23 18:00   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Hutterer @ 2016-05-24  5:04 UTC (permalink / raw)
  To: Ping Cheng; +Cc: linux-input, dmitry.torokhov, benjamin.tissoires, Ping Cheng

On Mon, May 23, 2016 at 08:04:27PM -0700, Ping Cheng wrote:
> ThinkPad X60 Tablet PC (pen only device) sometime posts
> packets that are larger than W8001_PKTLEN_TPCPEN.
> 
> Reported-by: Chris J Arges <christopherarges@gmail.com>
> Tested-by: Chris J Arges <christopherarges@gmail.com>
> Signed-off-by: Ping Cheng <pingc@wacom.com>

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

Cheers,
   Peter

> ---
>  drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
> index b1b4127..d5dcda2 100644
> --- a/drivers/input/touchscreen/wacom_w8001.c
> +++ b/drivers/input/touchscreen/wacom_w8001.c
> @@ -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;
> -- 
> 1.9.1
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets
  2016-05-24  5:04 ` Peter Hutterer
@ 2016-06-23 18:00   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2016-06-23 18:00 UTC (permalink / raw)
  To: Peter Hutterer; +Cc: Ping Cheng, linux-input, benjamin.tissoires, Ping Cheng

On Tue, May 24, 2016 at 03:04:35PM +1000, Peter Hutterer wrote:
> On Mon, May 23, 2016 at 08:04:27PM -0700, Ping Cheng wrote:
> > ThinkPad X60 Tablet PC (pen only device) sometime posts
> > packets that are larger than W8001_PKTLEN_TPCPEN.
> > 
> > Reported-by: Chris J Arges <christopherarges@gmail.com>
> > Tested-by: Chris J Arges <christopherarges@gmail.com>
> > Signed-off-by: Ping Cheng <pingc@wacom.com>
> 
> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

Applied, thank you.

> 
> Cheers,
>    Peter
> 
> > ---
> >  drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
> > index b1b4127..d5dcda2 100644
> > --- a/drivers/input/touchscreen/wacom_w8001.c
> > +++ b/drivers/input/touchscreen/wacom_w8001.c
> > @@ -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;
> > -- 
> > 1.9.1
>  

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-23 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24  3:04 [PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets Ping Cheng
2016-05-24  5:04 ` Peter Hutterer
2016-06-23 18:00   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).