2004-04-22 07:47:32

by Kim Holviala

[permalink] [raw]
Subject: [PATCH] psmouse: fix mouse hotplugging

Note to myself: make small patches not big confusing ones.

This patch fixes hotplugging of PS/2 devices on hardware which don't
support hotplugging of PS/2 devices. In other words, most desktop machines.
Applies to at least 2.6.5, 2.6.6, 2.6.6-rc2 and 2.6.6-rc2-mm1.



Kim




--- linux-2.6.6-rc2/drivers/input/mouse/psmouse-base.c 2004-04-21 13:35:43.000000000 +0300
+++ linux-2.6.6-rc2-kim/drivers/input/mouse/psmouse-base.c 2004-04-21 13:50:16.753975235 +0300
@@ -470,7 +470,7 @@
* Then we reset and disable the mouse so that it doesn't generate events.
*/

- if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS))
+ if (psmouse_reset(psmouse))
printk(KERN_WARNING "psmouse.c: Failed to reset mouse on %s\n", psmouse->serio->phys);

/*


2004-04-22 15:46:42

by Horst H. von Brand

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

Kim Holviala <[email protected]> said:
> This patch fixes hotplugging of PS/2 devices on hardware which don't
> support hotplugging of PS/2 devices. In other words, most desktop
machines.

I have seen "hoplugging of mice" fry PS/2 ports, and heard of motherboards
killed that way.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513

2004-04-22 15:56:51

by Tomasz Torcz

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

On Thu, Apr 22, 2004 at 10:44:56AM +0300, Kim Holviala wrote:
> Note to myself: make small patches not big confusing ones.
>
> This patch fixes hotplugging of PS/2 devices on hardware which don't
> support hotplugging of PS/2 devices. In other words, most desktop machines.

Is this needed? I frequently "hotplug" my trackball when 2.6 is forgeting
about it. Replugin make it work again, spitting in logs:

Apr 18 20:04:35 mother input.agent[30260]: ... no modules for INPUT product
Apr 18 20:04:35 mother input.agent[30241]: ... no modules for INPUT product
Apr 18 20:04:35 mother input.agent[30266]: ... no modules for INPUT product 11/2/5/0
Apr 18 20:04:35 mother kernel: input: ImPS/2 Generic Wheel Mouse on isa0060/serio1
Apr 18 20:04:37 mother udev[30307]: removing device node '/udev/input/mouse0'
Apr 18 20:04:37 mother udev[30309]: removing device node '/udev/input/event0'
Apr 18 20:04:38 mother udev[30312]: configured rule in '/etc/udev/udev.rules' at line 76 applied, 'mouse0' becomes 'input/%k'
Apr 18 20:04:38 mother udev[30312]: creating device node '/udev/input/mouse0'
Apr 18 20:04:38 mother udev[30313]: configured rule in '/etc/udev/udev.rules' at line 77 applied, 'event0' becomes 'input/%k'
Apr 18 20:04:38 mother udev[30313]: creating device node '/udev/input/event0'

--
Tomasz Torcz ,,(...) today's high-end is tomorrow's embedded processor.''
[email protected] -- Mitchell Blank on LKML

2004-04-22 16:04:59

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

On Thu, 22 Apr 2004, Horst von Brand wrote:

> > This patch fixes hotplugging of PS/2 devices on hardware which don't
> > support hotplugging of PS/2 devices. In other words, most desktop
> machines.
>
> I have seen "hoplugging of mice" fry PS/2 ports, and heard of motherboards
> killed that way.

For older systems, a fuse would often blow on these ports, which
depending on the implementation would require a power cycle or a soldering
iron. Then one of those PCxx specs from Microsoft required the PS/2 ports
to support hot-plugging, so chances are it may pretty safe with recent
equipment.

--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: [email protected], PGP key available +

2004-04-22 16:18:19

by Meelis Roos

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

HvB> I have seen "hoplugging of mice" fry PS/2 ports, and heard of motherboards
HvB> killed that way.

AFAIK, PS/2 ports are since 1998 specified to be able to handle
hotplugging in the sense that they must not fry when devices are plugged
at runtime (but I don't remeber about any need to be able to _use_ these
hotplugged devices).

--
Meelis Roos

2004-04-22 18:08:10

by Kim Holviala

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

On Thursday 22 April 2004 18:46, Horst von Brand wrote:

> > This patch fixes hotplugging of PS/2 devices on hardware which don't
> > support hotplugging of PS/2 devices. In other words, most desktop
> > machines.
>
> I have seen "hoplugging of mice" fry PS/2 ports, and heard of motherboards
> killed that way.

And I've heard people rm -rf'ing their root. Yet rm is still included.

Anyway, the patch should also fix rare cases of KVM weirdness and an even
rarer cases of mouse not detected properly at boot.




Kim

2004-04-22 18:10:58

by Kim Holviala

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

On Thursday 22 April 2004 18:53, Tomasz Torcz wrote:

> > This patch fixes hotplugging of PS/2 devices on hardware which don't
> > support hotplugging of PS/2 devices. In other words, most desktop
> > machines.
>
> Is this needed? I frequently "hotplug" my trackball when 2.6 is forgeting
> about it. Replugin make it work again, spitting in logs:

It's mostly meant for cases where you hotplug some other mouse, not the same
one.


Kim

2004-04-22 22:00:56

by Ian Stirling

[permalink] [raw]
Subject: Re: [PATCH] psmouse: fix mouse hotplugging

Maciej W. Rozycki wrote:
> On Thu, 22 Apr 2004, Horst von Brand wrote:
>
>
>>>This patch fixes hotplugging of PS/2 devices on hardware which don't
>>>support hotplugging of PS/2 devices. In other words, most desktop
>>
>>machines.
>>
>>I have seen "hoplugging of mice" fry PS/2 ports, and heard of motherboards
>>killed that way.
>
>
> For older systems, a fuse would often blow on these ports, which
> depending on the implementation would require a power cycle or a soldering
> iron. Then one of those PCxx specs from Microsoft required the PS/2 ports
> to support hot-plugging, so chances are it may pretty safe with recent
> equipment.

Even for relatively newer kit, wierd stuff can happen.
I recall one keyboard/athlon 500 system that would reboot 10s after the keyboard
was plugged in, about 1% of the time.
Probably a KBC code bug, but unfixable.