On Thu, 2011-09-22 at 14:49 +0200, Oliver Neukum wrote: > Hi, > > I see a device that fails during initialization after S3. It doesn't matter > when S3 happens. After the controller has undergone an S3 cycle > with or without the device, it becomes unable to cope with the device. > > I made logs with Andiry's debug patch cmd_ring.patch from the thread > "problems with usb 3.0 on clevo p150hm" > The problem is reproducible on xhci implementations from two vendors. > It happens at least on 3.0.4, 3.1-rc5 and 3.1-rc7 > > The logs are > xhcilog2.txt: taken with device plugged in > xhcilog.txt: taken with the device plugged in after resumption from S3 > > The device is problematic even on UHCI: > Oliver, Can you apply the patch attached to see if it helps? Sarah, According to the xhcilog2.txt Oliver sent, do you think there is a bug in the command ring TRB queueing? The last TRB of command ring should be a link TRB, but it's replaced by a Set TRDP command, and the deq and enq pointer moves out of the segment. Maybe there is something wrong in the room_on_ring() check for the command ring? Thanks, Andiry
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 70f8da0..7f3814c 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -782,6 +782,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) temp = xhci_readl(xhci, &xhci->op_regs->status); } + /* force the host to re-initialize */ + temp = STS_SRE; + /* If restore operation fails, re-initialize the HC during resume */ if ((temp & STS_SRE) || hibernated) { /* Let the USB core know _both_ roothubs lost power. */