On Mon, 26 Mar 2018, Yavuz, Tuba wrote:

> I agree with Alan that the spinlock must be dropped before calling
> usb_ep_queue. An example can be found in the ep0_queue function of
> the f_mass_storage driver.

Thanks for the note of support, but you must be looking at a different 
version of the f_mass_storage code than I am -- in my copy, ep0_queue 
does not acquire or release any locks.

I forgot to mention in my earlier email...  Felipe said that the 
problem case involved calling the completion handler for a failed 
submission.  That definitely is not the right approach; if a submission 
fails then usb_ep_queue() should return an error code and the 
completion routine should not be called.

In fact, there is a general principal here which should be documented
but doesn't seem to be (as far as I can tell).  Namely, a request's
completion routine will be called if and only if usb_ep_queue() returns
0.  That would make a good addition to the kerneldoc for 
usb_ep_queue().

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to