pch_udc_free_dma_chain(9)
π pch_udc_free_dma_chain β Kernel API Manual β¨
okay so bestie, welcome to the pch_udc_free_dma_chain(9) page π this is the part of the kernel API manual where we talk about cleaning up β yes, the unglamorous but lowkey iconic part where the DMA chain for a request gets freed. no leaks, no leftovers, no mess. slay. π
β¨ NAME β¨
pch_udc_free_dma_chain β this function frees the DMA chain created for the request π§Ήπ«
like, it's literally the cleanup crew. the request's DMA chain has done its job and now it gets to rest. no cap.
π¦ SYNOPSIS π¦
void pch_udc_free_dma_chain (struct pch_udc_dev *dev , struct
pch_udc_request *req );
heads up: it's a void function, so there's nothing coming back at you. you call it, it does the freeing, you move on with your life. periodt. π
πΈ ARGUMENTS πΈ
devβ a reference to the driver structure π«Ά your pointer into thepch_udc_devworld.reqβ a reference to the request that's getting freed π this is the one being sent off into the void.
bestie please pass real, valid references. the manpage doesn't get spicy about it, and neither will I, but likeβ¦ yeah. π
β DESCRIPTION β
so here's the whole vibe: this function frees the DMA chain that was created for the request. that's it. that's the tea. π
Return codes: 0: Success π
ngl the fact that a void function is out here documenting return codes is giving main character energy and I respect it π but that's what the page says, so that's what you get. 0 means success. we love a zero. we stan a zero. β
π SEE ALSO π
okay this list is long long, so buckle up bestie β every single one of these is part of the pch_udc cinematic universe π¦ the kernel file is ./drivers/usb/gadget/udc/pch_udc.c, and the structs kick things off:
struct pch_udc_data_dma_desc(9), struct pch_udc_stp_dma_desc(9), struct pch_udc_cfg_data(9), struct pch_udc_ep(9), struct pch_vbus_gpio_data(9), struct pch_udc_dev(9), struct pch_udc_request(9)
then the CSR + wakeup + frame + selfpowered + disconnect crew π«
pch_udc_csr_busy(9), pch_udc_write_csr(9), pch_udc_read_csr(9), pch_udc_rmt_wakeup(9), pch_udc_get_frame(9), pch_udc_clear_selfpowered(9), pch_udc_set_selfpowered(9), pch_udc_set_disconnect(9), pch_udc_clear_disconnect(9), pch_udc_reconnect(9), pch_udc_vbus_session(9)
the endpoint girlies π (stall, transfer type, buffer size, max packet, subptr, ddptr, pd, rrdy):
pch_udc_ep_set_stall(9), pch_udc_ep_clear_stall(9), pch_udc_ep_set_trfr_type(9), pch_udc_ep_set_bufsz(9), pch_udc_ep_set_maxpkt(9), pch_udc_ep_set_subptr(9), pch_udc_ep_set_ddptr(9), pch_udc_ep_set_pd(9), pch_udc_ep_set_rrdy(9), pch_udc_ep_clear_rrdy(9)
DMA + interrupts + status/control/EP registers, aka the whole tech-deck π₯:
pch_udc_set_dma(9), pch_udc_clear_dma(9), pch_udc_set_csr_done(9), pch_udc_disable_interrupts(9), pch_udc_enable_interrupts(9), pch_udc_disable_ep_interrupts(9), pch_udc_enable_ep_interrupts(9), pch_udc_read_device_interrupts(9), pch_udc_write_device_interrupts(9), pch_udc_read_ep_interrupts(9), pch_udc_write_ep_interrupts(9), pch_udc_read_device_status(9), pch_udc_read_ep_control(9), pch_udc_clear_ep_control(9), pch_udc_read_ep_status(9), pch_udc_clear_ep_status(9), pch_udc_ep_set_nak(9), pch_udc_ep_clear_nak(9), pch_udc_ep_fifo_flush(9), pch_udc_ep_enable(9), pch_udc_ep_disable(9), pch_udc_wait_ep_stall(9)
init/exit and the peripheral-controller-driver (pcd) glow-up β¨:
pch_udc_init(9), pch_udc_exit(9), pch_udc_pcd_get_frame(9), pch_udc_pcd_wakeup(9), pch_udc_pcd_selfpowered(9), pch_udc_pcd_pullup(9), pch_udc_pcd_vbus_session(9), pch_udc_pcd_vbus_draw(9)
the vbus gpio squad π:
pch_vbus_gpio_get_value(9), pch_vbus_gpio_work_fall(9), pch_vbus_gpio_work_rise(9), pch_vbus_gpio_irq(9), pch_vbus_gpio_init(9), pch_vbus_gpio_free(9)
request handling + DMA chain creation (hey, that's our function's sibling!! π):
complete_req(9), empty_req_queue(9), pch_udc_create_dma_chain(9), prepare_dma(9), process_zlp(9), pch_udc_start_rxrequest(9)
the pcd endpoint + request API π:
pch_udc_pcd_ep_enable(9), pch_udc_pcd_ep_disable(9), pch_udc_alloc_request(9), pch_udc_free_request(9), pch_udc_pcd_queue(9), pch_udc_pcd_dequeue(9), pch_udc_pcd_set_halt(9), pch_udc_pcd_set_wedge(9), pch_udc_pcd_fifo_flush(9)
transfer + service routines, the ones doing the actual work π€:
pch_udc_init_setup_buff(9), pch_udc_start_next_txrequest(9), pch_udc_complete_transfer(9), pch_udc_complete_receiver(9), pch_udc_svc_data_in(9), pch_udc_svc_data_out(9), pch_udc_svc_control_in(9), pch_udc_svc_control_out(9), pch_udc_postsvc_epinters(9), pch_udc_read_all_epstatus(9), pch_udc_activate_control_ep(9), pch_udc_svc_ur_interrupt(9), pch_udc_svc_enum_interrupt(9), pch_udc_svc_intf_interrupt(9), pch_udc_svc_cfg_interrupt(9)
and finally the ISR + init/reinit + dma pool crew, closing us out π:
pch_udc_dev_isr(9), pch_udc_isr(9), pch_udc_setup_ep0(9), pch_udc_pcd_reinit(9), pch_udc_pcd_init(9), init_dma_pools(9)
iykyk π
fr fr though β if you're here reading a kernel DMA cleanup page, you're already kind of a legend. go free those chains. π«Ά
and that's the page!! π this one lives under ./drivers/usb/gadget/udc in the Kernel API Manual, last touched October 2026 β mwah, go touch some grass (or some pch_udc source) bestie, ily, bye!! πβ¨π¦
π¦ 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