mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 07:04:44 +00:00
7dc0c55e9f
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> |
||
---|---|---|
.. | ||
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 | ||
ehci-dbgp.h | ||
ehci_def.h | ||
ehci_pdriver.h | ||
ezusb.h | ||
functionfs.h | ||
g_hid.h | ||
gadget.h | ||
gadget_configfs.h | ||
hcd.h | ||
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 | ||
otg.h | ||
pd.h | ||
pd_ado.h | ||
pd_bdo.h | ||
pd_ext_sdb.h | ||
pd_vdo.h | ||
phy.h | ||
phy_companion.h | ||
quirks.h | ||
r8a66597.h | ||
r8152.h | ||
renesas_usbhs.h | ||
rndis_host.h | ||
role.h | ||
serial.h | ||
sl811.h | ||
storage.h | ||
tcpm.h | ||
tegra_usb_phy.h | ||
typec.h | ||
typec_altmode.h | ||
typec_dp.h | ||
typec_mux.h | ||
typec_tbt.h | ||
uas.h | ||
ulpi.h | ||
usb338x.h | ||
usb_phy_generic.h | ||
usbnet.h | ||
xhci-dbgp.h |