linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
       [not found] <gj4r8h$okm$1@ger.gmane.org>
@ 2008-12-28  6:21 ` Andrew Morton
  2008-12-29 18:56 ` Arjan Opmeer
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2008-12-28  6:21 UTC (permalink / raw)
  To: Alexander E. Patrakov; +Cc: linux-kernel, linux-input

On Sat, 27 Dec 2008 14:06:29 +0500 "Alexander E. Patrakov" <patrakov@gmail.com> wrote:

> Linux-2.6.28, as compiled by Arch Linux developers, thinks that my PS/2 mouse (a cheap M-BT58 optical wheel mouse by Logitech) is actually a touchpad. This makes it unusable. Adding the "proto=imps" parameter to the psmouse module helps.
> 
> Dmesg output and config are attached.

(cc linux-input)

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

* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
       [not found] <gj4r8h$okm$1@ger.gmane.org>
  2008-12-28  6:21 ` 2.6.28 thinks that my PS/2 mouse is a touchpad Andrew Morton
@ 2008-12-29 18:56 ` Arjan Opmeer
  2008-12-30  6:03   ` Alexander E. Patrakov
  2009-01-02  0:07   ` Denys Vlasenko
  1 sibling, 2 replies; 7+ messages in thread
From: Arjan Opmeer @ 2008-12-29 18:56 UTC (permalink / raw)
  To: Alexander E. Patrakov; +Cc: linux-kernel, linux-input

On Sat, Dec 27, 2008 at 02:06:29PM +0500, Alexander E. Patrakov wrote:
> 
> Linux-2.6.28, as compiled by Arch Linux developers, thinks that my PS/2
> mouse (a cheap M-BT58 optical wheel mouse by Logitech) is actually a
> touchpad.  This makes it unusable.  Adding the "proto=imps" parameter to
> the psmouse module helps.

> CONFIG_MOUSE_PS2_ELANTECH=y

Oh dear. The first victim of this driver... :(

As we can see below the mouse gets detected as an Elantech touchpad. This
means that it reacts to the Elantech magic knock with the exact same
response we expect from a real Elantech touchpad.

I see no way to prevent this from happening.

> elantech.c: Elantech version query result 0x00, 0x01, 0x64.
> elantech.c: assuming hardware version 1, firmware version 0.100
> elantech.c: Synaptics capabilities query result 0x00, 0x02, 0x64.

However, all version query results I have seen from Elantech touchpads have
a non-zero first byte and a zero second byte. So we could test for that to
prevent this mouse from being detected as a touchpad.

Dmitry, do you think something like this is sufficient?

--- elantech.c.ORIG	2008-12-29 19:35:01.000000000 +0100
+++ elantech.c.NEW	2008-12-29 19:38:59.000000000 +0100
@@ -618,6 +618,10 @@ int elantech_init(struct psmouse *psmous
 	}
 	pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
 		param[0], param[1], param[2]);
