On Mon, Aug 08, 2011 at 05:44:17PM +0800, Andiry Xu wrote: > On Fri, 2011-08-05 at 09:33 -0700, Sarah Sharp wrote: > > > > > > > > > > Well, I suppose USB 3.0 devices should use the wU2DevExitLat field in > > > their SuperSpeed Device Capabilities descriptor instead. > > > > The xHCI driver will need to use the host controller exit latency, on > > top of the wU2DevExitLat field, in order to calculate the max exit > > latency for a device. The driver will need to sum up the exit latencies > > for all parents of the device, including the roothub. I think it makes > > sense to store the host controller exit latency in its unconverted > > value. You can always convert it before you use it. > > > > I'm converting it to HIRD(BESL), which will only be used by USB2 LPM. > Driver can always retrieve the host controller exit latency at any time, > like this: > > + xhci->u2del = HCS_U2_LATENCY(xhci->hcs_params3); True. However, if you're not planning on sharing that value across multiple code paths, and you're not accessing it very often in a performance critical path, then why do you need to store it as a parameter in xhci_hcd? That structure is getting awfully large. > Yes, Table 13 is confusing me when I check the 1.0 errata. As you > notice, it does not only rename the field to BESL, but also re-define > the decoding value of the field: a value of 15 (1111h) represents 1.2ms > for HIRD in xHCI 1.0, while it decodes as 9950us(HIRD) in 1.0 errata. Ok, we'll see what Steve says. > Do you think USB2 hardware LPM can be applied to devices behind external > hubs? I don't think so. The controls for the latency settings are only attached to the roothub port registers, and the section on USB 2.0 hardware LPM has the title "Root Hub Port LPM Support". There's no way to enable USB 2.0 LPM in the slot context, which would be the logical place if hardware LPM also covered devices not directly attached to the roothub. There is the max exit latency field, but I think that's only used for hardware scheduling, not for enabling LPM. With USB 3.0 LPM, the expectation is that the USB 3.0 external hub will take care of automatically putting its links into deeper U-states. But we don't have that ability for USB 2.0 external hubs. Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html