Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!!

2007-04-06 Thread Greg KH
On Mon, Apr 02, 2007 at 12:06:45PM -0700, David Brownell wrote: > > > > That can certainly work, and it has the advantages of simplicity. > > > I wouldn't use that strategy in every driver of course, but I'd > > > guess it's fine for the serial and usblp cases mentioned here. > > > > Why would yo

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-06 Thread Greg KH
On Mon, Apr 02, 2007 at 08:03:27AM -0700, Pete Zaitcev wrote: > On Mon, 2 Apr 2007 01:52:22 -0700, Greg KH <[EMAIL PROTECTED]> wrote: > > > Why would you not want it in every driver? As Oliver is finding out, a > > lot of these "simple" drivers have races all due to their use of a > > pre-allocat

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-06 Thread Greg KH
On Mon, Apr 02, 2007 at 09:58:00AM -0400, Alan Stern wrote: > On Mon, 2 Apr 2007, Greg KH wrote: > > > On Mon, Apr 02, 2007 at 01:05:21AM -0700, David Brownell wrote: > > > On Sunday 01 April 2007 8:16 pm, Greg KH wrote: > > > > > > > > The way to properly solve this is to just never care about r

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!!

2007-04-02 Thread David Brownell
> > That can certainly work, and it has the advantages of simplicity. > > I wouldn't use that strategy in every driver of course, but I'd > > guess it's fine for the serial and usblp cases mentioned here. > > Why would you not want it in every driver? For starters, your pre-emptive claim that pe

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-02 Thread Pete Zaitcev
On Mon, 2 Apr 2007 01:52:22 -0700, Greg KH <[EMAIL PROTECTED]> wrote: > Why would you not want it in every driver? As Oliver is finding out, a > lot of these "simple" drivers have races all due to their use of a > pre-allocated urb. For what kind of situation would you feel this would > not work

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-02 Thread Alan Stern
On Mon, 2 Apr 2007, Greg KH wrote: > On Mon, Apr 02, 2007 at 01:05:21AM -0700, David Brownell wrote: > > On Sunday 01 April 2007 8:16 pm, Greg KH wrote: > > > > > > The way to properly solve this is to just never care about recycling > > > urbs. Look at what the visor driver does as an example o

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-02 Thread Greg KH
On Mon, Apr 02, 2007 at 01:05:21AM -0700, David Brownell wrote: > On Sunday 01 April 2007 8:16 pm, Greg KH wrote: > > > > The way to properly solve this is to just never care about recycling > > urbs. Look at what the visor driver does as an example of how you can > > just create a new urb for _e

Re: [linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-02 Thread David Brownell
On Sunday 01 April 2007 8:16 pm, Greg KH wrote: > > The way to properly solve this is to just never care about recycling > urbs. Look at what the visor driver does as an example of how you can > just create a new urb for _every_ instance, fire it off, and then forget > about it. It gets used and

[linux-usb-devel] urbs are REFERENCE COUNTED!!! [was Re: [PATCH]generic usb serial driver]

2007-04-01 Thread Greg KH
On Sat, Mar 31, 2007 at 09:26:52AM -0700, David Brownell wrote: > > There still remains the question of how to do this cleanly. Obviously > > some sort of synchronization primitive is needed. wait_for_completion() > > includes all the necessary memory barriers, whereas wait_event() does not. >