All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Yavuz, Tuba" <tuba@ece.ufl.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	USB list <linux-usb@vger.kernel.org>
Subject: usb: gadget: udc: core: Document the relation between usb_ep_queue() and completion callback
Date: Wed, 28 Mar 2018 10:40:25 +0300	[thread overview]
Message-ID: <87po3omyvq.fsf@linux.intel.com> (raw)

Hi,

Alan Stern <stern@rowland.harvard.edu> writes:
> Improve the kerneldoc for usb_ep_queue() to note explicitly that the
> request's completion routine will be called if and only if the return
> value is 0.  The corresponding fact about usb_submit_urb() for the
> host-side API has long been documented, and this has always been the
> intention for the gadget API.  But until now, documentation seems to
> have been lacking.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
>
> ---

Greg, I have this queued up for v4.18 already, but if you wanna take it
forward on v4.17 it's fine by me.

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>

>  drivers/usb/gadget/udc/core.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> Index: usb-4.x/drivers/usb/gadget/udc/core.c
> ===================================================================
> --- usb-4.x.orig/drivers/usb/gadget/udc/core.c
> +++ usb-4.x/drivers/usb/gadget/udc/core.c
> @@ -241,6 +241,12 @@ EXPORT_SYMBOL_GPL(usb_ep_free_request);
>   * Returns zero, or a negative error code.  Endpoints that are not enabled
>   * report errors; errors will also be
>   * reported when the usb peripheral is disconnected.
> + *
> + * If and only if @req is successfully queued (the return value is zero),
> + * @req->complete() will be called exactly once, when the Gadget core and
> + * UDC are finished with the request.  When the completion function is called,
> + * control of the request is returned to the device driver which submitted it.
> + * The completion handler may then immediately free or reuse @req.
>   */
>  int usb_ep_queue(struct usb_ep *ep,
>  			       struct usb_request *req, gfp_t gfp_flags)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-03-28  7:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  7:40 Felipe Balbi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-27 14:27 usb: gadget: udc: core: Document the relation between usb_ep_queue() and completion callback Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87po3omyvq.fsf@linux.intel.com \
    --to=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tuba@ece.ufl.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.