STRUCT UFS_CLK_SCALING(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

hey bestie πŸ’– welcome to the Kernel API Manual page for struct ufs_clk_scaling(9) β€” yes, we're doing UFS clock scaling related data, and we're doing it with full detail. no cap. ✨

πŸ’– NAME πŸ’–

struct ufs_clk_scaling - UFS clock scaling related data. it's giving kernel bookkeeping for clock scaling, and every field is about to get its moment. πŸ‘‘

✨ SYNOPSIS ✨

okay so here's the whole struct, literally:

struct ufs_clk_scaling {
    struct workqueue_struct *workq;
    struct work_struct suspend_work;
    struct work_struct resume_work;
    spinlock_t lock;
    int active_reqs;
    unsigned long tot_busy_t;
    ktime_t window_start_t;
    ktime_t busy_start_t;
    struct device_attribute enable_attr;
    struct ufs_pa_layer_attr saved_pwr_info;
    unsigned long target_freq;
    u32 min_gear;
    u32 wb_gear;
    bool is_enabled;
    bool is_allowed;
    bool is_initialized;
    bool is_busy_started;
    bool is_suspended;
    bool suspend_on_no_request;
};

🫢 Members 🫢

  • workq β€” workqueue to schedule devfreq suspend/resume work. this one queues up the suspend/resume vibes. πŸŒ€
  • suspend_work β€” worker to suspend devfreq. it's the suspend worker, doing exactly what it says on the label. 😴
  • resume_work β€” worker to resume devfreq. and this one brings devfreq back. ✨
  • lock β€” serialize access to some struct ufs_clk_scaling members. bestie, it's the little lock keeping some members from stepping on each other. πŸ”’
  • active_reqs β€” number of requests that are pending. If this is zero when devfreq ->target function is called then schedule "suspend_work" to suspend devfreq. literally the "are we busy or can we chill?" counter. πŸ‘€
  • tot_busy_t β€” Total busy time in current polling window. yes, capital T, we respect it. ⏱️
  • window_start_t β€” Start time (in jiffies) of the current polling window. jiffies mentioned, so you know it's kernel business. πŸ•°οΈ
  • busy_start_t β€” Start time of current busy period. the busy era begins here. 🎬
  • enable_attr β€” sysfs attribute to enable/disable clock scaling. the little switch that lets you turn the scaling vibes on or off. 🎚️
  • saved_pwr_info β€” UFS power mode may also be changed during scaling and this one keeps track of previous power mode. it remembers the old power mode, no cap. πŸ’Ύ
  • target_freq β€” frequency requested by devfreq framework. the frequency devfreq asked for. 🎯
  • min_gear β€” lowest HS gear to scale down to. the floor for scaling down, periodt. ⬇️
  • wb_gear β€” enable Write Booster when HS gear scales above or equal to it, else disable Write Booster. so it's a conditional Write Booster situation, iykyk. πŸš€
  • is_enabled β€” tracks if scaling is currently enabled or not, controlled by clkscale_enable sysfs node. the enabled/disabled status tracker. βœ…
  • is_allowed β€” tracks if scaling is currently allowed or not, used to block clock scaling which is not invoked from devfreq governor. it's the "allowed or not" flag, blocking scaling that didn't come from the devfreq governor. πŸ›‘
  • is_initialized β€” Indicates whether clock scaling is initialized or not. initialized? yes/no, that's the whole vibe. 🌱
  • is_busy_started β€” tracks if busy period has started or not. busy era status: tracked. 🏁
  • is_suspended β€” tracks if devfreq is suspended or not. suspended status: tracked. πŸ’€
  • suspend_on_no_request β€” suspend clock scaling only when no request. so: no request, then suspend. simple as that. πŸ“

🌈 SEE ALSO 🌈

Kernel file ./include/ufs/ufshcd.h β€” and 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_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).


mwah πŸ’‹ this page came from source/version ./include/ufs, dated October 2026, and it's still all about struct ufs_clk_scaling(9) β€” periodt. πŸŽ€

πŸ“¦ where this page comes from