dwc2_hc_halt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dwc2_hc_halt(9) β€” the Kernel API Manual, bestie edition

okay so this is a page from the Kernel API Manual, and we're talking about dwc2_hc_halt(9) β€” no cap, it's the whole "please stop, bestie" button for a host channel. Let's go πŸŽ€


✨ NAME ✨

dwc2_hc_halt β€” literally attempts to halt a host channel πŸ›‘


🌸 SYNOPSIS 🌸

void dwc2_hc_halt (struct dwc2_hsotg *hsotg , struct dwc2_host_chan
*chan , enum dwc2_halt_status halt_status );

πŸ’– ARGUMENTS πŸ’–

  • hsotg β€” the controller register interface. your main character, the hardware itself 🫢
  • chan β€” the host channel you're about to halt. bye queen πŸ’…
  • halt_status β€” the reason for halting the channel. spill the receipts, why are we stopping πŸ“‹

πŸ”₯ DESCRIPTION πŸ”₯

Heads up, bestie, this one has rules: this function should only be called in Slave mode, or to abort a transfer in either Slave mode or DMA mode. Under normal circumstances in DMA mode, the controller is the one who halts the channel β€” it does that when the transfer is complete, or when some condition pops up that requires the application to step in. so like, don't just call it whenever, iykyk πŸ™ˆ

In slave mode, it first checks whether there's a free request queue entry, then sets the Channel Enable and Channel Disable bits of the Host Channel Characteristics register of the specified channel to initiate the halt. iconic behavior ✨

But wait β€” if there is no free request queue entry, it sets only the Channel Disable bit of the HCCHARn register to flush requests for this channel. In that latter case, it sets a flag to indicate that the host channel needs to be halted once a request queue slot opens up. patient queen ⏳

In DMA mode, it always sets the Channel Enable and Channel Disable bits of the HCCHARn register. The controller makes sure there's space in the request queue before it goes ahead and submits the halt request. no cap, it checks first 🧚

giant mood: some time may elapse before the core actually flushes any posted requests for this host channel and halts. The Channel Halted interrupt handler is the one that completes the deactivation of the host channel β€” so don't be out here thinking it's instant 😭

🌈 SEE ALSO 🌈

Kernel file ./drivers/usb/dwc2/hcd.c β€” and honestly the whole friend group:


and that's the page, bestie 🫢 this lil' entry lives over in ./drivers/usb/dwc2, and the version we're all reading is dated October 2026 β€” screenshot it, cite it, slay it πŸ’…βœ¨

πŸ“¦ where this page comes from