No... the problem is that the _disconnect can be called at any point in
the usb-storage driver.  We need something -- if not a spinlock, then a
semaphore -- to protect this data structure.  It could be called while
we're idle (nominal case), or while we're in the middle of a multi-stage
device transaction.

If semaphores are safe to use around a call to schedule(), then that's
what I'll use.  The only reason I avoided them at all in this case
(you'll notice that I use it in other places) is because spinlocks are
supposed to be faster.  They probably are, but they just don't work in
this case.

Matt Dharm

On Mon, 3 Apr 2000, Pavel Machek wrote:

> Hi!
> 
> > > What's wrong with this?  We need to hold the spinlock to prevent the
> > > disconnect function from proceeding while we are using the device.
> > 
> > If you want to protect against the disconnect thread, you need
> > a semaphore, not a spinlock.
> 
> Thomas, is even semaphore neccessary? As I see it, disconnect can only
> be called when we block, and re-checking pointers after each blocking
> operation seems easy enough.
>                                                               Pavel
> 

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Engineer, Qualcomm, Inc.                         Work: [EMAIL PROTECTED]

I want my GPFs!!!
                                        -- Stef
User Friendly, 11/9/1998


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to