I have had a closer look at what is going on in devio.c. (1) The user space driver submits a bulk urb to an interrupt endpoint via the usbdevfs ioctl USBDEVFS_SUBMITURB. The urb is sent, all is well. (2) The user space driver waits for the result by doing the (blocking) ioctl USBDEVFS_REAPURB. Since the urb has not yet completed, we go to sleep in proc_reapurb at the line up_read(&ps->devsem); schedule(); <=== sleeping here down_read(&ps->devsem); This is normal. In fact we will sleep forever unless I do step 3 below, since the modem isn't very talkative (normal)! (3) I plug another USB device into the (uhci) hub. (4) I get the following line in syslog kernel: usb-uhci-hcd.c: interrupt, status 2, frame# 811 (5) The completion handler for the urb in step 1 (async_completed) is called. The urb status is -EILSEQ (CRC error; maybe timed out?). (6) The urb is returned to the userspace driver. (7) The user space driver immediately submits a new bulk urb. This is going to happen a lot (we are in a short loop, see below). The time interval between the successive urbs generated is 0 or 1 jiffies. The urb is sent succesfully. (8) The urb completes straight away with status -EILSEQ. Since the user space driver has done a USBDEVFS_REAPURB, it immediately gets the result. (9) Goto step 7.
Question: why did the first urb complete with -EILSEQ when the other device was plugged in? Remark: once we get into the loop, the urbs are sent to the interrupt endpoint faster than the spec allows. Does this inspire any thoughts? Duncan. On Friday 21 June 2002 12:56 am, Duncan Sands wrote: > Reminder: > Alcatel modem attached to hub; when I attach another > device to the hub, syslog fills up with message like > usbdevfs: USBDEVFS_CONTROL failed dev 3 rqt 128 rq 6 len 490 ret -110 > usb_control/bulk_msg: timeout > usb-uhci.c: interrupt, status 2, frame# 1349 > > Summary: > Seems like a bug in usbdevfs. The attached program is enough to > trigger it. > > I can trigger the problem is follows: Alcatel modem attached. > Run (as root) the following program ("endpoint"): it opens endpoint > 0x81 (an interrupt endpoint) of the modem via usbdevfs. It then > tries to read 64 * 53 bytes from it (in real life this is used to get > info like the ADSL line being down). > > Now plug in another device - the system fills up with > usb-uhci.c: interrupt, status 2, frame# 1349 > type messages. > > If I don't run the program I can attach and unattach devices > (including the Alcatel modem) in all combinations without any > problems. > > (The program was hacked out of the user mode driver for the > Alcatel modem that was running when I connected the webcams > that triggered the original bug report). > > Looks like a usbdevfs bug, right? > > Duncan. > > On Saturday 15 June 2002 10:52 pm, Duncan Sands wrote: > > kernel 2.4.19-pre10 (observed with other 2.4 kernels also), usb-uhci > > USB Controller: VIA Technologies, Inc. UHCI USB (rev 04) > > > > Summary: system slows to a crawl, syslog fills up with (just a sample) > > > > usbdevfs: USBDEVFS_CONTROL failed dev 3 rqt 128 rq 6 len 490 ret -110 > > usb_control/bulk_msg: timeout > > usb-uhci.c: interrupt, status 2, frame# 1349 > > > > (syslog extract attached). This seems to go on forever. > > > > Reliable scenario: > > Alcatel speedtouch USB modem is connected and working. > > It is controlled by the user space driver which uses usbdevfs. > > I plug in another device (I have tried: a Dexxa webcam; a Philips > > toucam pro). The system slows to a crawl, etc as described above. > > > > Unreliable scenario: > > Speedtouch modem and other device plugged in since boot; both > > working correctly. Sometimes (usually during heavy usage), the > > system slows to a crawl, etc as described above. > > > > Any ideas? > > > > Duncan. > > > > PS: I used to think this was a problem with the driver for the > > dexxa webcam (=logitech webcam) until I bought a Philips > > webcam. ------------------------------------------------------- This sf.net email is sponsored by: Jabber Inc. Don't miss the IM event of the season | Special offer for OSDN members! JabberConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel