linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: handle bad parity PS/2 packets in mouse drivers better
       [not found] <r2x9e89675b1004080434yfea09b06x2c3c4680a9437a9@mail.gmail.com>
@ 2010-04-13 11:29 ` Damjan Jovanovic
  2010-04-14 20:59   ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Damjan Jovanovic @ 2010-04-13 11:29 UTC (permalink / raw)
  To: Alessandro Rubini, dmitry.torokhov; +Cc: linux-kernel, linux-input, akpm

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

This fixes a regression introduced in Linux 2.6.2 where mice that
sporadically produce bad parity go crazy and start jumping around and
clicking randomly, which never happens in any version of Windows
running on the same hardware. The bugzilla bug is
https://bugzilla.kernel.org/show_bug.cgi?id=6105

The patch works by always accumulating a full PS/2 packet, then
ignoring the packet if any byte had a bad checksum. A month of testing
it against an affected mouse has revealed it works perfectly in
practice.

This is the third resend, also CC'ed to lkml and Andrew Morton this
time, because the previous 2 emails to linux-input@vger.kernel.org and
the input/mouse maintainers from 28 March 2010 were ignored.

Regards
Damjan Jovanovic

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>

[-- Attachment #2: psmice-bad-parity.txt --]
[-- Type: text/plain, Size: 7367 bytes --]

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 7490f1d..82b34b6 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -378,10 +378,16 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
 	struct alps_data *priv = psmouse->private;
 	const struct alps_model_info *model = priv->i;
 
+	if (psmouse->pktcnt == 1 && psmouse->badparity)
+		return PSMOUSE_BAD_DATA;
+
 	if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */
 		if (psmouse->pktcnt == 3) {
-			alps_report_bare_ps2_packet(psmouse, psmouse->packet,
-						    true);
+			if (psmouse->badparity) {
+				alps_report_bare_ps2_packet(psmouse,
+							    psmouse->packet,
+							    true);
+			}
 			return PSMOUSE_FULL_PACKET;
 		}
 		return PSMOUSE_GOOD_DATA;
@@ -391,6 +397,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
 
 	if ((model->flags & ALPS_PS2_INTERLEAVED) &&
 	    psmouse->pktcnt >= 4 && (psmouse->packet[3] & 0x0f) == 0x0f) {
+		if (psmouse->badparity)
+			return PSMOUSE_BAD_DATA;
 		return alps_handle_interleaved_ps2(psmouse);
 	}
 
@@ -409,7 +417,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
 	}
 
 	if (psmouse->pktcnt == 6) {
-		alps_process_packet(psmouse);
+		if (!psmouse->badparity)
+			alps_process_packet(psmouse);
 		return PSMOUSE_FULL_PACKET;
 	}
 
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index b27684f..813dde7 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -324,6 +324,9 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
 	if (psmouse->pktcnt < psmouse->pktsize)
 		return PSMOUSE_GOOD_DATA;
 
+	if (psmouse->pktcnt == psmouse->pktsize && psmouse->badparity)
+		return PSMOUSE_FULL_PACKET;
+
 	if (etd->debug > 1)
 		elantech_packet_dump(psmouse->packet, psmouse->pktsize);
 
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 9169d15..c06439e 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -187,7 +187,8 @@ static psmouse_ret_t hgpk_process_byte(struct psmouse *psmouse)
 	}
 
 	if (psmouse->pktcnt >= psmouse->pktsize) {
-		hgpk_process_packet(psmouse);
+		if (!psmouse->badparity)
+			hgpk_process_packet(psmouse);
 		return PSMOUSE_FULL_PACKET;
 	}
 
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c
index 7c1d7d4..e4d1bac 100644
--- a/drivers/input/mouse/lifebook.c
+++ b/drivers/input/mouse/lifebook.c
@@ -138,6 +138,9 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)
 	unsigned char *packet = psmouse->packet;
 	bool relative_packet = packet[0] & 0x08;
 
+	if (psmouse->pktcnt == 1 && psmouse->badparity)
+		return PSMOUSE_BAD_DATA;
+
 	if (relative_packet || !lifebook_use_6byte_proto) {
 		if (psmouse->pktcnt != 3)
 			return PSMOUSE_GOOD_DATA;
@@ -166,6 +169,9 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)
 		}
 	}
 
+	if (psmouse->badparity)
+		return PSMOUSE_FULL_PACKET;
+
 	if (relative_packet) {
 		if (!dev2)
 			printk(KERN_WARNING "lifebook.c: got relative packet "
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
index 543c240..7d41ddb 100644
--- a/drivers/input/mouse/logips2pp.c
+++ b/drivers/input/mouse/logips2pp.c
@@ -51,6 +51,9 @@ static psmouse_ret_t ps2pp_process_byte(struct psmouse *psmouse)
  * Full packet accumulated, process it
  */
 
+	if (psmouse->badparity)
+		return PSMOUSE_FULL_PACKET;
+
 	if ((packet[0] & 0x48) == 0x48 && (packet[1] & 0x02) == 0x02) {
 
 		/* Logitech extended packet */
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index d8c0c8d..8aa033d 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -133,6 +133,9 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
  * Full packet accumulated, process it
  */
 
+	if (psmouse->badparity)
+		return PSMOUSE_FULL_PACKET;
+
 /*
  * Scroll wheel on IntelliMice, scroll buttons on NetMice
  */
@@ -217,6 +220,7 @@ void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work,
 static inline void __psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state)
 {
 	psmouse->state = new_state;
+	psmouse->badparity = 0;
 	psmouse->pktcnt = psmouse->out_of_sync_cnt = 0;
 	psmouse->ps2dev.flags = 0;
 	psmouse->last = jiffies;
@@ -257,10 +261,12 @@ static int psmouse_handle_byte(struct psmouse *psmouse)
 					return -1;
 				}
 			}
+			psmouse->badparity = 0;
 			psmouse->pktcnt = 0;
 			break;
 
 		case PSMOUSE_FULL_PACKET:
+			psmouse->badparity = 0;
 			psmouse->pktcnt = 0;
 			if (psmouse->out_of_sync_cnt) {
 				psmouse->out_of_sync_cnt = 0;
@@ -270,6 +276,7 @@ static int psmouse_handle_byte(struct psmouse *psmouse)
 			break;
 
 		case PSMOUSE_GOOD_DATA:
+			psmouse->badparity = 0;
 			break;
 	}
 	return 0;
@@ -293,8 +300,12 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
 			printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n",
 				flags & SERIO_TIMEOUT ? " timeout" : "",
 				flags & SERIO_PARITY ? " bad parity" : "");
-		ps2_cmd_aborted(&psmouse->ps2dev);
-		goto out;
+		if (flags & SERIO_TIMEOUT) {
+			ps2_cmd_aborted(&psmouse->ps2dev);
+			goto out;
+		} else {
+			psmouse->badparity = 1;
+		}
 	}
 
 	if (unlikely(psmouse->ps2dev.flags & PS2_FLAG_ACK))
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index e053bdd..93ba9df 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -43,6 +43,7 @@ struct psmouse {
 	char *vendor;
 	char *name;
 	unsigned char packet[8];
+	int badparity;
 	unsigned char badbyte;
 	unsigned char pktcnt;
 	unsigned char pktsize;
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
index 81a6b81..0778d84 100644
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -637,6 +637,9 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse)
 	 * Full packet accumulated, process it
 	 */
 
+	if (psmouse->badparity)
+		return PSMOUSE_FULL_PACKET;
+
 	switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) {
 	case FSP_PKT_TYPE_ABS:
 		dev_warn(&psmouse->ps2dev.serio->dev,
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index d3f5243..25ec71c 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -534,6 +534,9 @@ static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse)
 	struct synaptics_data *priv = psmouse->private;
 
 	if (psmouse->pktcnt >= 6) { /* Full packet received */
+		if (psmouse->badparity)
+			return PSMOUSE_FULL_PACKET;
+
 		if (unlikely(priv->pkt_type == SYN_NEWABS))
 			priv->pkt_type = synaptics_detect_pkt_type(psmouse);
 
diff --git a/drivers/input/mouse/touchkit_ps2.c b/drivers/input/mouse/touchkit_ps2.c
index 909431c..12a1e31 100644
--- a/drivers/input/mouse/touchkit_ps2.c
+++ b/drivers/input/mouse/touchkit_ps2.c
@@ -59,6 +59,9 @@ static psmouse_ret_t touchkit_ps2_process_byte(struct psmouse *psmouse)
 	if (psmouse->pktcnt != 5)
 		return PSMOUSE_GOOD_DATA;
 
+	if (psmouse->badparity)
+		return PSMOUSE_FULL_PACKET;
+
 	input_report_abs(dev, ABS_X, TOUCHKIT_GET_X(packet));
 	input_report_abs(dev, ABS_Y, TOUCHKIT_GET_Y(packet));
 	input_report_key(dev, BTN_TOUCH, TOUCHKIT_GET_TOUCHED(packet));

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

* Re: [PATCH] input: handle bad parity PS/2 packets in mouse drivers better
  2010-04-13 11:29 ` [PATCH] input: handle bad parity PS/2 packets in mouse drivers better Damjan Jovanovic
@ 2010-04-14 20:59   ` Dmitry Torokhov
  2010-04-17  9:33     ` Damjan Jovanovic
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2010-04-14 20:59 UTC (permalink / raw)
  To: Damjan Jovanovic; +Cc: Alessandro Rubini, linux-kernel, linux-input, akpm

Hi Damjan,

On Tue, Apr 13, 2010 at 01:29:20PM +0200, Damjan Jovanovic wrote:
> This fixes a regression introduced in Linux 2.6.2 where mice that
> sporadically produce bad parity go crazy and start jumping around and
> clicking randomly, which never happens in any version of Windows
> running on the same hardware. The bugzilla bug is
> https://bugzilla.kernel.org/show_bug.cgi?id=6105
> 
> The patch works by always accumulating a full PS/2 packet, then
> ignoring the packet if any byte had a bad checksum. A month of testing
> it against an affected mouse has revealed it works perfectly in
> practice.
> 
> This is the third resend, also CC'ed to lkml and Andrew Morton this
> time, because the previous 2 emails to linux-input@vger.kernel.org and
> the input/mouse maintainers from 28 March 2010 were ignored.
> 

I am not sure whether we can rely on the mouse and KBC combo to always
finish transmitting entire packet when parity error is detected,
regardless of the protocol involved. However I had a chanceto observe
several versions of the $OTHER_OS in presence of parity errors and
they (at least when used with stock mouse driver) appear to simply
ignore errors and process motion data as usual. Therefore I propose
instead of your patch the patch below.

