2005-12-24 06:43:39

by Joe Feise

[permalink] [raw]
Subject: mouse issues in 2.6.15-rc5-mm series

[Note: please cc me on answers since I'm not subscribed to the kernel list]

I am experiencing problems with mouse resyncing in the -mm series.
This is a Logitech wheel mouse connected through a KVM.
Symptom: whenever the mouse isn't moved for some seconds, it doesn't
react to movement for a second, and then resyncs. Sometimes, the
resyncing results in the mouse pointer jumping, which as far as I
know is a protocol mismatch.
While searching for reports of similar problems, I came across
Frank Sorenson's post from Nov. 23 (http://lkml.org/lkml/2005/11/23/533).
Like in his case, reverting
input-attempt-to-re-synchronize-mouse-every-5-seconds.patch
resulted in a kernel without this problem.

-Joe





Attachments:
signature.asc (189.00 B)
OpenPGP digital signature

2005-12-24 10:42:04

by Marc Burkhardt

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

* Joe Feise <[email protected]> [2005-12-23 22:43:32 -0800]:

> [Note: please cc me on answers since I'm not subscribed to the kernel list]
>
> I am experiencing problems with mouse resyncing in the -mm series.
> This is a Logitech wheel mouse connected through a KVM.
> Symptom: whenever the mouse isn't moved for some seconds, it doesn't
> react to movement for a second, and then resyncs. Sometimes, the
> resyncing results in the mouse pointer jumping, which as far as I
> know is a protocol mismatch.
> While searching for reports of similar problems, I came across
> Frank Sorenson's post from Nov. 23 (http://lkml.org/lkml/2005/11/23/533).
> Like in his case, reverting
> input-attempt-to-re-synchronize-mouse-every-5-seconds.patch
> resulted in a kernel without this problem.
>
> -Joe

Hi Joe,

read these ones:

http://lkml.org/lkml/2005/11/18/152
http://www.uwsg.iu.edu/hypermail/linux/kernel/0511.3/0019.html

Maybe they help you out.

I didn't get it working in the rc5 -mm tree so far. But non -mm work as good as
they always did.

Marc

2005-12-24 10:58:00

by Frank Sorenson

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marc Koschewski wrote:
> * Joe Feise <[email protected]> [2005-12-23 22:43:32 -0800]:
>
>
>>[Note: please cc me on answers since I'm not subscribed to the kernel list]
>>
>>I am experiencing problems with mouse resyncing in the -mm series.
>>This is a Logitech wheel mouse connected through a KVM.
>>Symptom: whenever the mouse isn't moved for some seconds, it doesn't
>>react to movement for a second, and then resyncs. Sometimes, the
>>resyncing results in the mouse pointer jumping, which as far as I
>>know is a protocol mismatch.
>>While searching for reports of similar problems, I came across
>>Frank Sorenson's post from Nov. 23 (http://lkml.org/lkml/2005/11/23/533).
>>Like in his case, reverting
>>input-attempt-to-re-synchronize-mouse-every-5-seconds.patch
>>resulted in a kernel without this problem.
>>
>>-Joe

Joe,

I continue to see the same issues with the resync patch in -mm. For me,
tapping stops working, and I'm now seeing both the mouse pointer jumping
as well (a lesser issue for me, so it was probably present earlier as
well).

I switched to using the synaptics X driver as recommended by Dmitry
Torokhov (http://lkml.org/lkml/2005/11/25/130), and that has worked
splendidly for me. However, that's really just a band-aid, and I'd be
happier with a working resync patch.

> Hi Joe,
>
> read these ones:
>
> http://lkml.org/lkml/2005/11/18/152
> http://www.uwsg.iu.edu/hypermail/linux/kernel/0511.3/0019.html
>
> Maybe they help you out.
>
> I didn't get it working in the rc5 -mm tree so far. But non -mm work as good as
> they always did.

Same issue for me as well.

Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDrSmmaI0dwg4A47wRAidbAJ9rR7ZtgavKNw1aEamcdZ8Br/27GwCdEQcc
JHP9CL6TTlbhYm8kyzeXH+w=
=w3cG
-----END PGP SIGNATURE-----

2005-12-24 17:57:00

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

On Saturday 24 December 2005 01:43, Joe Feise wrote:
> [Note: please cc me on answers since I'm not subscribed to the kernel list]
>
> I am experiencing problems with mouse resyncing in the -mm series.
> This is a Logitech wheel mouse connected through a KVM.
> Symptom: whenever the mouse isn't moved for some seconds, it doesn't
> react to movement for a second, and then resyncs. Sometimes, the
> resyncing results in the mouse pointer jumping, which as far as I
> know is a protocol mismatch.
> While searching for reports of similar problems, I came across
> Frank Sorenson's post from Nov. 23 (http://lkml.org/lkml/2005/11/23/533).
> Like in his case, reverting
> input-attempt-to-re-synchronize-mouse-every-5-seconds.patch
> resulted in a kernel without this problem.
>

Joe,

Instead of reverting input-attempt-to-re-synchronize-mouse-every-5-seconds
patch could youplease drop the patch below on top of -mm.

Jet me know if your mouse stays synchronized. Thanks!

--
Dmitry

drivers/input/mouse/psmouse-base.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

Index: linux/drivers/input/mouse/psmouse-base.c
===================================================================
--- linux.orig/drivers/input/mouse/psmouse-base.c
+++ linux/drivers/input/mouse/psmouse-base.c
@@ -1029,6 +1029,23 @@ static int psmouse_switch_protocol(struc
else
psmouse->type = psmouse_extensions(psmouse, psmouse_max_proto, 1);

+ /*
+ * If mouse's packet size is 3 there is no point in polling the
+ * device in hopes to detect protocol reset - we won't get less
+ * than 3 bytes response anyhow.
+ */
+ if (psmouse->pktsize == 3)
+ psmouse->resync_time = 0;
+
+ /*
+ * Some smart KVMs fake response to POLL command returning just
+ * 3 bytes and messing up our resync logic, so if initial poll
+ * fails we won't try polling the device anymore. Hopefully
+ * such KVM will maintain initially selected protocol.
+ */
+ if (psmouse->resync_time && psmouse->poll(psmouse))
+ psmouse->resync_time = 0;
+
sprintf(psmouse->devname, "%s %s %s",
psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name);

2005-12-24 18:49:14

by Joe Feise

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

Dmitry Torokhov wrote on 12/24/05 09:56:

> On Saturday 24 December 2005 01:43, Joe Feise wrote:
>> [Note: please cc me on answers since I'm not subscribed to the kernel list]
>>
>> I am experiencing problems with mouse resyncing in the -mm series.
>> This is a Logitech wheel mouse connected through a KVM.
>> Symptom: whenever the mouse isn't moved for some seconds, it doesn't
>> react to movement for a second, and then resyncs. Sometimes, the
>> resyncing results in the mouse pointer jumping, which as far as I
>> know is a protocol mismatch.
>> While searching for reports of similar problems, I came across
>> Frank Sorenson's post from Nov. 23 (http://lkml.org/lkml/2005/11/23/533).
>> Like in his case, reverting
>> input-attempt-to-re-synchronize-mouse-every-5-seconds.patch
>> resulted in a kernel without this problem.
>>
>
> Joe,
>
> Instead of reverting input-attempt-to-re-synchronize-mouse-every-5-seconds
> patch could youplease drop the patch below on top of -mm.
>
> Jet me know if your mouse stays synchronized. Thanks!
>


Dmitry,

thanks, that patch works. The mouse stays synchronized.

-Joe



Attachments:
signature.asc (189.00 B)
OpenPGP digital signature

2005-12-26 04:09:10

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

On Saturday 24 December 2005 05:57, Frank Sorenson wrote:
>
> I continue to see the same issues with the resync patch in -mm. For me,
> tapping stops working, and I'm now seeing both the mouse pointer jumping
> as well (a lesser issue for me, so it was probably present earlier as
> well).
>

Frank,

Does the tapping not work period or it only does not work first time you
try to tap after not touching the pad for more than 5 seconds?

--
Dmitry

2005-12-26 04:40:28

by Frank Sorenson

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dmitry Torokhov wrote:
> On Saturday 24 December 2005 05:57, Frank Sorenson wrote:
>
>>I continue to see the same issues with the resync patch in -mm. For me,
>>tapping stops working, and I'm now seeing both the mouse pointer jumping
>> as well (a lesser issue for me, so it was probably present earlier as
>>well).
>>
>
> Frank,
>
> Does the tapping not work period or it only does not work first time you
> try to tap after not touching the pad for more than 5 seconds?

The tapping works initially, then stops. I hadn't put 2+2 together with
the 5-second idle bit, but that seems the likely issue.

I applied that patch you sent out yesterday, and now tapping works and
I'm not seeing the mouse stall/jump problem. I'm at 21+ hours uptime
now, with no mouse problems, so I think setting the resync_time to 0
looks like the right fix.

Thanks,

Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDr3QuaI0dwg4A47wRApTrAKCznvvBq5lX66VPggjP6KTtbFQdDgCgmrhs
x+90pceDtoWznfjy6kBGaAs=
=e2Xa
-----END PGP SIGNATURE-----

2005-12-26 04:55:48

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

On Sunday 25 December 2005 23:40, Frank Sorenson wrote:
> Dmitry Torokhov wrote:
> > On Saturday 24 December 2005 05:57, Frank Sorenson wrote:
> >
> >>I continue to see the same issues with the resync patch in -mm. For me,
> >>tapping stops working, and I'm now seeing both the mouse pointer jumping
> >> as well (a lesser issue for me, so it was probably present earlier as
> >>well).
> >>
> >
> > Frank,
> >
> > Does the tapping not work period or it only does not work first time you
> > try to tap after not touching the pad for more than 5 seconds?
>
> The tapping works initially, then stops. I hadn't put 2+2 together with
> the 5-second idle bit, but that seems the likely issue.
>
> I applied that patch you sent out yesterday, and now tapping works and
> I'm not seeing the mouse stall/jump problem. I'm at 21+ hours uptime
> now, with no mouse problems, so I think setting the resync_time to 0
> looks like the right fix.
>

Well, no, that's a band-aid ;) There are still touchpads speaking 4-byte
protocols so I still need to adjust resync code to work with tapping.

--
Dmitry

2006-01-05 03:24:14

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

On Sunday 25 December 2005 23:40, Frank Sorenson wrote:
> Dmitry Torokhov wrote:
> > On Saturday 24 December 2005 05:57, Frank Sorenson wrote:
> >
> >>I continue to see the same issues with the resync patch in -mm. For me,
> >>tapping stops working, and I'm now seeing both the mouse pointer jumping
> >> as well (a lesser issue for me, so it was probably present earlier as
> >>well).
> >>
> >
> > Frank,
> >
> > Does the tapping not work period or it only does not work first time you
> > try to tap after not touching the pad for more than 5 seconds?
>
> The tapping works initially, then stops. I hadn't put 2+2 together with
> the 5-second idle bit, but that seems the likely issue.
>
> I applied that patch you sent out yesterday, and now tapping works and
> I'm not seeing the mouse stall/jump problem. I'm at 21+ hours uptime
> now, with no mouse problems, so I think setting the resync_time to 0
> looks like the right fix.
>

Frank,

Could you please try the patch below and see if it makes tapping work?
Make sure you enable resynching by doing:

echo -n 5 > /sys/bus/serio/devices/serioX/resync_time

Thanks!

--
Dmitry

Signed-off-by: Dmitry Torokhov <[email protected]>
---

drivers/input/mouse/alps.c | 11 ++++++-----
drivers/input/mouse/psmouse-base.c | 27 ++++++++++++++++++++++++---
2 files changed, 30 insertions(+), 8 deletions(-)

Index: work/drivers/input/mouse/alps.c
===================================================================
--- work.orig/drivers/input/mouse/alps.c
+++ work/drivers/input/mouse/alps.c
@@ -356,19 +356,20 @@ static int alps_poll(struct psmouse *psm
{
struct alps_data *priv = psmouse->private;
unsigned char buf[6];
+ int poll_failed;

if (priv->i->flags & ALPS_PASS)
alps_passthrough_mode(psmouse, 1);

- if (ps2_command(&psmouse->ps2dev, buf, PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)))
- return -1;
-
- if ((buf[0] & priv->i->mask0) != priv->i->byte0)
- return -1;
+ poll_failed = ps2_command(&psmouse->ps2dev, buf,
+ PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0;

if (priv->i->flags & ALPS_PASS)
alps_passthrough_mode(psmouse, 0);

+ if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0)
+ return -1;
+
if ((psmouse->badbyte & 0xc8) == 0x08) {
/*
* Poll the track stick ...
Index: work/drivers/input/mouse/psmouse-base.c
===================================================================
--- work.orig/drivers/input/mouse/psmouse-base.c
+++ work/drivers/input/mouse/psmouse-base.c
@@ -54,7 +54,7 @@ static unsigned int psmouse_smartscroll
module_param_named(smartscroll, psmouse_smartscroll, bool, 0644);
MODULE_PARM_DESC(smartscroll, "Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled.");

-static unsigned int psmouse_resetafter;
+static unsigned int psmouse_resetafter = 5;
module_param_named(resetafter, psmouse_resetafter, uint, 0644);
MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never).");

@@ -850,8 +850,29 @@ static void psmouse_deactivate(struct ps

static int psmouse_poll(struct psmouse *psmouse)
{
- return ps2_command(&psmouse->ps2dev, psmouse->packet,
- PSMOUSE_CMD_POLL | (psmouse->pktsize << 8));
+ if (ps2_command(&psmouse->ps2dev, psmouse->packet,
+ PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)))
+ return -1;
+
+ switch (psmouse->type) {
+ case PSMOUSE_PS2:
+ case PSMOUSE_PS2PP:
+ case PSMOUSE_IMPS:
+ case PSMOUSE_IMEX:
+ case PSMOUSE_LIFEBOOK:
+ case PSMOUSE_TRACKPOINT:
+/*
+ * If protocol may be used by "tappable" device (touchpad, touchscreen) try to "restore"
+ * tap data from the halfway-discarded packet
+ */
+ if ((psmouse->badbyte & 0x08) == (psmouse->packet[0] & 0x08))
+ psmouse->packet[0] |= psmouse->badbyte & 0x07;
+
+ default:
+ break;
+ }
+
+ return 0;
}


2006-01-06 08:29:44

by Frank Sorenson

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dmitry Torokhov wrote:
> On Sunday 25 December 2005 23:40, Frank Sorenson wrote:
>
>>Dmitry Torokhov wrote:

>>>Does the tapping not work period or it only does not work first time you
>>>try to tap after not touching the pad for more than 5 seconds?
>>
>>The tapping works initially, then stops. I hadn't put 2+2 together with
>>the 5-second idle bit, but that seems the likely issue.
>>
>>I applied that patch you sent out yesterday, and now tapping works and
>>I'm not seeing the mouse stall/jump problem. I'm at 21+ hours uptime
>>now, with no mouse problems, so I think setting the resync_time to 0
>>looks like the right fix.

> Frank,
>
> Could you please try the patch below and see if it makes tapping work?
> Make sure you enable resynching by doing:
>
> echo -n 5 > /sys/bus/serio/devices/serioX/resync_time

With this patch (on top of 2.6.15-mm1, right?), I see the mouse
stall/jump problem, but tapping appears to continue working. The
touchpad also seems to be extremely touchy. I get spurious taps with
very little pressure, and sometimes double-tap will select, then
immediately deselect.

Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDvio6aI0dwg4A47wRAmx5AJ9caJlziT8MfGdxSf/yzVhEGqxqfgCggE0M
P2wvTs9/Xbw/sXn8bc/Mk0Y=
=oGAz
-----END PGP SIGNATURE-----

2006-01-06 16:26:42

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

On 1/6/06, Frank Sorenson <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dmitry Torokhov wrote:
> > On Sunday 25 December 2005 23:40, Frank Sorenson wrote:
> >
> >>Dmitry Torokhov wrote:
>
> >>>Does the tapping not work period or it only does not work first time you
> >>>try to tap after not touching the pad for more than 5 seconds?
> >>
> >>The tapping works initially, then stops. I hadn't put 2+2 together with
> >>the 5-second idle bit, but that seems the likely issue.
> >>
> >>I applied that patch you sent out yesterday, and now tapping works and
> >>I'm not seeing the mouse stall/jump problem. I'm at 21+ hours uptime
> >>now, with no mouse problems, so I think setting the resync_time to 0
> >>looks like the right fix.
>
> > Frank,
> >
> > Could you please try the patch below and see if it makes tapping work?
> > Make sure you enable resynching by doing:
> >
> > echo -n 5 > /sys/bus/serio/devices/serioX/resync_time
>
> With this patch (on top of 2.6.15-mm1, right?), I see the mouse
> stall/jump problem, but tapping appears to continue working. The
> touchpad also seems to be extremely touchy. I get spurious taps with
> very little pressure, and sometimes double-tap will select, then
> immediately deselect.
>

I just want to confirm that when testing the patch you forced the
touchpad into PS/2 mode with psmouse.proto=exps, right?

Could you please enable i8042 debug (echo 1 >
/sys/modules/i8042/parameters/debug), move pointer and do coulple of
taps and touble-taps making sure there is 5 seconds intervals between
events and send me dmesg. Or is the mouse jerky and touchy even while
you using it continuously, without 5 seconds pauses?

--
Dmitry

2006-01-06 16:45:13

by Frank Sorenson

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dmitry Torokhov wrote:
> I just want to confirm that when testing the patch you forced the
> touchpad into PS/2 mode with psmouse.proto=exps, right?

Correct

> Could you please enable i8042 debug (echo 1 >
> /sys/modules/i8042/parameters/debug), move pointer and do coulple of
> taps and touble-taps making sure there is 5 seconds intervals between
> events and send me dmesg. Or is the mouse jerky and touchy even while
> you using it continuously, without 5 seconds pauses?

Odd. Looks like we've got quotes around the names in /sys/module (but
only for those compiled in--actual modules show correctly).

Anyway, I used /sys/module/"i8042"/parameters/debug, and I'll send you
the dmesg in another email.

The mouse is jerkey and touchy both with and without 5 second pauses. I
only see the complete mouse "stall" after 5-second pauses, though.

Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDvp59aI0dwg4A47wRAv4aAJ9+J80OvGQ1GMCFEAM/lQUyxx4+awCgjl7o
Y98BW+9mtxLyxclKtsb4qig=
=ON28
-----END PGP SIGNATURE-----

2006-01-06 22:31:04

by Frank Sorenson

[permalink] [raw]
Subject: Re: mouse issues in 2.6.15-rc5-mm series

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Frank Sorenson wrote:
> Dmitry Torokhov wrote:
>>>Frank,
>>>
>>>Could you please try the patch below and see if it makes tapping work?
>>>Make sure you enable resynching by doing:
>>>
>>> echo -n 5 > /sys/bus/serio/devices/serioX/resync_time
>
> With this patch (on top of 2.6.15-mm1, right?), I see the mouse
> stall/jump problem, but tapping appears to continue working. The
> touchpad also seems to be extremely touchy. I get spurious taps with
> very little pressure, and sometimes double-tap will select, then
> immediately deselect.

Sorry, all. I should have paid closer attention to the protocol it was
using. This behavior turned out to be the result of the command-line
parsing issue that Sam Ravnborg's patch addresses.

With the touchpad back in the right mode, I see the original behavior
(tapping stops working) with both resync patches.

Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDvu+VaI0dwg4A47wRArgiAJ4qxpieqLXvn1cNozB+w8BDlbN2BACg4K7Z
RfjchjnmcSEBUrUao5+lw2A=
=YzdX
-----END PGP SIGNATURE-----