Re: mouse driver bug in 2.6.0-test7?

From: Vojtech Pavlik
Date: Tue Oct 14 2003 - 14:40:07 EST


On Tue, Oct 14, 2003 at 09:18:34PM +0200, Martin Josefsson wrote:
> On Tue, 2003-10-14 at 20:04, 4Front Technologies wrote:
> > Why is the PS2 mouse tracking about 2x faster in 2.6.0-test7 compared
> > to 2.4.xx?. Has anybody else seen this problem?.
> >
> > If I move the mouse 1 inch horizontally left-to-right on the mouse
> > pad, the cursor on the screen moves almost twice the distance on the
> > screen compared to Linux 2.4.xx
>
> It's probably mostly because Vojtech changed the samplerate from 200 to
> 60. Here's a patch to change it back. I've sent it to Vojtech but he's
> completely ignored it so far. This patch also readds the fallback logic
> that was used before his change, although it uses the new
> samplerate-table.
>
> Without this patch my mouse is awful to use.
> Vojtech, please consider this patch, at least say yay or nay.

Patch considered. I'll up the samplerate default to 80, but not more,
since samplerates above that cause trouble for a lot of people (keyboard
doesn't work when you're moving the mouse).

The "set lower rate in case ..." part of the patch doesn't make sense.
If the user gives a too low (less than 10) samples per second, then the
original code will try to set 0, which is stupid, but harmless. The
added code will try to access beyond the bounds of the rates[] array.

> --- linux-2.6.0-test6-mm4/drivers/input/mouse/psmouse-base.c.orig 2003-10-05 17:02:23.000000000 +0200
> +++ linux-2.6.0-test6-mm4/drivers/input/mouse/psmouse-base.c 2003-10-05 17:06:55.000000000 +0200
> @@ -40,7 +40,7 @@
>
> static int psmouse_noext;
> int psmouse_resolution;
> -unsigned int psmouse_rate = 60;
> +unsigned int psmouse_rate = 200;
> int psmouse_smartscroll = PSMOUSE_LOGITECH_SMARTSCROLL;
> unsigned int psmouse_resetafter;
>
> @@ -450,6 +450,11 @@
> int i = 0;
>
> while (rates[i] > psmouse_rate) i++;
> +
> + /* set lower rate in case requested rate fails */
> + if (rates[i])
> + psmouse_command(psmouse, rates + i + 1, PSMOUSE_CMD_SETRATE);
> +
> psmouse_command(psmouse, rates + i, PSMOUSE_CMD_SETRATE);
> }
>
>
> --
> /Martin



--
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/