On Thu, Jan 16, 2014 at 10:21:11AM +0000, David Laight wrote: > From: David Laight > > From: David Laight > > > From: Alan Stern > > > > On Wed, 15 Jan 2014, David Laight wrote: > > > > > > > > > I have a theory, I'll try to write a non-invasive patch. > > ... > > > > > > > > Doesn't this mean you shouldn't change the ownership of a LINK TRB > > > > until after you change the ownership of the TRB it points to? > > > > > > That is what I assume. > > > In practise this means that the 'first_trb' (whose ownership is set > > > last) has to be the one that is valid when prepare_ring() is called. > > > > > > The plan for the patch is: > > > - Save the enq pointer in prepare_ring (in the ep_ring structure). > > > - When writing a trb set the ownership unless it is the saved one > > > (ignoring the value set by the caller). > > > - At the end invert the ownership on the saved entry. > > > > Below is a possible patch, I've only compile tested it. > > I've minimalised the patch by not removing all the code that saves > > 'start_trb' and modifies the TRB_CYCLE bit. > > If the patch works those parts can also be tidied up. > > I've had some feedback (in a private email) that the patch helps. > This was using the ASMedia controller with the asx88179_178a > ethernet device. David, please post the contents of that private email to the list and Cc me. We don't debug in private in the kernel. > So the theory was definitely on the right lines. > And I managed to write the patch without any silly mistakes! Your theory about the ASMedia host may be correct. There are other host controllers (Synopsys, I think) that needed us to not give a link TRB over to the host until the TRB it pointed had the cycle bit set to hardware owned. ISTR that this was only triggered with USB 3.0 streams, at least on that Synopsys host. (BTW, you can find out why any part of the code was written by using `git blame filename`, although the original commit that fixed this bug has an entirely unhelpful description.) So, I agree that this needs to get fixed, especially since full UAS and streams support will be landing in the 3.15 kernel. However, I like the simple patch you posted much better than the second patch. The second patch is much too big to be back ported to stable, and we need to get this backported to stable. Please resend your previous patch. 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