> -----Original Message----- > From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb- > owner@xxxxxxxxxxxxxxx] On Behalf Of Sarah Sharp > Sent: Thursday, August 04, 2011 2:28 AM > To: Xu, Andiry > Cc: linux-usb@xxxxxxxxxxxxxxx; gregkh@xxxxxxx; > stern@xxxxxxxxxxxxxxxxxxx > Subject: Re: [PATCH 6/8] xHCI: calculate HIRD > > On Tue, Jul 26, 2011 at 08:37:36AM +0800, Andiry Xu wrote: > > Calculate HIRD(Host Initiated Resume Duration) in USB2 PORTPMSC based > on > > the host's U2 Device Exit Latency field. > > > > Signed-off-by: Andiry Xu <andiry.xu@xxxxxxx> > > --- > > drivers/usb/host/xhci-mem.c | 17 +++++++++++++++++ > > drivers/usb/host/xhci.h | 2 ++ > > 2 files changed, 19 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci- > mem.c > > index 2b4cff9..83ba59b 100644 > > --- a/drivers/usb/host/xhci-mem.c > > +++ b/drivers/usb/host/xhci-mem.c > > @@ -1927,6 +1927,21 @@ static int xhci_setup_port_arrays(struct > xhci_hcd *xhci, gfp_t flags) > > return 0; > > } > > > > +/* Calculate HIRD for USB2 PORTPMSC*/ > > +static void xhci_calculate_hird(struct xhci_hcd *xhci) > > +{ > > + int u2del; > > + > > + u2del = HCS_U2_LATENCY(xhci->hcs_params3); > > + if (u2del <= 50) > > + xhci->hird = 0; > > + else > > + xhci->hird = (u2del - 51) / 75 + 1; > > + > > + if (xhci->hird > 15) > > + xhci->hird = 15; > > +} > > + > > Can you store the hird in microseconds instead of converting it for the > USB 2.0 port PM register format? The USB 3.0 exit latency in the port > PM status register is going to want to use the unconverted value, so it > makes sense to move the conversion into (or into a new function above) > the hub code that turns on USB 2.0 LPM. > Well, I suppose USB 3.0 devices should use the wU2DevExitLat field in their SuperSpeed Device Capabilities descriptor instead. > Also, the latest version of the 1.0 spec that I have seems to be a bit > different from what you're using to code this. It renames the port PM > status register HIRD field to BESL, and adds some fields in a new > register, Port Hardware LPM Control Register. It also adds some text > to > section 4.23.5.1.1.1 about how to handle these fields. I think you'll > need to revise your patchset to handle that change. Writing to the > fourth port status register should have no effect for xHCI 1.0 hosts > that don't support it, since they should ignore those writes. > I think you're referring to xHCI 1.0 errata. It has a lot of changes from xHCI 1.0 spec, which causes pain to driver developers. I don't have the HW which is compliant with xHCI 1.0 errata so I can not verify the code after modification; also it changes the definition of USB2 PORTPMSC register. If the HCIVERSION of new HW is still 0100h, how does driver distinguish them? I'm afraid I don't have the resource to implement xHCI 1.0 errata, since I may switch to other tasks. Thanks, Andiry -- 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