drivers/thermal/gov_step_wise.c
Source file repositories/reference/linux-study-clean/drivers/thermal/gov_step_wise.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/gov_step_wise.c- Extension
.c- Size
- 4656 bytes
- Lines
- 153
- Domain
- Driver Families
- Bucket
- drivers/thermal
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/thermal.hlinux/minmax.hthermal_trace.hthermal_core.h
Detected Declarations
function Copyrightfunction thermal_zone_trip_updatefunction list_for_each_entryfunction scoped_guardfunction step_wise_managefunction for_each_trip_desc
Annotated Snippet
scoped_guard(cooling_dev, instance->cdev) {
instance->cdev->updated = false; /* cdev needs update */
}
}
}
static void step_wise_manage(struct thermal_zone_device *tz)
{
const struct thermal_trip_desc *td;
struct thermal_instance *instance;
lockdep_assert_held(&tz->lock);
/*
* Throttling Logic: Use the trend of the thermal zone to throttle.
* If the thermal zone is 'heating up', throttle all of the cooling
* devices associated with each trip point by one step. If the zone
* is 'cooling down', it brings back the performance of the devices
* by one step.
*/
for_each_trip_desc(tz, td) {
const struct thermal_trip *trip = &td->trip;
if (trip->temperature == THERMAL_TEMP_INVALID ||
trip->type == THERMAL_TRIP_CRITICAL ||
trip->type == THERMAL_TRIP_HOT)
continue;
thermal_zone_trip_update(tz, td, td->threshold);
}
for_each_trip_desc(tz, td) {
list_for_each_entry(instance, &td->thermal_instances, trip_node)
thermal_cdev_update(instance->cdev);
}
}
static struct thermal_governor thermal_gov_step_wise = {
.name = "step_wise",
.manage = step_wise_manage,
};
THERMAL_GOVERNOR_DECLARE(thermal_gov_step_wise);
Annotation
- Immediate include surface: `linux/thermal.h`, `linux/minmax.h`, `thermal_trace.h`, `thermal_core.h`.
- Detected declarations: `function Copyright`, `function thermal_zone_trip_update`, `function list_for_each_entry`, `function scoped_guard`, `function step_wise_manage`, `function for_each_trip_desc`.
- Atlas domain: Driver Families / drivers/thermal.
- Implementation status: source implementation candidate.
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.