drivers/cpufreq/intel_pstate.c
Source file repositories/reference/linux-study-clean/drivers/cpufreq/intel_pstate.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/cpufreq/intel_pstate.c- Extension
.c- Size
- 103873 bytes
- Lines
- 3954
- Domain
- Driver Families
- Bucket
- drivers/cpufreq
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/kernel_stat.hlinux/module.hlinux/ktime.hlinux/hrtimer.hlinux/tick.hlinux/slab.hlinux/sched/cpufreq.hlinux/sched/smt.hlinux/list.hlinux/cpu.hlinux/cpufreq.hlinux/sysfs.hlinux/types.hlinux/fs.hlinux/acpi.hlinux/vmalloc.hlinux/pm_qos.hlinux/bitfield.htrace/events/power.hlinux/units.hasm/cpu.hasm/div64.hasm/msr.hasm/cpu_device_id.hasm/cpufeature.hasm/intel-family.h../drivers/thermal/intel/thermal_interrupt.hacpi/processor.hacpi/cppc_acpi.h
Detected Declarations
struct samplestruct pstate_datastruct vid_datastruct global_paramsstruct cpudatastruct pstate_funcsenum energy_perf_value_indexenum hwp_cpufreq_attr_indexfunction mul_fpfunction div_fpfunction ceiling_fpfunction mul_ext_fpfunction div_ext_fpfunction core_get_scalingfunction intel_pstate_acpi_pm_profile_serverfunction intel_pstate_get_ppc_enable_statusfunction intel_pstste_sched_itmt_work_fnfunction intel_pstate_set_itmt_priofunction intel_pstate_get_cppc_guaranteedfunction intel_pstate_cppc_get_scalingfunction intel_pstate_set_itmt_priofunction intel_pstate_exit_perf_limitsfunction intel_pstate_init_acpi_perf_limitsfunction intel_pstate_get_cppc_guaranteedfunction intel_pstate_cppc_get_scalingfunction intel_pstate_freq_to_hwp_relfunction intel_pstate_freq_to_hwpfunction intel_pstate_hybrid_hwp_adjustfunction turbo_is_disabledfunction min_perf_pct_minfunction intel_pstate_get_eppfunction intel_pstate_get_energy_pref_indexfunction intel_pstate_set_eppfunction intel_pstate_set_energy_pref_indexfunction show_energy_performance_available_preferencesfunction store_energy_performance_preferencefunction show_energy_performance_preferencefunction show_base_frequencyfunction hybrid_get_cpu_typefunction hybrid_active_powerfunction hybrid_has_l3function hybrid_get_costfunction hybrid_register_perf_domainfunction hybrid_register_all_perf_domainsfunction hybrid_update_perf_domainfunction hybrid_register_perf_domainfunction hybrid_register_all_perf_domainsfunction hybrid_clear_cpu_capacity
Annotated Snippet
device_initcall(intel_pstate_init);
static int __init intel_pstate_setup(char *str)
{
if (!str)
return -EINVAL;
if (!strcmp(str, "disable"))
no_load = 1;
else if (!strcmp(str, "active"))
default_driver = &intel_pstate;
else if (!strcmp(str, "passive"))
default_driver = &intel_cpufreq;
if (!strcmp(str, "no_hwp"))
no_hwp = 1;
if (!strcmp(str, "no_cas"))
no_cas = true;
if (!strcmp(str, "force"))
force_load = 1;
if (!strcmp(str, "hwp_only"))
hwp_only = 1;
if (!strcmp(str, "per_cpu_perf_limits"))
per_cpu_limits = true;
#ifdef CONFIG_ACPI
if (!strcmp(str, "support_acpi_ppc"))
acpi_ppc = true;
#endif
return 0;
}
early_param("intel_pstate", intel_pstate_setup);
MODULE_AUTHOR("Dirk Brandewie <dirk.j.brandewie@intel.com>");
MODULE_DESCRIPTION("'intel_pstate' - P state driver Intel Core processors");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/kernel_stat.h`, `linux/module.h`, `linux/ktime.h`, `linux/hrtimer.h`, `linux/tick.h`, `linux/slab.h`, `linux/sched/cpufreq.h`.
- Detected declarations: `struct sample`, `struct pstate_data`, `struct vid_data`, `struct global_params`, `struct cpudata`, `struct pstate_funcs`, `enum energy_perf_value_index`, `enum hwp_cpufreq_attr_index`, `function mul_fp`, `function div_fp`.
- Atlas domain: Driver Families / drivers/cpufreq.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.