+	if (param[0] == 0 || param[1] != 0) {
+		pr_info("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
+		goto init_fail;
+	}
 	etd->fw_version_maj = param[0];
 	etd->fw_version_min = param[2];


Arjan


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

* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
  2008-12-29 18:56 ` Arjan Opmeer
@ 2008-12-30  6:03   ` Alexander E. Patrakov
  2008-12-30  9:15     ` Dmitry Torokhov
  2009-01-02  0:07   ` Denys Vlasenko
  1 sibling, 1 reply; 7+ messages in thread
From: Alexander E. Patrakov @ 2008-12-30  6:03 UTC (permalink / raw)
  To: Arjan Opmeer; +Cc: linux-kernel, linux-input

Arjan Opmeer wrote:
> On Sat, Dec 27, 2008 at 02:06:29PM +0500, Alexander E. Patrakov wrote:
>> elantech.c: Elantech version query result 0x00, 0x01, 0x64.
>> elantech.c: assuming hardware version 1, firmware version 0.100
>> elantech.c: Synaptics capabilities query result 0x00, 0x02, 0x64.
> 
> However, all version query results I have seen from Elantech touchpads have
> a non-zero first byte and a zero second byte. So we could test for that to
> prevent this mouse from being detected as a touchpad.
> 
> Dmitry, do you think something like this is sufficient?
> 
> --- elantech.c.ORIG	2008-12-29 19:35:01.000000000 +0100
> +++ elantech.c.NEW	2008-12-29 19:38:59.000000000 +0100
> @@ -618,6 +618,10 @@ int elantech_init(struct psmouse *psmous
>  	}
>  	pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
>  		param[0], param[1], param[2]);
> +	if (param[0] == 0 || param[1] != 0) {
> +		pr_info("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
> +		goto init_fail;
> +	}
>  	etd->fw_version_maj = param[0];
>  	etd->fw_version_min = param[2];

This is still slightly wrong. The mouse does work, but is misnamed in 
the dmesg output and in /proc/bus/input/devices:

psmouse serio1: ID: 10 00 64<6>elantech.c: Elantech version query result 
0x00, 0x01, 0x64.
elantech.c: Probably not a real Elantech touchpad. Aborting.
input: ImExPS/2 Elantech Touchpad as /class/input/input8

I: Bus=0011 Vendor=0002 Product=0006 Version=0000
N: Name="ImExPS/2 Elantech Touchpad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/class/input/input8
U: Uniq=
H: Handlers=mouse1 event6
B: EV=7
B: KEY=1f0000 0 0 0 0 0 0 0 0
B: REL=143

-- 
Alexander E. Patrakov

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

* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
  2008-12-30  6:03   ` Alexander E. Patrakov
@ 2008-12-30  9:15     ` Dmitry Torokhov
  2008-12-30 14:29       ` Arjan Opmeer
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2008-12-30  9:15 UTC (permalink / raw)
  To: Alexander E. Patrakov; +Cc: Arjan Opmeer, linux-kernel, linux-input

On Monday 29 December 2008 22:03:35 Alexander E. Patrakov wrote:
> Arjan Opmeer wrote:
> > On Sat, Dec 27, 2008 at 02:06:29PM +0500, Alexander E. Patrakov wrote:
> >> elantech.c: Elantech version query result 0x00, 0x01, 0x64.
> >> elantech.c: assuming hardware version 1, firmware version 0.100
> >> elantech.c: Synaptics capabilities query result 0x00, 0x02, 0x64.
> >
> > However, all version query results I have seen from Elantech touchpads
> > have a non-zero first byte and a zero second byte. So we could test for
> > that to prevent this mouse from being detected as a touchpad.
> >
> > Dmitry, do you think something like this is sufficient?
> >
> > --- elantech.c.ORIG	2008-12-29 19:35:01.000000000 +0100
> > +++ elantech.c.NEW	2008-12-29 19:38:59.000000000 +0100
> > @@ -618,6 +618,10 @@ int elantech_init(struct psmouse *psmous
> >  	}
> >  	pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x,
> > 0x%02x.\n", param[0], param[1], param[2]);
> > +	if (param[0] == 0 || param[1] != 0) {
> > +		pr_info("elantech.c: Probably not a real Elantech touchpad.
> > Aborting.\n"); +		goto init_fail;
> > +	}
> >  	etd->fw_version_maj = param[0];
> >  	etd->fw_version_min = param[2];
>
> This is still slightly wrong. The mouse does work, but is misnamed in
> the dmesg output and in /proc/bus/input/devices:
>
> psmouse serio1: ID: 10 00 64<6>elantech.c: Elantech version query result
> 0x00, 0x01, 0x64.
> elantech.c: Probably not a real Elantech touchpad. Aborting.
> input: ImExPS/2 Elantech Touchpad as /class/input/input8
>

Yeah, elantech_init() is too late, we need to do something in
elantech_detect()... What did /proc/bus/input/devices show before
2.6.28? Logitech, right? Maybe we need to pull part of Logitech check (number
of buttons for example) from logips2pp.c. We'd need to test with real elantech
touchpads too though.

-- 
Dmitry

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

* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
  2008-12-30  9:15     ` Dmitry Torokhov
@ 2008-12-30 14:29       ` Arjan Opmeer
  0 siblings, 0 replies; 7+ messages in thread
From: Arjan Opmeer @ 2008-12-30 14:29 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Alexander E. Patrakov, linux-kernel, linux-input

On Tue, Dec 30, 2008 at 01:15:01AM -0800, Dmitry Torokhov wrote:
> On Monday 29 December 2008 22:03:35 Alexander E. Patrakov wrote:
> >
> > This is still slightly wrong. The mouse does work, but is misnamed in
> > the dmesg output and in /proc/bus/input/devices:
> >
> > psmouse serio1: ID: 10 00 64<6>elantech.c: Elantech version query result
> > 0x00, 0x01, 0x64.
> > elantech.c: Probably not a real Elantech touchpad. Aborting.
> > input: ImExPS/2 Elantech Touchpad as /class/input/input8
> 
> Yeah, elantech_init() is too late, we need to do something in
> elantech_detect()... 

Well, we could also move that Elantech version query and test for sane
values into elantech_detect().  However, because we have no private data
structure at that time it would mean we have to do the same query again in
elantech_init() to store fw_version_maj and fw_version_min.

> Maybe we need to pull part of Logitech check (number of buttons for
> example) from logips2pp.c.

I think the solution above is simpler although maybe not as pretty... :)


Arjan

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

* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
  2008-12-29 18:56 ` Arjan Opmeer
  2008-12-30  6:03   ` Alexander E. Patrakov
@ 2009-01-02  0:07   ` Denys Vlasenko
  2009-01-02 18:37     ` Arjan Opmeer
  1 sibling, 1 reply; 7+ messages in thread
From: Denys Vlasenko @ 2009-01-02  0:07 UTC (permalink / raw)
  To: Arjan Opmeer, Dmitry Torokhov
  Cc: Alexander E. Patrakov, linux-kernel, linux-input

On Monday 29 December 2008 19:56, Arjan Opmeer wrote:
> On Sat, Dec 27, 2008 at 02:06:29PM +0500, Alexander E. Patrakov wrote:
> > 
> > Linux-2.6.28, as compiled by Arch Linux developers, thinks that my PS/2
> > mouse (a cheap M-BT58 optical wheel mouse by Logitech) is actually a
> > touchpad.  This makes it unusable.  Adding the "proto=imps" parameter to
> > the psmouse module helps.
> 
> > CONFIG_MOUSE_PS2_ELANTECH=y
> 
> Oh dear. The first victim of this driver... :(
> 
> As we can see below the mouse gets detected as an Elantech touchpad. This
> means that it reacts to the Elantech magic knock with the exact same
> response we expect from a real Elantech touchpad.

I am affected too. I am getting:

2009-01-01_23:15:29.11109 kern.info: input: AT Translated Set 2 keyboard as /class/input/input2
2009-01-01_23:15:29.11113 kern.info: elantech.c: Elantech version query result 0x00, 0x01, 0x64.
2009-01-01_23:15:29.11118 kern.info: elantech.c: assuming hardware version 1, firmware version 0.100
2009-01-01_23:15:29.11123 kern.info: elantech.c: Synaptics capabilities query result 0x00, 0x02, 0x64.
2009-01-01_23:15:29.11128 kern.info: input: ETPS/2 Elantech Touchpad as /class/input/input3

and then on attempts to use the mouse:

...
2009-01-01_23:16:08.68831 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.70630 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.71730 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.72918 kern.notice: psmouse.c: Touchpad at isa0060/serio1/input0 - driver resynched.
2009-01-01_23:16:08.74732 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.75832 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.76932 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.78732 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.79832 kern.warn: psmouse.c: Touchpad at isa0060/serio1/input0 lost sync at byte 4
2009-01-01_23:16:08.79844 kern.notice: psmouse.c: issuing reconnect request
...

On old kernel it was:

2008-10-30_07:37:01.41484 kern.info: input: ImExPS/2 Logitech Wheel Mouse as /class/input/input3

--
vda

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

* Re: 2.6.28 thinks that my PS/2 mouse is a touchpad
  2009-01-02  0:07   ` Denys Vlasenko
@ 2009-01-02 18:37     ` Arjan Opmeer
  0 siblings, 0 replies; 7+ messages in thread
From: Arjan Opmeer @ 2009-01-02 18:37 UTC (permalink / raw)
  To: Denys Vlasenko
  Cc: Dmitry Torokhov, Alexander E. Patrakov, linux-kernel, linux-input

On Fri, Jan 02, 2009 at 01:07:54AM +0100, Denys Vlasenko wrote:
> On Monday 29 December 2008 19:56, Arjan Opmeer wrote:
> > On Sat, Dec 27, 2008 at 02:06:29PM +0500, Alexander E. Patrakov wrote:
> > > 
> > > Linux-2.6.28, as compiled by Arch Linux developers, thinks that my
> > > PS/2 mouse (a cheap M-BT58 optical wheel mouse by Logitech) is
> > > actually a touchpad.  This makes it unusable.  Adding the "proto=imps"
> > > parameter to the psmouse module helps.
> > 
> > > CONFIG_MOUSE_PS2_ELANTECH=y
> > 
> > Oh dear. The first victim of this driver... :(
> > 
> > As we can see below the mouse gets detected as an Elantech touchpad.
> > This means that it reacts to the Elantech magic knock with the exact
> > same response we expect from a real Elantech touchpad.
> 
> I am affected too. I am getting:
> 
> input: AT Translated Set 2 keyboard as /class/input/input2
> elantech.c: Elantech version query result 0x00, 0x01, 0x64.
> elantech.c: assuming hardware version 1, firmware version 0.100
> elantech.c: Synaptics capabilities query result 0x00, 0x02, 0x64.
> input: ETPS/2 Elantech Touchpad as /class/input/input3

So how about we try to solve it by duplicating the version query in
elantech_detect() and check for sane values. Dmitry, do you think something
like this would be acceptable?


Arjan

--- elantech.c.ORIG	2008-12-29 19:35:01.000000000 +0100
+++ elantech.c.NEW2	2009-01-02 19:26:01.000000000 +0100
@@ -556,6 +556,22 @@ int elantech_detect(struct psmouse *psmo
 		return -1;
 	}
 
+	/*
+	 * There are Logitech mice that react to the magic knock exactly
+	 * like an Elantech touchpad would, so do a version query here to
+	 * try to distinguish the two
+	 */
+	if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
+		pr_err("elantech.c: failed to query firmware version.\n");
+		return -1;
+	}
+	pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
+		param[0], param[1], param[2]);
+	if (param[0] == 0 || param[1] != 0) {
+		pr_info("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
+		return -1;
+	}
+
 	if (set_properties) {
 		psmouse->vendor = "Elantech";
 		psmouse->name = "Touchpad";
@@ -610,14 +626,12 @@ int elantech_init(struct psmouse *psmous
 		etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;
 
 	/*
-	 * Find out what version hardware this is
+	 * Do the version query again so we can store the result
 	 */
 	if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
 		pr_err("elantech.c: failed to query firmware version.\n");
 		goto init_fail;
 	}
-	pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
-		param[0], param[1], param[2]);
 	etd->fw_version_maj = param[0];
 	etd->fw_version_min = param[2];
 

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

end of thread, other threads:[~2009-01-02 18:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <gj4r8h$okm$1@ger.gmane.org>
2008-12-28  6:21 ` 2.6.28 thinks that my PS/2 mouse is a touchpad Andrew Morton
2008-12-29 18:56 ` Arjan Opmeer
2008-12-30  6:03   ` Alexander E. Patrakov
2008-12-30  9:15     ` Dmitry Torokhov
2008-12-30 14:29       ` Arjan Opmeer
2009-01-02  0:07   ` Denys Vlasenko
2009-01-02 18:37     ` Arjan Opmeer

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).