Re: [PATCH] make psaux reconnect adjustable

From: Kurt Garloff (garloff@suse.de)
Date: Tue Aug 14 2001 - 04:57:01 EST


Hi Andries,

On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote:
> Your other mail implies that we can fix the problem without manual
> intervention by parsing AA 00 instead of just AA. If it's true, I'd=20
> consider that the best solution.=20
>
> Maybe precisely one person reported this, and his address
> now bounces. If there exist people who need this "psaux-reconnect"
> they can report on the codes they see. Note that just like AA is
> a perfectly normal code, also the sequence AA 00 is perfectly
> normal. Testing for that only diminishes the probability of
> getting it by accident.

I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends
indeed AA 00.
So, I extended my patch (which you will dislike even more, I know, as you're
against sysctls unlike me):
psmouse_reconnect = 0: Do nothing (just pass all to userspace)
psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default)
psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour)

> Instead of adding boot parameters or sysctls or heuristics,
> probably we should just transfer the codes seen to user space,
> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence
> and decide whether that is something special.

With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping
                        around the screen)
With reconnect 0: Mouse is dead

In both cases restarting gpm gets the mouse back to work again.
It seems the imps2 driver does some initialization to the mouse.

If I use the plain ps2 driver, then finally, I see the benefit of the
reconnect code in the kernel:
With reconnect = 1 or 2: It works after replugging
With reconnect = 0: Mouse is dead after replugging

In the latter case restarting gpm helps.

Patch is attached.
It adds the sysctls as the last patch did, but now the psmouse_reconnect has
3 possible values. Also, I added a printk, so the kernel logs detected mouse
reconnect events.

Linus, Alan, I'd like to have your input:

Do you like the patch as is? Should I remove the sysctls and just look for
AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace
as well in any case (to allow e.g. the imps2 driver to do reinitialization)?

Regards,

-- 
Kurt Garloff  <garloff@suse.de>                          Eindhoven, NL
GPG key: See mail header, key servers         Linux kernel development
SuSE GmbH, Nuernberg, DE                                SCSI, Security



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



This archive was generated by hypermail 2b29 : Wed Aug 15 2001 - 21:00:51 EST