cmdq_pkt_poll_mask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cmdq_pkt_poll_mask(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so real talk: this is a page from the Kernel API Manual (section 9, kernel devs only, no cap ✨) and it's about one very specific little function. sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

cmdq_pkt_poll_mask β€” append a polling command to the CMDQ packet, and ask GCE to run an instruction that waits for a specified hardware register to check for the value w/ mask. bestie, listen β€” all GCE hardware threads will be blocked by this instruction. like, all of them. it's giving main character energy at the hardware level πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int cmdq_pkt_poll_mask (struct cmdq_pkt *pkt , u8 subsys , u16 offset ,
u32 value , u32 mask );

that's the whole vibe. five args, one int back. lowkey elegant πŸ’…


🌸 ARGUMENTS 🌸

  • pkt β€” the CMDQ packet. the container, the moment, the whole point 🫢
  • subsys β€” the CMDQ sub system code (u8). which subsystem we're sliding into ✨
  • offset β€” register offset from CMDQ sub system (u16). where inside that subsystem the register lives 🎯
  • value β€” the specified target register value (u32). what you're looking for, fr fr πŸ‘€
  • mask β€” the specified target register mask (u32). the lil filter that decides which bits actually get checked πŸŽ€

⭐ RETURN ⭐

0 for success; else the error code is returned. so if it's 0, slay β€” you ate. anything else, that's your error code, go read it πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ

the kernel file lives right here, no cap:

./include/linux/soc/mediatek/mtk-cmdq.h

and the whole friend group, in the order the page gives them (yes, all of them, i'm not skipping a single one πŸ”₯):

cmdq_dev_get_client_reg(9), cmdq_mbox_create(9), cmdq_mbox_destroy(9), cmdq_pkt_create(9), cmdq_pkt_destroy(9), cmdq_pkt_write(9), cmdq_pkt_write_pa(9), cmdq_pkt_write_subsys(9), cmdq_pkt_write_mask(9), cmdq_pkt_write_mask_pa(9), cmdq_pkt_write_mask_subsys(9), cmdq_pkt_write_s(9), cmdq_pkt_write_s_mask(9), cmdq_pkt_write_s_value(9), cmdq_pkt_write_s_mask_value(9), cmdq_pkt_mem_move(9), cmdq_pkt_wfe(9), cmdq_pkt_acquire_event(9), cmdq_pkt_clear_event(9), cmdq_pkt_set_event(9), cmdq_pkt_poll(9), cmdq_pkt_logic_command(9), cmdq_pkt_assign(9), cmdq_pkt_poll_addr(9), cmdq_pkt_jump_abs(9), cmdq_pkt_jump_rel(9), cmdq_pkt_jump_rel_temp(9), cmdq_pkt_eoc(9)

πŸ’€ quick reminder bestie: that "all GCE hardware threads will be blocked" line is not a joke. this instruction parks every GCE hardware thread until it's done. plan accordingly, iykyk.

that's the whole page, periodt πŸ’– mwah, go read the source file, you've got this 🧚

β€” sourced from ./include/linux/soc/mediatek, dated October 2026, still vibing in section 9 of the Kernel API Manual πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from