On Friday 06 October 2006 9:57 pm, Christopher "Monty" Montgomery wrote: > On 10/7/06, David Brownell <[EMAIL PROTECTED]> wrote: > > > I'd made suggestions there ... probably the simplest way for things like > > the audio driver is to return a positive status code from urb submit, > > indicating a schedule lossage fault but not a submit error. Simple enough > > to make sure usbcore can pass such codes through, and all existing driver > > code should only be testing "retval < 0" for faults. > > > In the current code, the URB isn't actually submitted in that case. > We shouldn't return nonerror if the URB didn;t get submitted.
If it didn't get submitted, that would be an error. :) Terminology: "fault" == "some non-mainstream case, including but not limited to errors". "error" == "something that should not happen". So for example a page fault is not usually an error, unless it's because of a reference to an unmapped address. > If we do submit the URB as well as returning a positive error code, we > take away the possibility of the higher level driver being able to act > on the XRUN before the next URB is processed. I can't actually think > of a specific reason why that would be a problem, but it occurs to me > that it might. That was the other option, less straightforward for audio driver etc: return an error (like -EL2NSYNC) unless some magic flag was set. The difference is between audio/video/... drivers going code = usb_submit_urb(...); switch (code) { case -EL2NSYNC: /* report underrun */ /* add magic URB flag */ code = usb_submit_urb(...); /* whoa, messy code goes here to handle errors */ break; case 0: /* success, all is fine */ break; case -ESHUTDOWN: /* handle device going away */ break; case -Error1: /* handle it */ break; case -Error2: /* handle it */ break; ... default: /* log unexpected error, probably give up */ break; } And the same code with simpler logic for the underrun case ... assuming here it returns a POSITIVE code instead of negative: ... as above ... case EL2NSYNC: /* report underrun */ /* FALLTHROUGH case 0: /* success, all is fine */ break; ... as above ... Of course one could maybe combine the two, and require the magic flag to get that "positive" fault code behavior. - Dave ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel