2004-06-16 02:10:33

by Jun Sun

[permalink] [raw]
Subject: [PATCH] make ps2 mouse work ...


I found this problem on a MIPS machine. The problem is
likely to happen on other register-rich RISC arches too.

cmdcnt needs to be volatile since it is modified by
irq routine and read by normal process context.

Jun


Attachments:
(No filename) (221.00 B)
040615.a-psmouse-cmdcnt-volatile.patch (456.00 B)
Download all attachments

2004-06-16 03:57:22

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] make ps2 mouse work ...

Jun Sun <[email protected]> wrote:
>
>
> I found this problem on a MIPS machine. The problem is
> likely to happen on other register-rich RISC arches too.
>
> cmdcnt needs to be volatile since it is modified by
> irq routine and read by normal process context.

volatile is not the preferred way to fix this up. This points at either a
locking error in the psmouse driver or a missing "memory" thingy in the
mips port somewhere.

Please describe the bug which led to this patch. Where was it getting stuck?

2004-06-16 12:11:58

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: [PATCH] make ps2 mouse work ...

On Tue, Jun 15, 2004 at 08:56:11PM -0700, Andrew Morton wrote:

> > I found this problem on a MIPS machine. The problem is
> > likely to happen on other register-rich RISC arches too.
> >
> > cmdcnt needs to be volatile since it is modified by
> > irq routine and read by normal process context.
>
> volatile is not the preferred way to fix this up. This points at either a
> locking error in the psmouse driver or a missing "memory" thingy in the
> mips port somewhere.
>
> Please describe the bug which led to this patch. Where was it getting stuck?

My current BK tree has this fixed using atomic bitfields, which do
compilation and memory barriers. I plan to sync it to Linus post 2.6.7.

--
Vojtech Pavlik
SuSE Labs, SuSE CR

2004-06-16 17:08:07

by Jun Sun

[permalink] [raw]
Subject: Re: [PATCH] make ps2 mouse work ...

On Wed, Jun 16, 2004 at 02:11:49PM +0200, Vojtech Pavlik wrote:
> On Tue, Jun 15, 2004 at 08:56:11PM -0700, Andrew Morton wrote:
>
> > > I found this problem on a MIPS machine. The problem is
> > > likely to happen on other register-rich RISC arches too.
> > >
> > > cmdcnt needs to be volatile since it is modified by
> > > irq routine and read by normal process context.
> >
> > volatile is not the preferred way to fix this up. This points at either a
> > locking error in the psmouse driver or a missing "memory" thingy in the
> > mips port somewhere.
> >
> > Please describe the bug which led to this patch. Where was it getting stuck?
>
> My current BK tree has this fixed using atomic bitfields, which do
> compilation and memory barriers. I plan to sync it to Linus post 2.6.7.
>

Can you post the patch here? I am sure many people are eagerly waiting
for the right fix. Plus there will be extra pairs of eyes to exam the fix.

Jun

2004-06-16 17:59:29

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: [PATCH] make ps2 mouse work ...

On Wed, Jun 16, 2004 at 10:04:46AM -0700, Jun Sun wrote:
> On Wed, Jun 16, 2004 at 02:11:49PM +0200, Vojtech Pavlik wrote:
> > On Tue, Jun 15, 2004 at 08:56:11PM -0700, Andrew Morton wrote:
> >
> > > > I found this problem on a MIPS machine. The problem is
> > > > likely to happen on other register-rich RISC arches too.
> > > >
> > > > cmdcnt needs to be volatile since it is modified by
> > > > irq routine and read by normal process context.
> > >
> > > volatile is not the preferred way to fix this up. This points at either a
> > > locking error in the psmouse driver or a missing "memory" thingy in the
> > > mips port somewhere.
> > >
> > > Please describe the bug which led to this patch. Where was it getting stuck?
> >
> > My current BK tree has this fixed using atomic bitfields, which do
> > compilation and memory barriers. I plan to sync it to Linus post 2.6.7.
> >
>
> Can you post the patch here? I am sure many people are eagerly waiting
> for the right fix. Plus there will be extra pairs of eyes to exam the fix.

Sure. Here it is.

--
Vojtech Pavlik
SuSE Labs, SuSE CR


Attachments:
(No filename) (1.08 kB)
psmouse-bits (6.71 kB)
Download all attachments