[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian specific gpm brokenness



On Thu, Mar 13, 2003 at 12:28:15PM +0100, Josip Rodin wrote:
> On Thu, Mar 13, 2003 at 02:49:46AM -0800, Ron wrote:
> > The debian patches to 'rework' the ps2 interface happily ignore the
> > ps2 protocol.  While it appears to work for some accepting and/or
> > slow to respond devices, anything that promptly sends an ACK after
> > receiving a command request (as per the protocol description I've
> > seen) will cause (debian) gpm to (incorrectly) fail.
> 
> Can this be done via a separation like <some>ps2 + fu<some>ps2?

I'm not sure I understand what you mean (or that I was clear in the
above).  The ps/2 mouse protocol and all its extensions mandate the
device send an ACK for each byte sent to it, so for multibyte
commands the sequence is something like:

host: <command byte>
mouse: ACK
host: <data byte>
mouse: ACK

the write_to_mouse function in the original source does this correctly,
sending one byte at a time then confirming the response ACK.  The
write_ps2 replacement function in the debian patch attempts to 'optimise'
this by sending all bytes in a single write and then reading only a
single ack.

In my case this failed while I was attempting to emulate a (im)ps/2 mouse
via a fifo and having gpm and X read from it instead of the real device.
This has its own problems, which sadly I may not be able to fix outside
of kernel space [1], but my suspicion is that some real devices are acting
similarly and that this is what is causing the failures.

It's a simple 'patch to the patch' to correct it, but it makes me wonder
about the sanity of the rest of the patch, especially if upstream has
rejected it (which I don't know for sure but he's certainly aware of
our changes and had not applied this one).

I'm on the verge of sleep right now though, so anything above could also
contain errors :)

  Ron


[1] there appears to be no way of preventing gpm &c from reading back
    their own writes if the multiplexer doesn't clear the fifo in time,
    at least not without modifying them to know they are reading from a
    fifo and spinlocking on writes.  SIGIO _might_ help, but its not
    supported on fifo's till 2.5.20 or so.  If anyone knows a way to do
    this outside of kernel space I'd be grateful for a tip on that too.




Reply to: