On Fri, 5 Mar 2004, David Brownell wrote: > > What I was suggesting earlier is that things could be slightly different. > > If unlink_urb returned an error code of -ENOMSG, then there would be no > > commitment to a completion callback. Hence submit_urb could follow the > > "normal" error pathway and return -ENOMSG. This is in line with the API > > semantics. > > Except ... how would unlink() know to do that? > > - It could of course always return some kind of error, but that > would be neither useful nor testable. > > Tests are just like any high-reliability driver: they need to > know for sure that an operation succeeded or failed, with fault > codes informative enough to specify a recovery action. > > - It could add even more complexity to the unlink logic, in HCDs > and usbcore; hence more ways to create bugs. It'd have to be > able to detect that dequeue() failed, and then revert work it > already did on the unlink. But hey, the HCD may already have > given back the URB, that work can't be reverted... > > As it stands, usbcore doesn't have a lot to do when unlinking; > just mark the URB, kick the HCD in case it needs it, and then > maybe do that annoying synchronous blocking. And the HCD has > little to do too ... which is good, lots of races lurk there. > > I don't like those two options as much as just succeeding. > Much simpler all around.
All right, fine. I still think my suggestion could have worked, but it's more straightforward doing it your way. If you submit the change to hcd_submit_urb() and corresponding adjustments for the OHCI and EHCI drivers, I'll change the UHCI driver to return -ENOMSG from submit() if the URB was already unlinked and update the appropriate documentation. While you're thinking about it, is there any reason for dequeue() to return anything other than void? Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel