Re: [PATCH 1/2] usb: gadget: udc: core: update usb_ep_queue() documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oops; I was looking at kernel version v4.14-rc2.

Tuba Yavuz, Ph.D.
Assistant Professor
Electrical and Computer Engineering Department
University of Florida
Gainesville, FL 32611
Webpage: http://www.tuba.ece.ufl.edu/
Email: tuba@xxxxxxxxxxx
Phone: (352) 846 0202

________________________________________
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Sent: Monday, March 26, 2018 2:38 PM
To: Yavuz, Tuba
Cc: Felipe Balbi; Greg Kroah-Hartman; USB list
Subject: Re: [PATCH 1/2] usb: gadget: udc: core: update usb_ep_queue() documentation

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux