On Thu, 25 Apr 2019, Bollinger, Seth wrote: > Hello All, > > Recently I’ve been troubleshooting a problem with the host > controller dying and noticed that when the controller dies, the > system was unresponsive for a _long_ period of time. When I explored > the code a bit, I saw that xhci_handshake will spin with interrupts > disabled for up to 5 seconds. I also saw places where it would spin > for up to 10 seconds (I have not experienced this though…). 5 > seconds with interrupts disabled seems like an eternity. Are you certain that those places with the very long timeouts are called with interrupts disabled? > Is there a reason that it’s done this way? It looks like the code > was inherited from ehci, so the code has been used for a long period > of time. In ehci-hcd, the long timeouts occur only with interrupts enabled. Alan Stern > Would it be possible to wait for the command ring stopped event for 5 > seconds, then check the CRR bit and halt and die if it’s not > cleared? > > Thanks! > > Seth