Re: [patch]locking in idmouse

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Donnerstag 25 Oktober 2007 schrieb Laurent Pinchart:
> Hi Olivier,
> 
> On Tuesday 23 October 2007 14:23, Oliver Neukum wrote:
> > +++ work/drivers/usb/misc/idmouse.c	2007-10-23 14:13:52.000000000 +0200
> > @@ -80,7 +81,7 @@ struct usb_idmouse {
> >
> >  	int open; /* if the port is open or not */
> >  	int present; /* if the device is not disconnected */
> > -	struct semaphore sem; /* locks this structure */
> > +	struct mutex lock; /* locks this structure */
> >
> >  };
> 
> For what it's worth, I solved the same issue in the Linux UVC driver with a 
> kref instead of a lock (keeping the global lock of course). Not sure which 
> solution is better, but I thought it was worth mentioning it.

For a generic driver I consider the lock better, because a driver generally
will need a lock to be safe in the multithreaded case.

	Regards
		Oliver

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.