All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: USB mailing list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 1/4] USB: UDC core: Add udc_async_callbacks gadget op
Date: Fri, 04 Jun 2021 08:18:53 +0300	[thread overview]
Message-ID: <87y2bqb41u.fsf@kernel.org> (raw)
In-Reply-To: <20210520202144.GC1216852@rowland.harvard.edu>

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]


Alan Stern <stern@rowland.harvard.edu> writes:
> The Gadget API has a theoretical race when a gadget driver is unbound.
> Although the pull-up is turned off before the driver's ->unbind
> callback runs, if the USB cable were to be unplugged at just the wrong
> moment there would be nothing to prevent the UDC driver from invoking
> the ->disconnect callback after the unbind has finished.  In theory,
> other asynchronous callbacks could also happen during the time before
> the UDC driver's udc_stop routine is called, and the gadget driver
> would not be prepared to handle any of them.
>
> We need a way to tell UDC drivers to stop issuing asynchronous (that is,
> ->suspend, ->resume, ->disconnect, ->reset, or ->setup) callbacks at
> some point after the pull-up has been turned off and before the
> ->unbind callback runs.  This patch adds a new ->udc_async_callbacks
> callback to the usb_gadget_ops structure for precisely this purpose,
> and it adds the corresponding support to the UDC core.
>
> Later patches in this series add support for udc_async_callbacks to
> several UDC drivers.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

Thank you for working on this, Alan.

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

      reply	other threads:[~2021-06-04  5:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 20:21 [PATCH 1/4] USB: UDC core: Add udc_async_callbacks gadget op Alan Stern
2021-06-04  5:18 ` Felipe Balbi [this message]

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=87y2bqb41u.fsf@kernel.org \
    --to=balbi@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.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.