Could you please try it on your box and see if it helps?

Thanks.

-- 
Dmitry


Input: psmouse - ignore parity error for basic protocols

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Observing behavior of the other OS it appears that parity errors reported
by the keyboard controller are being ignored and the data is processed
as usual. Let's do the same for standard PS/2 protocols (bare, Intellimouse
and Intellimouse Explorer) to provide better compatibility. Thsi should fix
teh following bug:

	https://bugzilla.kernel.org/show_bug.cgi?id=6105

Thanks for Damjan Jovanovic for locating the source of issue and ideas
for the patch.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/mouse/psmouse-base.c |   18 +++++++++++++++---
 drivers/input/mouse/psmouse.h      |    1 +
 2 files changed, 16 insertions(+), 3 deletions(-)


diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index d8c0c8d..cbc8072 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -110,6 +110,7 @@ static struct workqueue_struct *kpsmoused_wq;
 struct psmouse_protocol {
 	enum psmouse_type type;
 	bool maxproto;
+	bool ignore_parity; /* Protocol should ignore parity errors from KBC */
 	const char *name;
 	const char *alias;
 	int (*detect)(struct psmouse *, bool);
@@ -288,7 +289,9 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
 	if (psmouse->state == PSMOUSE_IGNORE)
 		goto out;
 
-	if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) {
+	if (unlikely((flags & SERIO_TIMEOUT) ||
+		     ((flags & SERIO_PARITY) && !psmouse->ignore_parity))) {
+
 		if (psmouse->state == PSMOUSE_ACTIVATED)
 			printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n",
 				flags & SERIO_TIMEOUT ? " timeout" : "",
@@ -759,6 +762,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
 		.name		= "PS/2",
 		.alias		= "bare",
 		.maxproto	= true,
+		.ignore_parity	= true,
 		.detect		= ps2bare_detect,
 	},
 #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
@@ -786,6 +790,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
 		.name		= "ImPS/2",
 		.alias		= "imps",
 		.maxproto	= true,
+		.ignore_parity	= true,
 		.detect		= intellimouse_detect,
 	},
 	{
@@ -793,6 +798,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
 		.name		= "ImExPS/2",
 		.alias		= "exps",
 		.maxproto	= true,
+		.ignore_parity	= true,
 		.detect		= im_explorer_detect,
 	},
 #ifdef CONFIG_MOUSE_PS2_SYNAPTICS
@@ -1222,6 +1228,7 @@ static void psmouse_disconnect(struct serio *serio)
 static int psmouse_switch_protocol(struct psmouse *psmouse,
 				   const struct psmouse_protocol *proto)
 {
+	const struct psmouse_protocol *selected_proto;
 	struct input_dev *input_dev = psmouse->dev;
 
 	input_dev->dev.parent = &psmouse->ps2dev.serio->dev;
@@ -1245,9 +1252,14 @@ static int psmouse_switch_protocol(struct psmouse *psmouse,
 			return -1;
 
 		psmouse->type = proto->type;
-	} else
+		selected_proto = proto;
+	} else {
 		psmouse->type = psmouse_extensions(psmouse,
 						   psmouse_max_proto, true);
+		selected_proto = psmouse_protocol_by_type(psmouse->type);
+	}
+
+	psmouse->ignore_parity = selected_proto->ignore_parity;
 
 	/*
 	 * If mouse's packet size is 3 there is no point in polling the
@@ -1267,7 +1279,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse,
 		psmouse->resync_time = 0;
 
 	snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s",
-		 psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name);
+		 selected_proto->name, psmouse->vendor, psmouse->name);
 
 	input_dev->name = psmouse->devname;
 	input_dev->phys = psmouse->phys;
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index e053bdd..593e910 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -47,6 +47,7 @@ struct psmouse {
 	unsigned char pktcnt;
 	unsigned char pktsize;
 	unsigned char type;
+	bool ignore_parity;
 	bool acks_disable_command;
 	unsigned int model;
 	unsigned long last;

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

* Re: [PATCH] input: handle bad parity PS/2 packets in mouse drivers  better
  2010-04-14 20:59   ` Dmitry Torokhov
@ 2010-04-17  9:33     ` Damjan Jovanovic
  2010-05-03 11:31       ` Damjan Jovanovic
  0 siblings, 1 reply; 5+ messages in thread
From: Damjan Jovanovic @ 2010-04-17  9:33 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Alessandro Rubini, linux-kernel, linux-input, akpm

On Wed, Apr 14, 2010 at 10:59 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Damjan,
>
> On Tue, Apr 13, 2010 at 01:29:20PM +0200, Damjan Jovanovic wrote:
>> This fixes a regression introduced in Linux 2.6.2 where mice that
>> sporadically produce bad parity go crazy and start jumping around and
>> clicking randomly, which never happens in any version of Windows
>> running on the same hardware. The bugzilla bug is
>> https://bugzilla.kernel.org/show_bug.cgi?id=6105
>>
>> The patch works by always accumulating a full PS/2 packet, then
>> ignoring the packet if any byte had a bad checksum. A month of testing
>> it against an affected mouse has revealed it works perfectly in
>> practice.
>>
>> This is the third resend, also CC'ed to lkml and Andrew Morton this
>> time, because the previous 2 emails to linux-input@vger.kernel.org and
>> the input/mouse maintainers from 28 March 2010 were ignored.
>>
>
> I am not sure whether we can rely on the mouse and KBC combo to always
> finish transmitting entire packet when parity error is detected,
> regardless of the protocol involved. However I had a chanceto observe
> several versions of the $OTHER_OS in presence of parity errors and
> they (at least when used with stock mouse driver) appear to simply
> ignore errors and process motion data as usual. Therefore I propose
> instead of your patch the patch below.
>
> Could you please try it on your box and see if it helps?
>
> Thanks.
>
> --
> Dmitry

Hi Dmitry and others

This patch works.

Thank you
Damjan Jovanovic





>
> Input: psmouse - ignore parity error for basic protocols
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Observing behavior of the other OS it appears that parity errors reported
> by the keyboard controller are being ignored and the data is processed
> as usual. Let's do the same for standard PS/2 protocols (bare, Intellimouse
> and Intellimouse Explorer) to provide better compatibility. Thsi should fix
> teh following bug:
>
>        https://bugzilla.kernel.org/show_bug.cgi?id=6105
>
> Thanks for Damjan Jovanovic for locating the source of issue and ideas
> for the patch.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
>
>  drivers/input/mouse/psmouse-base.c |   18 +++++++++++++++---
>  drivers/input/mouse/psmouse.h      |    1 +
>  2 files changed, 16 insertions(+), 3 deletions(-)
>
>
> diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
> index d8c0c8d..cbc8072 100644
> --- a/drivers/input/mouse/psmouse-base.c
> +++ b/drivers/input/mouse/psmouse-base.c
> @@ -110,6 +110,7 @@ static struct workqueue_struct *kpsmoused_wq;
>  struct psmouse_protocol {
>        enum psmouse_type type;
>        bool maxproto;
> +       bool ignore_parity; /* Protocol should ignore parity errors from KBC */
>        const char *name;
>        const char *alias;
>        int (*detect)(struct psmouse *, bool);
> @@ -288,7 +289,9 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
>        if (psmouse->state == PSMOUSE_IGNORE)
>                goto out;
>
> -       if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) {
> +       if (unlikely((flags & SERIO_TIMEOUT) ||
> +                    ((flags & SERIO_PARITY) && !psmouse->ignore_parity))) {
> +
>                if (psmouse->state == PSMOUSE_ACTIVATED)
>                        printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n",
>                                flags & SERIO_TIMEOUT ? " timeout" : "",
> @@ -759,6 +762,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
>                .name           = "PS/2",
>                .alias          = "bare",
>                .maxproto       = true,
> +               .ignore_parity  = true,
>                .detect         = ps2bare_detect,
>        },
>  #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
> @@ -786,6 +790,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
>                .name           = "ImPS/2",
>                .alias          = "imps",
>                .maxproto       = true,
> +               .ignore_parity  = true,
>                .detect         = intellimouse_detect,
>        },
>        {
> @@ -793,6 +798,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
>                .name           = "ImExPS/2",
>                .alias          = "exps",
>                .maxproto       = true,
> +               .ignore_parity  = true,
>                .detect         = im_explorer_detect,
>        },
>  #ifdef CONFIG_MOUSE_PS2_SYNAPTICS
> @@ -1222,6 +1228,7 @@ static void psmouse_disconnect(struct serio *serio)
>  static int psmouse_switch_protocol(struct psmouse *psmouse,
>                                   const struct psmouse_protocol *proto)
>  {
> +       const struct psmouse_protocol *selected_proto;
>        struct input_dev *input_dev = psmouse->dev;
>
>        input_dev->dev.parent = &psmouse->ps2dev.serio->dev;
> @@ -1245,9 +1252,14 @@ static int psmouse_switch_protocol(struct psmouse *psmouse,
>                        return -1;
>
>                psmouse->type = proto->type;
> -       } else
> +               selected_proto = proto;
> +       } else {
>                psmouse->type = psmouse_extensions(psmouse,
>                                                   psmouse_max_proto, true);
> +               selected_proto = psmouse_protocol_by_type(psmouse->type);
> +       }
> +
> +       psmouse->ignore_parity = selected_proto->ignore_parity;
>
>        /*
>         * If mouse's packet size is 3 there is no point in polling the
> @@ -1267,7 +1279,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse,
>                psmouse->resync_time = 0;
>
>        snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s",
> -                psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name);
> +                selected_proto->name, psmouse->vendor, psmouse->name);
>
>        input_dev->name = psmouse->devname;
>        input_dev->phys = psmouse->phys;
> diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
> index e053bdd..593e910 100644
> --- a/drivers/input/mouse/psmouse.h
> +++ b/drivers/input/mouse/psmouse.h
> @@ -47,6 +47,7 @@ struct psmouse {
>        unsigned char pktcnt;
>        unsigned char pktsize;
>        unsigned char type;
> +       bool ignore_parity;
>        bool acks_disable_command;
>        unsigned int model;
>        unsigned long last;
>

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

* Re: [PATCH] input: handle bad parity PS/2 packets in mouse drivers  better
  2010-04-17  9:33     ` Damjan Jovanovic
@ 2010-05-03 11:31       ` Damjan Jovanovic
  2010-05-05 16:24         ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Damjan Jovanovic @ 2010-05-03 11:31 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Alessandro Rubini, linux-kernel, linux-input, akpm

Ping? This patch works, can you please commit it?

Thank you
Damjan

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

* Re: [PATCH] input: handle bad parity PS/2 packets in mouse drivers better
  2010-05-03 11:31       ` Damjan Jovanovic
@ 2010-05-05 16:24         ` Dmitry Torokhov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2010-05-05 16:24 UTC (permalink / raw)
  To: Damjan Jovanovic; +Cc: Alessandro Rubini, linux-kernel, linux-input, akpm

On Mon, May 03, 2010 at 01:31:13PM +0200, Damjan Jovanovic wrote:
> Ping? This patch works, can you please commit it?
> 

The patch has been pulled into mainline. Thank you for your efforts and
persistence.

-- 
Dmitry

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

end of thread, other threads:[~2010-05-05 16:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <r2x9e89675b1004080434yfea09b06x2c3c4680a9437a9@mail.gmail.com>
2010-04-13 11:29 ` [PATCH] input: handle bad parity PS/2 packets in mouse drivers better Damjan Jovanovic
2010-04-14 20:59   ` Dmitry Torokhov
2010-04-17  9:33     ` Damjan Jovanovic
2010-05-03 11:31       ` Damjan Jovanovic
2010-05-05 16:24         ` 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).