Documentation/usb/error-codes.txt
-EPROTO (*, **) a) bitstuff error
b) no response packet received within the
prescribed bus turn-around time
c) unknown USB error
-EILSEQ (*, **) a) CRC mismatch
b) no response packet received within the
prescribed bus turn-around time
c) unknown USB error
-ETIMEDOUT (**) No response packet received within the prescribed
bus turn-around time. This error may instead be
reported as -EPROTO or -EILSEQ.
由此我們可以判斷,這個錯誤與 usb 裝置的逾時有關。報告這個錯誤的地方在drivers/usb/core/hub.c中的hub_port_init部分,由於 usb_get_device_descriptor擷取 usb 裝置資訊的時候產生了逾時。這樣基本可以確定三種情況,1、usb 裝置及介面有問題;2、usb core有問題;3、usb driver有問題。
我們可以很容易地排除1和2的可能性,問題應該在usb driver implement部分造成的。2.6的usb driver把usb規範中對usb介面的操作集中到了core裡面,針對不同裝置的implement分別歸為host、gadget、storage 等。基本確定問題就在ohci-s3c2410.c裡。
跟蹤進入ohci-s3c2410.c,這裡面主要完成s3c2410 usb host裝置的初始化工作,包括電源、時鐘、寄存器等。
Q: Why doesn’t USB work at all? I get “device not accepting address”.
A: You may have some problem with your PCI setup that’s preventing your USB host controller from getting hardware interrupts. When Linux submits a request, but never hears back from the controller, this is the diagnostic you’ll see. To see if this is the problem, look at /proc/interrupts to see if the interrupt count for your host controller driver ever goes up. If it doesn’t, this is the problem: either your BIOS isn’t telling the truth to Linux (ACPI sometimes confuses these things, or setting the expected OS to windows in your BIOS), or Linux doesn’t understand what it’s saying.
Sometimes a BIOS fix will be available for your motherboard, and in other cases a more recent kernel will have a Linux fix. You may be able to work around this by passing the noapic boot option to your kernel, or (when you’re using an add-in PCI card) moving the USB adapter to some other PCI slot. If you’re using a current kernel and BIOS, report this problem to the Linux-kernel mailing list, with details about your motherboard and BIOS.
在include/asm-generic/errno.h中查了一下這個錯誤碼:
#define EINPROGRESS 115 /* Operation now in progress */
在Documentation/usb/error-codes.txt中的解釋是:
-EINPROGRESS URB still pending, no results yet
(That is, if drivers see this it’s a bug.)
這時無論插入什麼USB裝置,USB滑鼠、隨身碟、USB無線網卡,都報告:
<6>usb 1-1: new full speed USB device using s3c2410-ohci and address 2
<7>s3c2410-ohci s3c2410-ohci: urb c3c430c0 path 1 ep0in 5ec20000 cc 5 –> status -110