On Mon, Nov 06, 2017 at 10:11:59AM +0100, Martin Pieuchot wrote: > On 06/11/17(Mon) 00:24, Paul Irofti wrote: > > Hi, > > > > This is a first step towards hopefully getting uvideo(4) to work with > > xhci(4). On my x260 I get buffer overrun and my machine freezes when > > running video(1) with xhci and uvideo debug messages enabled. > > Following fixes that. > > > > The proposed diff handles event under/overruns by dequeueing the current > > trb from the current segment on the event ring. I think we should do the > > same for other types of TRBs and that is why I added link support at the > > end of the dequeueing function. > > > > Thoughts? OKs? > > Why are we getting under/overruns in the first place? Is the driver > missing something?
There are multiple problems there that I wanted to talk to you about. First, without the diff the machine gets caught in an interrupt storm so something is certainly wrong with the driver. I get xhci0: slot 3 overrun wih 120 TRB in an infinite loop and systat confirms the numbers. Another interesting issue is that the paddr based trb_idx calculation is also screwed at that point even though we got a proper trb from the ring. So I think we are either missing something in xhci_device_isoc_start or we are not consuming data fast enough. Anyway, if I am reading the xhci specification correctly, we have to do at least what my diff proposes when an underrun or overrun event occurs.