dwc2_wait_timer_fn(9)
okay bestie, welcome to dwc2_wait_timer_fn(9) from the Kernel API Manual β this one is a little timer cutie and she has lore π
β¨
πΈ NAME πΈ
dwc2_wait_timer_fn β timer function to re-queue after waiting π
π¦ SYNOPSIS π¦
enum hrtimer_restart dwc2_wait_timer_fn (struct hrtimer *t );
π ARGUMENTS π
tβ pointer towait_timerin aqh. that's the whole vibe π«Ά
π DESCRIPTION π
So per the spec, a NAK means: "a function is temporarily unable to transmit or receive data, but will eventually be able to do so without need of host intervention". Translation: they're not ghosting forever, they just can't rn π
Which means when we hit a NAK, we're supposed to retry. periodt.
...but bestie, if we retry right away β like, straight from the interrupt handler that saw the NAK β we can end up with an interrupt storm if the other side keeps NAKing us. Why? Because on slow enough CPUs it could take us longer to get out of the interrupt routine than it takes for the device to send another NAK. That leads to a constant stream of NAK interrupts and the CPU locks π
...so instead of retrying immediately when we get a NAK, we set a timer to retry some time later. This function handles that timer, moves the qh back to the "inactive" list, then queues transactions. iconic behavior honestly β¨
β RETURN β
HRTIMER_NORESTART β so this timer does not automatically restart. no cap π«Ά
π SEE ALSO π
Kernel file: ./drivers/usb/dwc2/hcd_queue.c
Also go give these icons a look π: dwc2_periodic_channel_available(9), dwc2_check_periodic_bandwidth(9), pmap_schedule(9), pmap_unschedule(9), dwc2_get_ls_map(9), dwc2_qh_print(9), dwc2_qh_schedule_print(9), dwc2_ls_pmap_schedule(9), dwc2_ls_pmap_unschedule(9), dwc2_hs_pmap_schedule(9), dwc2_hs_pmap_unschedule(9), dwc2_uframe_schedule_split(9), dwc2_uframe_schedule_hs(9), dwc2_uframe_schedule_ls(9), dwc2_uframe_schedule(9), dwc2_uframe_unschedule(9), dwc2_pick_first_frame(9), dwc2_do_reserve(9), dwc2_do_unreserve(9), dwc2_unreserve_timer_fn(9), dwc2_check_max_xfer_size(9), dwc2_schedule_periodic(9), dwc2_deschedule_periodic(9), dwc2_qh_init(9), dwc2_hcd_qh_create(9), dwc2_hcd_qh_free(9), dwc2_hcd_qh_add(9), dwc2_hcd_qh_unlink(9), dwc2_next_for_periodic_split(9), dwc2_next_periodic_start(9), dwc2_hcd_qtd_init(9), dwc2_hcd_qtd_add(9).
mwah π this page came from source/version ./drivers/usb/dwc2 and is dated October 2026 β slay and goodbye bestie π
π¦ 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