STRUCT UFS_CLK_GATING(9)
π struct ufs_clk_gating(9) π
okay so bestie, this is a page from the Kernel API Manual and it's literally all about struct ufs_clk_gating β the lil bookkeeping struct that holds all the UFS clock gating info β¨ clocks don't gate themselves, someone has to do it, and this struct is that someone's whole personality π«Ά
πΈ NAME πΈ
struct ufs_clk_gating β UFS clock gating related info π
π SYNOPSIS π
like, here's the whole vibe, character for character, no cap:
struct ufs_clk_gating {
struct delayed_work gate_work;
struct work_struct ungate_work;
struct workqueue_struct *clk_gating_workq;
spinlock_t lock;
enum clk_gating_state state;
unsigned long delay_ms;
bool is_suspended;
struct device_attribute delay_attr;
struct device_attribute enable_attr;
bool is_enabled;
bool is_initialized;
int active_reqs;
};
π¦ Members π¦
bestie, meet the members β every single one of them, we're not skipping anybody π
gate_workβ the worker that turns off clocks after some delay, and the delay is whateverdelay_mssays it is. it's giving "patient icon" β³ungate_workβ the worker that turns clocks back on, specifically for when you're in interrupt context. rescue worker energy fr fr π₯clk_gating_workqβ the workqueue for clock gating work. it's the queue where all the gating happenings happen πlockβ serializes access to somestruct ufs_clk_gatingmembers. and bestie, note this: it's an outer lock relative to the host lock π (important, don't forget it)stateβ the current clocks state π¦delay_msβ gating delay in ms. numbers, ms units, we love a specified delay β¨is_suspendedβ clk gating is suspended when this is set to1, which can be used during suspend/resume π΄delay_attrβ sysfs attribute to controldelay_attrπenable_attrβ sysfs attribute to enable/disable clock gating πis_enabledβ Indicates the current status of clock gating βis_initializedβ Indicates whether clock gating is initialized or not πΈactive_reqsβ number of requests that are pending and should be waited for completion before gating clocks. not me gatekeeping the gate until everyone's done π
π SEE ALSO π
so there's this kernel file, right β ./include/ufs/ufshcd.h β and it's lowkey the main character of this whole friend group. here's everyone else in it, no cap, all of them:
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_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), struct ufs_hw_queue(9), ufshcd_rmwl(9), ufshcd_set_variant(9), ufshcd_get_variant(9)
bestie please note: this page lives in ./include/ufs and it's dated October 2026 β and that's the whole page, mwah π
β¨ iykyk β go read your kernel headers, they're iconic, periodt ππ
π¦ 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