Re: USB: FIx locks and urb->status in adutux
Pete Zaitcev <[email protected]>
| Newsgroups | gmane.linux.usb.devel,gmane.linux.kernel |
|---|---|
| Organization | Red Hat, Inc. |
| Message-ID | <[email protected]> |
On Mon, 29 Oct 2007 20:04:57 +0200, Vitaliy Ivanov <[email protected]> wrote: > Finally had a time on my weekend to perform tests and fix Pete's patch a little. Now it seems to be correct. Great! > 1. One device per user space application. Old driver allowed many users application to work with same device which can lead to IO mess. OK. This trick was popular in UNIX. Personally I think it's in a bad taste, because good applications still need to verify if only one instance is running, and threfore can use application level locking. But if you are gunning for the maintenership I'm not going to argue your style. The busy lock-out certainly works better than "/dev/cua" :-) However, this looks wrong: > + dev->interrupt_in_endpoint->bInterval); > + dev->read_urb_finished = 0; > + retval = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL); > + /* we ignore failure */ > + /* end of fixup for first read */ > + > + /* initialize out direction */ > + dev->out_urb_finished = 1; The finished flag is only set when URB is not in use anymore. Did you observe an anomaly with my code? Any hangs? If so, I assure you this is not the fix. As it's written, even if we ignore the failure (e.g. do not pass it to userland), we sill have to maintain the correct flag state. -- Pete ------------------------------------------------------------------------- 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