Re: [stable] [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-06-11 Thread Dmitry Torokhov
On Monday 11 June 2007 20:27, Chris Wright wrote: > * Thomas Gleixner ([EMAIL PROTECTED]) wrote: > > The PC-speaker code has a quite creative method to serialize access to > > the PIT: It uses a local lock. > > > > On i386 and x86_64 the access to the PIT is serialized by a lock in the > > archite

Re: [stable] [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-06-11 Thread Chris Wright
* Thomas Gleixner ([EMAIL PROTECTED]) wrote: > The PC-speaker code has a quite creative method to serialize access to > the PIT: It uses a local lock. > > On i386 and x86_64 the access to the PIT is serialized by a lock in the > architecture code. The separate locking in the PC-speaker code ignore

Re: [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Dmitry Torokhov
On Thursday 17 May 2007 10:49, Thomas Gleixner wrote: > On Thu, 2007-05-17 at 10:36 -0400, Dmitry Torokhov wrote: > > > BTW, there are more creative PIT users in drivers/input which use the > > > global lock already, but the PIT usage there is definitely broken on > > > anything >= 2.6.21. > > > >

Re: [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Andi Kleen
On Thursday 17 May 2007 16:49, Thomas Gleixner wrote: > Both read the PIT directly, which will lead to interesting results. The > PIT is either stopped or it can be used in one shot mode with per event > changing intervals due to the changes introduced by the clock events > layer. > > This code sh

Re: [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Thomas Gleixner
On Thu, 2007-05-17 at 10:36 -0400, Dmitry Torokhov wrote: > > BTW, there are more creative PIT users in drivers/input which use the > > global lock already, but the PIT usage there is definitely broken on > > anything >= 2.6.21. > > > > Are you talking about drivers/input/joystick/analog.c? What i

Re: [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Dmitry Torokhov
On 5/17/07, Thomas Gleixner <[EMAIL PROTECTED]> wrote: Dmitry, On Thu, 2007-05-17 at 10:15 -0400, Dmitry Torokhov wrote: > Hi Thomas, > > > +#include > > I don't see this file in include/asm-i386 and your patch only creates > asm-x86_64... [EMAIL PROTECTED] linux-2.6.21]$ ls include/asm-i386/i

Re: [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Thomas Gleixner
Dmitry, On Thu, 2007-05-17 at 10:15 -0400, Dmitry Torokhov wrote: > Hi Thomas, > > > +#include > > I don't see this file in include/asm-i386 and your patch only creates > asm-x86_64... [EMAIL PROTECTED] linux-2.6.21]$ ls include/asm-i386/i82* include/asm-i386/i8253.h include/asm-i386/i8259.h

Re: [PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Dmitry Torokhov
Hi Thomas, +#include I don't see this file in include/asm-i386 and your patch only creates asm-x86_64... BTW, is there any reason 8253pit.h can't be used...? Hmm... The best way IMO woudl be if arch code attached spinlock that should be used by pcspkr driver to pcspkr platform device (as pla

[PATCH] INPUT: Sanitize PIT locking in pcspkr

2007-05-17 Thread Thomas Gleixner
The PC-speaker code has a quite creative method to serialize access to the PIT: It uses a local lock. On i386 and x86_64 the access to the PIT is serialized by a lock in the architecture code. The separate locking in the PC-speaker code ignores the global lock and creates a nasty race between the