USB request queuing?

From: Markus Grabner (grabner_at_icg.tu-graz.ac.at)
Date: 09/23/05


Date: Fri, 23 Sep 2005 22:50:05 +0200


        Hi all!

    According to the documentation of the function "usb_submit_urb" in the
file "drivers/usb/core/urb.c", it is possible to submit URBs without having
to wait for completion of previous ones. It also says that as of Linux 2.6,
all queues have depth greater than one. However, when calling
usb_submit_urb five times in a driver I am developing (tested with Linux
versions 2.6.8, 2.6.11.5, and 2.6.13.2), I observe the following strange
behaviour:
1.) The device only responds to the first URB.
2.) The completion handler is only called for the first two URBs.
3.) The remaining completion handlers are called when unloading the driver
module (with urb->status == -ESHUTDOWN).
4.) After reloading the driver module, not a single completion handler is
called (only when unloading the driver - see above).
5.) To fix that, I have switch off and on the device or rmmod/insmod the
uhci_hcd module, then it starts again at 1.)

Is this a problem with the USB subsystem (do I have to set the queue depth
explicitly?), or does it simply mean that the device doesn't like to
receive USB data in quick succession?

Any hints are appreciated!

        Thanks & kind regards,
                Markus

-- 
Markus Grabner - Computer Graphics and Vision
Graz University of Technology, Inffeldgasse 16/II, 8010 Graz, Austria
Phone: +43/316/873-5041, Fax: +43/316/873-5050
WWW: http://www.icg.tu-graz.ac.at/Members/grabner


Relevant Pages

  • Help - CUPS just spools, processes, and queues again...
    ... Anyone got ideas on how to *continue* printing in Linux? ... But now it just queues up, processes, and queues ... reinstall the driver, with no success, but maybe again? ...
    (comp.os.linux.setup)
  • Re: [PATCH] Airprime driver improvements to allow full speed EvDO transfers
    ... I've been able to run the driver with my own USB ... match 5Mbits/sec is copying of data into tty in the read callback. ... specially crafted ring buffer of chars, ... URBs along with their buffers where you put URBs in the read callback, ...
    (Linux-Kernel)
  • Re: [PATCH 5/5] usb_debug: EXPERIMENTAL - poll hcd device to force writes
    ... This conversion is done in the tty layer "the high level". ... the low level driver gets it character stream via the tty call backs ... You can always calculate with the number of URBs you'd ... had not seen it run out while using the standard tty driver. ...
    (Linux-Kernel)
  • Re: How to Fire Multiple URBs from allication or driver?
    ... your driver can send i/o to the device on its own without the application initiating it. ... If you use KMDF it has a feature called a continous reader which will constantly send N number of URBs to the device. ... you can get rid of your driver completely and do all of the i/o from the application. ... Both are available in the WDK. ...
    (microsoft.public.windowsxp.device_driver.dev)
  • Re: USB request queuing?
    ... The completion handler is only called for the first two URBs. ... The remaining completion handlers are called when unloading the driver ... AFAIK the longest queues are submitted by usb-storage. ...
    (comp.os.linux.development.system)