STRUCT UFS_HW_QUEUE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ufs_hw_queue(9) β€” Kernel API Manual πŸ¦‹

okay so bestie, welcome to the struct ufs_hw_queue page, aka the per hardware queue structure era. this is from the Kernel API Manual and honestly? it's giving "one queue to rule them all" energy πŸ‘‘


✨ NAME ✨

struct ufs_hw_queue β€” literally the per hardware queue structure. that's it. that's the vibe. one struct, one hardware queue, no cap πŸ’–


🌸 SYNOPSIS 🌸

like, here's the whole shape of her, exactly as she is:

struct ufs_hw_queue {
    void __iomem *mcq_sq_head;
    void __iomem *mcq_sq_tail;
    void __iomem *mcq_cq_head;
    void __iomem *mcq_cq_tail;
    struct utp_transfer_req_desc *sqe_base_addr;
    dma_addr_t sqe_dma_addr;
    struct cq_entry *cqe_base_addr;
    dma_addr_t cqe_dma_addr;
    u32 max_entries;
    u32 id;
    u32 sq_tail_slot;
    spinlock_t sq_lock;
    u32 cq_tail_slot;
    u32 cq_head_slot;
    spinlock_t cq_lock;
    struct mutex sq_mutex;
 };

no notes, she's perfect πŸŽ€


🫢 Members 🫢

okay so here's the member-by-member breakdown, iykyk:

  • mcq_sq_head β€” base address of the submission queue head pointer. the head. the beginning. main character energy ⭐
  • mcq_sq_tail β€” base address of the submission queue tail pointer. the tail knows where it's at πŸ’…
  • mcq_cq_head β€” base address of the completion queue head pointer πŸ™ˆ
  • mcq_cq_tail β€” base address of the completion queue tail pointer πŸ¦‹
  • sqe_base_addr β€” submission queue entry base address. the actual entries live here fr fr
  • sqe_dma_addr β€” submission queue dma address πŸ”₯
  • cqe_base_addr β€” completion queue base address πŸ’–
  • cqe_dma_addr β€” completion queue dma address ✨
  • max_entries β€” max number of slots in this hardware queue. yes, there's a limit, respect it πŸ’€
  • id β€” hardware queue ID. everyone needs a name πŸŽ€
  • sq_tail_slot β€” current slot to which SQ tail pointer is pointing πŸ‘‰
  • sq_lock β€” serialize submission queue access. one at a time bestie, no shoving πŸ”’
  • cq_tail_slot β€” current slot to which CQ tail pointer is pointing
  • cq_head_slot β€” current slot to which CQ head pointer is pointing
  • cq_lock β€” Synchronize between multiple polling instances. sharing is caring, locking is essential 🀝
  • sq_mutex β€” prevent submission queue concurrent access. the bouncer at the club 🧚

🌈 SEE ALSO 🌈

Kernel file ./include/ufs/ufshcd.h, plus the whole friend group:

  • struct uic_command(9)
  • struct ufshcd_lrb(9)
  • struct ufs_query_req(9)
  • struct ufs_query_res(9)
  • struct ufs_query(9)
  • struct ufs_dev_cmd(9)
  • struct ufs_clk_info(9)
  • struct tx_eqtr_iter(9)
  • struct ufshcd_tx_eq_settings(9)
  • struct ufshcd_tx_eqtr_data(9)
  • struct ufshcd_tx_eqtr_record(9)
  • struct ufshcd_tx_eq_params(9)
  • struct ufs_hba_variant_ops(9)
  • struct ufs_clk_gating(9)
  • struct ufs_clk_scaling(9)
  • struct ufs_event_hist(9)
  • struct ufs_stats(9)
  • enum ufshcd_state(9)
  • enum ufshcd_pmc_policy(9)
  • struct ufshcd_mcq_opr_info_t(9)
  • struct ufs_hba(9)
  • ufshcd_rmwl(9)
  • ufshcd_set_variant(9)
  • ufshcd_get_variant(9)

and that's the page bestie πŸ’œ this one lives in ./include/ufs and the source/version situation is October 2026 β€” so yeah, timestamped and iconic, struct ufs_hw_queue(9) forever 🌟 slay 🫢

πŸ“¦ where this page comes from