cmdq_pkt_acquire_event(9)
π cmdq_pkt_acquire_event(9) β a Kernel API Manual moment
okay bestie, welcome to the Kernel API Manual. This page is called cmdq_pkt_acquire_event and honestly it's serving serious "let me in, let me IN" energy.
β¨ NAME β¨
cmdq_pkt_acquire_event β append an acquire event command to the CMDQ packet. That's it. That's the whole job. She appends, she acquires, she moves on. π
π¦ SYNOPSIS π¦
int cmdq_pkt_acquire_event (struct cmdq_pkt *pkt , u16 event );
Look at her. Two args, one int coming back. Simple, iconic, no notes. π
πΈ ARGUMENTS πΈ
pktβ the CMDQ packet. Like, the whole packet you're stuffing commands into. She's the container, she's the main character here.eventβ the desired event to be acquired. Au16, so she's small but she matters. This is the thing you're waiting on, bestie.
π DESCRIPTION π
ok so here's the vibe: you can use cmdq_pkt_acquire_event as your mutex_lock, and cmdq_pkt_clear_event as your mutex_unlock, to protect some critical section instructions that live in between them. Dynamic duo fr fr. π«Ά
Here's the part where you gotta pay attention (iykyk): cmdq_pkt_acquire_event would wait for the event to be cleared. It literally just sits there. Then β after that event gets cleared by cmdq_pkt_clear_event over in other GCE threads β cmdq_pkt_acquire_event would set the event and keep executing the next instruction. Like, respectfully, she waited her turn and now she's moving on. πβ¨
So the order is: wait for cleared β set it β next instruction. Do not skip steps, do not pass go. π
π₯ RETURN π₯
0for success β slay π- else the error code is returned β not slay, but at least you know π
π§ SEE ALSO π§
Kernel file ./include/linux/soc/mediatek/mtk-cmdq.h β go read her, she's the source of truth.
and the whole friend group, no one left out:
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_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_poll_addr(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 π¦ β brought to you by ./include/linux/soc/mediatek, dated October 2026. bookmark it, cite it, live laugh lock. π
π¦ 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