drivers/thermal/intel/intel_powerclamp.c
Source file repositories/reference/linux-study-clean/drivers/thermal/intel/intel_powerclamp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/intel/intel_powerclamp.c- Extension
.c- Size
- 20406 bytes
- Lines
- 817
- Domain
- Driver Families
- Bucket
- drivers/thermal
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/delay.hlinux/cpu.hlinux/thermal.hlinux/debugfs.hlinux/seq_file.hlinux/idle_inject.hasm/msr.hasm/mwait.hasm/cpu_device_id.h
Detected Declarations
struct powerclamp_datastruct powerclamp_calibration_datastruct pkg_cstate_infofunction duration_setfunction duration_getfunction allocate_copy_idle_injection_maskfunction check_invalidfunction cpumask_setfunction cpumask_getfunction max_idle_setfunction window_size_setfunction has_pkg_state_counterfunction pkg_state_counterfunction get_compensationfunction adjust_compensationfunction powerclamp_adjust_controlsfunction get_run_timefunction poll_pkg_cstatefunction idle_inject_updatefunction trigger_idle_injectionfunction start_power_clampfunction end_power_clampfunction start_power_clampfunction end_power_clampfunction powerclamp_get_max_statefunction powerclamp_get_cur_statefunction powerclamp_set_cur_statefunction powerclamp_probefunction powerclamp_debug_showfunction powerclamp_create_debug_filesfunction powerclamp_initfunction powerclamp_exitmodule init powerclamp_init
Annotated Snippet
module_init(powerclamp_init);
static void __exit powerclamp_exit(void)
{
mutex_lock(&powerclamp_lock);
end_power_clamp();
mutex_unlock(&powerclamp_lock);
thermal_cooling_device_unregister(cooling_dev);
cancel_delayed_work_sync(&poll_pkg_cstate_work);
debugfs_remove_recursive(debug_dir);
if (cpumask_available(idle_injection_cpu_mask))
free_cpumask_var(idle_injection_cpu_mask);
}
module_exit(powerclamp_exit);
MODULE_IMPORT_NS("IDLE_INJECT");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Arjan van de Ven <arjan@linux.intel.com>");
MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@linux.intel.com>");
MODULE_DESCRIPTION("Package Level C-state Idle Injection for Intel CPUs");
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/delay.h`, `linux/cpu.h`, `linux/thermal.h`, `linux/debugfs.h`, `linux/seq_file.h`, `linux/idle_inject.h`.
- Detected declarations: `struct powerclamp_data`, `struct powerclamp_calibration_data`, `struct pkg_cstate_info`, `function duration_set`, `function duration_get`, `function allocate_copy_idle_injection_mask`, `function check_invalid`, `function cpumask_set`, `function cpumask_get`, `function max_idle_set`.
- Atlas domain: Driver Families / drivers/thermal.
- 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.