linux-stable/include/linux/usb
Alan Stern 7dc0c55e9f USB: UDC core: Add udc_async_callbacks gadget op
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.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20210520202144.GC1216852@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-04 13:51:55 +02:00
..
audio-v2.h
audio-v3.h
audio.h
c67x00.h
ccid.h
cdc-wdm.h
cdc.h
cdc_ncm.h
ch9.h
chipidea.h
composite.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
ehci-dbgp.h
ehci_def.h
ehci_pdriver.h
ezusb.h
functionfs.h
g_hid.h
gadget.h USB: UDC core: Add udc_async_callbacks gadget op 2021-06-04 13:51:55 +02:00
gadget_configfs.h
hcd.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
m66592.h
musb-ux500.h
musb.h
net2280.h
of.h
ohci_pdriver.h
otg-fsm.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
otg.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
pd.h usb: typec: tcpm: Honour pSnkStdby requirement during negotiation 2021-04-14 16:27:29 +02:00
pd_ado.h
pd_bdo.h
pd_ext_sdb.h
pd_vdo.h
phy.h
phy_companion.h
quirks.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
r8a66597.h
r8152.h
renesas_usbhs.h
rndis_host.h
role.h usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
sl811.h
storage.h
tcpm.h usb: typec: tcpm: Move TCPC to APPLY_RC state during PR_SWAP 2021-05-21 20:05:56 +02:00
tegra_usb_phy.h
typec.h usb: typec: Add typec_port_register_altmodes() 2021-04-09 16:07:41 +02:00
typec_altmode.h
typec_dp.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
typec_mux.h
typec_tbt.h
uas.h
ulpi.h
usb338x.h
usb_phy_generic.h
usbnet.h
xhci-dbgp.h