cmdq_pkt_poll_addr(9)
π cmdq_pkt_poll_addr(9) β the Kernel API Manual, but make it cute
okay so bestie, welcome to the cmdq_pkt_poll_addr page from the Kernel API Manual β¨ this one's short and sweet and honestly kind of a baddie β it's all about making the GCE wait for a register to hit a value. let's get into it π«Ά
πΈ NAME πΈ
cmdq_pkt_poll_addr β appends a blocking POLL command to a CMDQ packet π
Translation: you're yeeting a "wait until this register looks right" instruction into your packet, and literally everything stops until it does. main character energy, but make it a spin-loop π
β¨ SYNOPSIS β¨
int cmdq_pkt_poll_addr (struct cmdq_pkt *pkt , dma_addr_t addr , u32
value , u32 mask );
four args, one int back. slay. π
π¦ ARGUMENTS π¦
pktβ the CMDQ packet. this is the little envelope you're stuffing your command into πaddrβ the hardware register address. where the drama is happening, fr frvalueβ the specified target register value. the number you're literally waiting for πmaskβ the specified target register mask. the filter that decides which bits you actually care about π―
π DESCRIPTION π
so here's the vibe: this function appends a polling (POLL) command to the CMDQ packet, and it asks the GCE to execute an instruction that checks for the specified value β with or without mask, your choice β to appear in the specified hardware register addr π
and the important part, bestie, do NOT miss this:
All GCE threads will be blocked by this instruction. all of them. every single one. it's giving "the whole group chat is waiting on you to reply" energy π
so yeah β super useful, but it does not play about holding everything up π
π RETURN π
0 for success, or a negative error code π (iykyk, go check that return value)
π SEE ALSO π
the kernel file that started it all:
./include/linux/soc/mediatek/mtk-cmdq.h
and the whole cmdq friend group, all here, all iconic, all linked π:
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_poll_mask(9),cmdq_pkt_logic_command(9),cmdq_pkt_assign(9)cmdq_pkt_jump_abs(9),cmdq_pkt_jump_rel(9),cmdq_pkt_jump_rel_temp(9),cmdq_pkt_eoc(9)
and that's the page, bestie π this one lives at ./include/linux/soc/mediatek, and the manual's dated October 2026 β so go forth, poll that address, and remember to unblock your threads. bye ily π¦π
π¦ 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