tty_port_link_wq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 β€” the tty_port of 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