Skip to contentSkip to conversation

make psaux reconnect adjustable

PATCH [email protected] 3 participants 3 messages Aug 14, 2001

lore
Share & tools
lore
#0 lore raw

From [email protected] Tue Aug 14 11:57:23 2001

I can confirm what you suggest:
My mouse (Logitech wheel USB/PS2) sends indeed AA 00.
So, I extended my patch:
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)

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.

Before having an opinion about what would be appropriate, let me make sure that I understand the facts that you report.

You talk about reconnect, but what is your definition of reconnect? Is it that the mouse sends AA or AA 00, or is it that you unplug and replug the mouse?

Andries

#1 lore raw
Quoted 10 lines · [email protected] wrote:

From [email protected] Tue Aug 14 11:57:23 2001

I can confirm what you suggest:
My mouse (Logitech wheel USB/PS2) sends indeed AA 00.
So, I extended my patch:
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)

Quoted 2 lines

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

This is a serious bug in many user-space drivers. PS/2 mouse protocol was designed to easily re-synchronize (think about transmission errors/ lost bytes).

Quoted 1 line

With reconnect 0: Mouse is dead

This is a bug in all user-space drivers (understandable as the kernel tried to be too clever). They must send the proper ps2-enabling sequence after they see "aa 00".

Quoted 10 lines

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.

...

Add an "ioctl(PS2_TRANSPARENT)", to disable the current kernel policy. So new drivers which understand about "aa 00" sequences can act properly. Don't break existing apps.

#2 lore raw
In reply to [email protected]
Quoted 4 lines · Gunther Mayer

[email protected] wrote:
Add an "ioctl(PS2_TRANSPARENT)", to disable the current kernel policy. So new drivers which understand about "aa 00" sequences can act properly. Don't break existing apps.

Well, coneptually, an ioctl is the same as a sysctl. You allow the user / sysadmin to toggle the behaviour. Given Linus' love for ioctls, I opted for the sysctl.

But in principle, Andries is right: There's no reason why userspace can't handle it, so removing the thing (maybe with a boot param for some time to allow a smooth transition until all drivers are fixed) is the right thiing to do.

Regards,

Signature · 4 lines
Kurt Garloff                   <[email protected]>         [Eindhoven, NL]
Physics: Plasma simulations  <[email protected]>  [TU Eindhoven, NL]
Linux: SCSI, Security          <[email protected]>    [SuSE Nuernberg, DE]
 (See mail header or public key servers for PGP2 and GPG public keys.)