On Sat, May 20, 2000, Axel Waggershauser <[EMAIL PROTECTED]> wrote:
> Does anybody ever tested the usb_reset_device() function in hub.c ?
I tested it when I wrote it. However, it was far from extensive. I tried
it with a couple of hubs I have plus the root hub on my 2 UHCI
controllers (VIA and Intel).
> I am currently developing a device driver for a digital panorama camera.
> For a remote server application it is neccesary to have the ability to
> initiate a usb reset without unpluging the device. I implemented an ioctl
> to initiate the usb reset. The problem is that the usb_reset_device
> function seems to disconnect the device two times and then connect it
> two times, trying to assign it 2 device numbers. This strategy seems not
> meaningfull to me (and it does obviously not work :-)).
>
> Here is some debug output (syslog):
> ... kernel: usb.c: USB new device connect, assigned device number 2
> ... kernel: dpcusb.c: probe: vendor id 0x6cf, device id 0x1010 ifnum:0
> ... kernel: dpcusb.c: bound to interface: 0
> ... kernel: dpcusb.c: open
> ... kernel: dpcusb.c: ioctl >>>
> ... kernel: dpcusb.c: reset_device
> ... kernel: usb.c: USB disconnect on device 2
> ... kernel: dpcusb.c: disconnect
> ... kernel: usb.c: USB disconnect on device 2
> ... kernel: usb.c: USB new device connect, assigned device number 2
> ... kernel: usb.c: USB new device connect, assigned device number 3
> ... kernel: usb.c: USB device descriptor short read (expected 8, got 0)
> ... kernel: dpcusb.c: ioctl <<<
> ... kernel: usb-uhci.c: interrupt, status 3, frame# 1036
> ... kernel: usb-uhci-debug.h: TD @ c21a38e0/021A38E0, MaxLen=7ff DT1
> EP=0 Dev=0 PID=( IN ) buf=00000000
> ... kernel: usb-uhci-debug.h: Len=7ff e0 IOC Stalled CRC/Timeo
> ... kernel: usb-uhci-debug.h: TD Link Terminate
> ... kernel: usb.c: USB device not accepting new address (error=-110)
>
> (the dpcusb.c is my driver, the used usb code is the backport patch
> 2.3.99pre7 -> 2.2.14)
>
> I only had a short look at the related hub and core code but i have no
> idea how to solve the problem.
>
> Can anybody help me? This would be very nice.
It looks like the device drops the connection when sent a reset. All of
my devices just reset and respond to id 0, however they don't drop the
connection.
I'll have to check the specs to see what exactly is supposed to happen.
But a quick workaround for now is the comment out the usb_disconnect
and usb_hub_port_connect_change calls in usb_reset_device.
You may also want to try the Alternate UHCI driver since that's what I
did all of my testing with, but I don't think it'll make much of a
difference. Or you can try the device through a hub.
BTW - On a related, but entirely different note. There is a race
condition with usb_reset_device. The hub code may enable a port which
causes the device there to respond to id 0, while we may reset the
device with usb_reset_device and that device will respond to 0. This will
cause all sorts of errors on the bus. We probably need a bus id 0
semaphore to protect against this problem.
> (The camera should be installed at the expo2000 NEXT week :-) )
Excellent.
JE
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]