On Wed, 25 Dec 2013, Matthias [ISO-8859-1] Bl�sing wrote:
> The slow down can be tracked to:
>
> usb_enable_interface(dev, intf, true);
>
> I springled comments like this:
>
>
> dev_info(&dev->dev, "T1\n");
> /* re-init hc/hcd interface/endpoint state */
> for (i = 0; i < config->desc.bNumInterfaces; i++) {
> struct usb_interface *intf = config->interface[i];
> struct usb_host_interface *alt;
> dev_info(&dev->dev, "T2-1\n");
>
> alt = usb_altnum_to_altsetting(intf, 0);
> dev_info(&dev->dev, "T2-2\n");
>
> /* No altsetting 0? We'll assume the first altsetting.
> * We could use a GetInterface call, but if a device is
> * so non-compliant that it doesn't have altsetting 0
> * then I wouldn't trust its reply anyway.
> */
> if (!alt)
> alt = &intf->altsetting[0];
>
> if (alt != intf->cur_altsetting) {
> dev_info(&dev->dev, "T2-X1\n");
> remove_intf_ep_devs(intf);
> dev_info(&dev->dev, "T2-X2\n");
> usb_remove_sysfs_intf_files(intf);
> dev_info(&dev->dev, "T2-X3\n");
> }
> intf->cur_altsetting = alt;
> dev_info(&dev->dev, "T2-3\n");
> usb_enable_interface(dev, intf, true);
> dev_info(&dev->dev, "T2-4\n");
> if (device_is_registered(&intf->dev)) {
> dev_info(&dev->dev, "T2-5\n");
> usb_create_sysfs_intf_files(intf);
> dev_info(&dev->dev, "T2-6\n");
> create_intf_ep_devs(intf);
> dev_info(&dev->dev, "T2-7\n");
> }
> }
> dev_info(&dev->dev, "T3\n");
>
> And got the attached log (minus my inline comments). As you can see it
> starts in the 5. call there it starts with a 5 second delay betewen T2-3
> and T2-4. In the next round 15s is reached and there it stays.
>
> My tests of a second run support this and are finalized by xsane
> freezing and the final GPF.
>
> Maybe this helps.
Okay, now we know that usb_enable_interface takes a long time. That
routine does nothing but call usb_enable_endpoint, which does nothing
but call usb_hcd_reset_endpoint, which calls the xhci_endpoint_reset
routine.
So we have traced the problem into xhci-hcd. You could trace it
farther down if you want, but at this point it probably would be more
productive to see what Sarah has to say. She may know about some new
changes that are not yet available in the development kernel.
Alan Stern
--
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