cmdq_pkt_acquire_event(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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. A u16, 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 πŸ”₯

  • 0 for 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:


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