public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: Pavel Machek <pavel@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: locking in psmouse
Date: Sun, 6 Jun 2004 19:41:44 +0200	[thread overview]
Message-ID: <20040606174143.GA6561@ucw.cz> (raw)
In-Reply-To: <200404290740.18182.dtor_core@ameritech.net>

On Thu, Apr 29, 2004 at 07:40:17AM -0500, Dmitry Torokhov wrote:

> On Thursday 29 April 2004 04:58 am, Pavel Machek wrote:
> > Hi!
> > 
> > > > psmouse-base.c does not have any locking. For example psmouse_command
> > > > could race with data coming from the mouse, resulting in problem. This
> > > > should fix it.
> > > 
> > > Although I am not arguing that locking might be needed in psmouse module I
> > > am somewhat confused how it will help in case of data stream coming from the
> > > mouse... If mouse sent a byte before the kernel issue a command then it will
> > > be delivered by KBC controller and will be processed by the interrupt handler,
> > > probably messing up detection process. That's why as soon as we decide that
> > > the device behind PS/2 port is some kind of mouse we disable the stream mode.
> > 
> > Does that mean that mouse can not talk while we are sending commands
> > to it? That would help a bit.
> > 
> 
> Yes, check psmouse_probe. As soon as PSMOUSE_CMD_RESET_DIS acknowledged mouse
> should cease sending motion data. That still leaves possibility of screwing up
> detection if you are moving mouse while psmouse doing PSMOUSE_CMD_GETID.
> But I don't think we can do much about it as we'd like to know that the device
> is some kind of a mouse before we start messing with it.

I've updated the atkbd_command/atkbd_interrupt mechanism so that even
bytes coming from the keyboard when we're issuing a command shouldn't
disturb us. I've tested by banging my head at the keyboard while
plugging it in. ;)

Something like that might be worth implementing for psmouse as well.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  parent reply	other threads:[~2004-06-06 17:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-28 21:30 locking in psmouse Pavel Machek
2004-04-29  4:47 ` Dmitry Torokhov
2004-04-29  9:58   ` Pavel Machek
2004-04-29 12:40     ` Dmitry Torokhov
2004-04-29 19:43       ` Pavel Machek
2004-06-06 17:41       ` Vojtech Pavlik [this message]
2004-06-06 18:51         ` Pavel Machek
2004-06-06 19:34           ` Vojtech Pavlik
2004-04-29 16:02     ` Vojtech Pavlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040606174143.GA6561@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox