On Wed, Nov 02, 2005 at 02:07:58PM +0100, Laurent Pinchart wrote:
> > Yes, if you don't like using the BKL (and I admit that it was a fun hack
> > for me to use it), just have a static semaphore in your driver for all
> > devices.
> 
> Using the BKL for new code is not recommanded,

Says who?

> so I'll use a static driver-wide semaphore.

That's fine.

> > Your only requirement is that it is outside of your local 
> > device structure so that you can syncronize things.
> 
> Obviously :-) I suppose the reason why I need a semaphore and can't use a 
> spinlock is that the call to kref_put in disconnect() must be protected by 
> the lock, and the release() function called by kref_put might sleep. Is that 
> right ? Is there another reason ?

Hm, I think kref_put might sleep, but I am not positive.  Try it with a
spinlock held and see if the kernel complains (after enabling the sleep
warning options in the DEBUG kernel options.)

thanks,

greg k-h


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to