STRUCT UFS_HW_QUEUE(9)
π 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 frsqe_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 pointingcq_head_slotβ current slot to which CQ head pointer is pointingcq_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
- 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