Re: [linux-usb-devel] [PATCH] USB: prevent char device open/deregister race

2007-05-23 Thread Alan Stern
On Tue, 22 May 2007, Greg KH wrote: On Tue, May 22, 2007 at 11:46:41AM -0400, Alan Stern wrote: This patch (as908) adds central protection in usbcore for the prototypical race between opening and unregistering a char device. The spinlock used to protect the minor-numbers array is replaced

Re: [linux-usb-devel] [PATCH] USB: prevent char device open/deregister race

2007-05-23 Thread Oliver Neukum
Am Mittwoch, 23. Mai 2007 17:28 schrieb Alan Stern: Although I really hate rw locks, I'll let it go for now, we can easily change it to a normal mutex in the future... In case it wasn't already obvious, the reason for making it an rwsem was so that multiple open() calls could run

Re: [linux-usb-devel] [PATCH] USB: prevent char device open/deregister race

2007-05-23 Thread Greg KH
On Tue, May 22, 2007 at 11:46:41AM -0400, Alan Stern wrote: This patch (as908) adds central protection in usbcore for the prototypical race between opening and unregistering a char device. The spinlock used to protect the minor-numbers array is replaced with an rwsem, which can remain locked

[linux-usb-devel] [PATCH] USB: prevent char device open/deregister race

2007-05-23 Thread Alan Stern
This patch (as908) adds central protection in usbcore for the prototypical race between opening and unregistering a char device. The spinlock used to protect the minor-numbers array is replaced with an rwsem, which can remain locked across a call to a driver's open() method. This guarantees that