On 11/15/2017 01:52 AM, Juan Zea wrote:
>> On 11/14/2017 09:25 AM, Juan Zea wrote:
>>> Hi,
>>>
>>> I've been working on the issue. This is what I found about multi-controller
>>> setup:
>>>
>>> The problem comes from the usbip tool trying to connect usb2 devices to
>>> usb3 ports, like this:
>>>
>>> - usbip tool asks vhci driver for free port.
>>> - If the first port (usb2) is already occupied, vhci answers with usb3 port
>>> (instead of next controller's usb2 port)
>>> - usbip tool tries to connect usb2 device to usb3 port and fails
>>
>> It would be interesting to see how this fails. Can you send me complete
>> dmesg from client and server for this.
>
> I'm attaching two files for this: dmesg-usbip-server.txt and
> dmesg-usbip-client.txt
> Server is my own machine, and dmesg is too long, so I have selected latest
> lines. Hope it's enough.
> Client side is a kvm machine I'm using for these tests, so I made a clear
> boot just for this and its complete.
>
>
>>> - usbip tool asks for the next free port, which is still the same usb3
>>> port.
>>> - Loop the above forever
>>
>> That doesn't sound right.
>
> I'm also attaching usbip attach output with debug option
> (usbip-attach-debug.txt). I think it's interesting to see this for the
> forever loop.
>
>>>
>>> the code at tools/usb/usbip/libsrc/vhci_driver.c :
>>> 329 int usbip_vhci_get_free_port(uint32_t speed)
>>> 330 {
>>> 331 for (int i = 0; i < vhci_driver->nports; i++) {
>>> 332 if (speed == USB_SPEED_SUPER &&
>>> 333 vhci_driver->idev[i].hub != HUB_SPEED_SUPER)
>>> 334 continue;
>>> 335
>>> 336 if (vhci_driver->idev[i].status == VDEV_ST_NULL)
>>> 337 return vhci_driver->idev[i].port;
>>> 338 }
>>> 339
>>> 340 return -1;
>>> 341 }
>>>
>>> prevents usb3 devices connecting to usb2 ports, but not the other way
>>> around.
>>
>> Connecting usb2 device to usb3 port should work. It would make sense
>> to prevent usb3 devices connecting to usb2 ports, and not the other
>> way round.
>>
>
> Ok, that sounds right, but then... why having usb2 ports at all? Isn't it a
> nuisance to maintain code that duplicates the hubs if usb3 ports can do the
> job?>
Some systems have both usb2 and usb3 ports. You can't get rid of
usb2 or usb support. More specifically LOW_SPEED, and HIGH_SPEED
support can't be removed. usb2 devices work in usb3 port due to
backwards protocol compatibility. You will see xhci, ehci drivers
in the for this very same reason.
thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html