usb_clear_halt(9)
β¨ usb_clear_halt(9) β¨
okay bestie, welcome to the Kernel API Manual page for usb_clear_halt(9) β this is the little function that goes "hey babe, you can stop stalling now" to a USB endpoint π
πΈ NAME πΈ
usb_clear_halt β tells the device to clear that endpoint's halt/stall situation, no cap π«Ά
π SYNOPSIS π
int usb_clear_halt (struct usb_device *dev , int pipe );
π¦ ARGUMENTS π¦
devβ the device whose endpoint is currently halted, like literally the one having a moment πpipeβ the endpoint "pipe" that's getting cleared, i.e. the one we're un-stalling β¨
β CONTEXT β
task context, and heads up: it might sleep π΄ (so don't be doing anything unhinged in there)
π DESCRIPTION π
So here's the tea π β this one is used to clear halt conditions for bulk and interrupt endpoints, as reported by URB completion status. Endpoints that are halted are sometimes called "stalled" (same energy, different word, iykyk). And likeβ¦ such endpoints are literally unable to transmit or receive data until the halt status is cleared. Not a vibe.
Any URBs queued for such an endpoint should normally be unlinked by the driver before clearing the halt condition β as described in sections 5.7.5 and 5.8.5 of the USB 2.0 spec π (yes, go read them, I'll wait).
Note that control and isochronous endpoints don't halt β although control endpoints do report a "protocol stall" (for unsupported requests) using the same status code that's used to report a true stall. Sneaky π
This call is synchronous, and it may not be used in an interrupt context. Periodt. And if a thread in your driver uses this call, make sure your disconnect method can wait for it to complete β like, actually wait, don't just ghost it π
π₯ RETURN π₯
Zero on success π β or else the status code returned by the underlying usb_control_msg call. That's it, that's the deal β¨
π SEE ALSO π
- Kernel file
./drivers/usb/core/message.cusb_control_msg(9) usb_control_msg_send(9)usb_control_msg_recv(9)usb_interrupt_msg(9)usb_bulk_msg(9)usb_bulk_msg_killable(9)usb_sg_init(9)usb_sg_wait(9)usb_sg_cancel(9)usb_get_descriptor(9)usb_get_string(9)usb_string(9)usb_cache_string(9)usb_get_status(9)usb_disable_endpoint(9)usb_reset_endpoint(9)usb_disable_interface(9)usb_disable_device(9)usb_enable_endpoint(9)usb_enable_interface(9)usb_set_interface(9)usb_reset_configuration(9)usb_set_wireless_status(9)usb_driver_set_configuration(9)cdc_parse_cdc_header(9)
and that's the whole page, bestie π§π this lil cutie lives in ./drivers/usb/core, dated October 2026, and it's filed under usb_clear_halt(9) β go forth and un-stall those endpoints, you absolute icon ππ
π¦ 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