STRUCT UFS_CLK_SCALING(9)
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 somestruct ufs_clk_scalingmembers. 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 byclkscale_enablesysfs 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
- 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