On 08/29/2013 11:32 PM, Alan Stern wrote:
On Thu, 29 Aug 2013, Martin MOKREJŠ wrote:

[snip]
I understand your point but don't think this is the case. OK, please show me why
is LPM not available. If USB is complaining about that being disabled it could
tell me based on what attribute at least. And printing the PCI device ID at 
least
would be helpful. Yeah, will look what that journald does.
Actually, it looks like the missing LPM functionality is caused by a
bug in drivers/usb/core/hcd.c.  The register_root_hub() routine does
this:

        if (usb_dev->speed == USB_SPEED_SUPER) {
                retval = usb_get_bos_descriptor(usb_dev);
                if (retval < 0) {
                        mutex_unlock(&usb_bus_list_lock);
                        dev_dbg(parent_dev, "can't read %s bos descriptor %d\n",
                                        dev_name(&usb_dev->dev), retval);
                        return retval;
                }
        }

Compare this to the code in hub.c:

        if (udev->wusb == 0 && le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0201) {
                retval = usb_get_bos_descriptor(udev);
                if (!retval) {
                        udev->lpm_capable = usb_device_supports_lpm(udev);
                        usb_set_lpm_parameters(udev);
                }
        }

You can see that register_root_hub() doesn't set udev->lpm_capable.
The missing call to usb_set_lpm_parameters() doesn't matter, because
root hubs don't have parent hubs.

Ksenia, can you send Martin patch to set udev->lpm_capable for root
hubs?  Note that this will require you to fix usb_device_supports_lpm()
as well; that routine dereferences udev->parent, but for root hubs
udev->parent is NULL.

[snip]

Alan Stern


Yes, sure! I will work on this tomorrow.

regards,
ksenia
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to