cmdq_pkt_poll_mask(9)
π 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
- 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