tty_port_link_wq(9)
π tty_port_link_wq β bestie's guide to the Kernel API Manual, section 9
okay so picture this: you're deep in kernel land, you've got a tty_port sitting there with no workqueue to its name, and you're like "girl, who's gonna flip my buffers??" π that's literally what this little function is for. it links a tty_port and a flip workqueue together like they're matching besties. π«Ά
β¨ SYNOPSIS β¨
void tty_port_link_wq (struct tty_port *port , struct workqueue_struct
*flip_wq );
that's it. two args, void return, no drama. π
πΈ ARGUMENTS πΈ
portβ thetty_portof the device, i.e. the main character of this whole operation πflip_wqβ the workqueue you want flip buffer work queued on. this is the one doing the actual labour ngl πͺ
π¦ DESCRIPTION π¦
okay so here's the vibe: whenever TTY_DRIVER_NO_WORKQUEUE is in play, every single tty_port can be linked to a workqueue manually β and this function is how you do it, by hand, yourself, like a responsible queen. β¨
and here's the cute fallback: if buf.flip_wq is NULL, the tty_port will just use system_dfl_wq instead. no workqueue? no problem, the default one's got you. π
β οΈ but listen β the tty_port API will NOT destroy the workqueue. say it with me: NOT. it'll link it up and then walk away, so cleanup is entirely on you, bestie. don't come crying when it leaks π
π SEE ALSO π
it's giving "extended family reunion" β the whole tty_port crew is here, plus the kernel file that started it all:
Kernel file ./drivers/tty/tty_port.c and then, in order:
tty_port_init(9), tty_port_link_device(9), tty_port_register_device(9), tty_port_register_device_attr(9), tty_port_register_device_attr_serdev(9), tty_port_unregister_device(9), tty_port_destroy(9), tty_port_put(9), tty_port_tty_get(9), tty_port_tty_set(9), tty_port_shutdown(9), tty_port_hangup(9), tty_port_tty_hangup(9), tty_port_tty_vhangup(9), tty_port_tty_wakeup(9), tty_port_carrier_raised(9), tty_port_raise_dtr_rts(9), tty_port_lower_dtr_rts(9), tty_port_block_til_ready(9), tty_port_close_start(9), tty_port_close_end(9), tty_port_close(9), tty_port_install(9), tty_port_open(9)
like, the whole friend group fr fr π«Ά
and that's the page!! sourced from ./drivers/tty, dated October 2026, living its best life as tty_port_link_wq(9) in the Kernel API Manual. slay, read responsibly, and go destroy your own workqueue π
β¨πΈ
π¦ 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