usb_gadget_d...nc_callbacks(9)
π
usb_gadget_d...nc_callbacks(9) β a Kernel API Manual moment π
okay bestie, this page is short but it is doing important race-condition damage control, so pay attention. π
πΈ NAME πΈ
usb_gadget_disable_async_callbacks β the function that tells the usb device controller to disable asynchronous callbacks. yes, it's a mouthful, but she's worth it π
β¨ SYNOPSIS β¨
void usb_gadget_disable_async_callbacks (struct usb_udc *udc );
π ARGUMENTS π
udcβ the UDC which should disable async callbacks. that's the target, bestie π―
π¦ DESCRIPTION π¦
okay so this routine is what you use when you're unbinding gadget drivers. It's literally the race-condition prevention bestie: the UDC driver doesn't know when the gadget driver's ->unbind callback runs, so unless it is told to disable asynchronous callbacks, it might issue a callback (such as ->disconnect) after the unbind has completed. and that is exactly the kind of messy timeline we are not doing π
After this function runs, the UDC driver must suppress all ->suspend, ->resume, ->disconnect, ->reset, and ->setup callbacks to the gadget driver until async callbacks are again enabled. A simple-minded but effective way to accomplish this is to tell the UDC hardware not to generate any more IRQs. iconic, honestly π₯
Request completion callbacks must still be issued. However, it's okay to defer them until the request is cancelled, since the pull-up will be turned off during the time period when async callbacks are disabled. so yeah, deferring is allowed β the pull-up dips during that window π«Ά
This routine will always be called in process context. periodt. β¨
π SEE ALSO π
Kernel file: ./drivers/usb/gadget/udc/core.c
the whole squad, in order, no cap:
struct usb_udc(9)usb_ep_set_maxpacket_limit(9)usb_ep_enable(9)usb_ep_disable(9)usb_ep_alloc_request(9)usb_ep_free_request(9)usb_ep_queue(9)usb_ep_dequeue(9)usb_ep_set_halt(9)usb_ep_clear_halt(9)usb_ep_set_wedge(9)usb_ep_fifo_status(9)usb_ep_fifo_flush(9)usb_gadget_frame_number(9)usb_gadget_wakeup(9)usb_gadget_set_remote_wakeup(9)usb_gadget_set_selfpowered(9)usb_gadget_clear_selfpowered(9)usb_gadget_vbus_connect(9)usb_gadget_vbus_draw(9)usb_gadget_vbus_disconnect(9)usb_gadget_connect(9)usb_gadget_disconnect(9)usb_gadget_deactivate(9)usb_gadget_activate(9)usb_gadget_giveback_request(9)gadget_find_ep_by_name(9)usb_gadget_check_config(9)usb_udc_vbus_handler(9)usb_gadget_udc_reset(9)usb_gadget_udc_start_locked(9)usb_gadget_udc_stop_locked(9)usb_gadget_udc_set_speed(9)usb_gadget_enable_async_callbacks(9)usb_udc_release(9)usb_initialize_gadget(9)usb_add_gadget(9)usb_add_gadget_udc_release(9)usb_get_gadget_udc_name(9)usb_add_gadget_udc(9)usb_del_gadget(9)usb_del_gadget_udc(9)
okay that's the page, bestie π«Ά mwah π this one is from the source/version ./drivers/usb/gadget/udc corner, dated October 2026, and it's the usb_gadget_d...nc_callbacks(9) entry. no cap, that's the whole footer vibe β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms