Page MenuHomeFreeBSD

intelthermal: Add Intel Processor Thermal driver
Needs ReviewPublic

Authored by guest-seuros on Jan 26 2026, 2:05 AM.
Tags
None
Referenced Files
F154336940: D54882.id171123.diff
Mon, Apr 27, 10:44 PM
F154246883: D54882.id.diff
Mon, Apr 27, 9:30 AM
Unknown Object (File)
Wed, Apr 22, 4:24 PM
Unknown Object (File)
Tue, Apr 21, 6:27 PM
Unknown Object (File)
Tue, Apr 21, 8:21 AM
Unknown Object (File)
Mon, Apr 20, 11:25 PM
Unknown Object (File)
Mon, Apr 20, 5:47 PM
Unknown Object (File)
Sat, Apr 18, 11:17 PM
Subscribers

Details

Summary

Add driver for Intel Processor Thermal Device (B0D4) found on Skylake and later processors.
This device exposes RAPL power limits (PL1/PL2) and TDP information via sysctl.

The driver reads MSR_RAPL_POWER_UNIT to determine the correct power unit scaling factoor, with fallback to 1/8 W if MSR read fails.

Sysctls provided:

dev.intelthermal.0.pl1              - Long-term power limit (mW)
dev.intelthermal.0.pl2              - Short-term power limit (mW)
dev.intelthermal.0.tdp              - Thermal Design Power (mW)
dev.intelthermal.0.pl1_enabled      - PL1 enabled flag
dev.intelthermal.0.pl2_enabled      - PL2 enabled flag
dev.intelthermal.0.locked           - Firmware lock status
dev.intelthermal.0.access_denied    - MMIO access status
dev.intelthermal.0.power_unit_div   - Power unit divisor
dev.intelthermal.0.power_unit_shift - Power unit shift

Note: Later generations may have different MMIO layouts and would need per-generation validation. I used the gen 10th documentation (that match the hardware i used)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72398
Build 69281: arc lint + arc unit

Event Timeline

guest-seuros created this revision.

Wire into build; add PL2 enabled/lock bit; align sysctl names

Rename to intelthermal for consistency; add man page

guest-seuros added reviewers: ziaee, kib.
guest-seuros retitled this revision from intel/intel_proc_thermal: Add Intel Processor Thermal driver to intelthermal: Add Intel Processor Thermal driver.

@ziaee , shall we name this driver intelthermal or intel_thermal to mirror acpi_thermal < already in tree ?

PS: this diff need rebasing/fix once D54881 land.

@ziaee , shall we name this driver intelthermal or intel_thermal to mirror acpi_thermal < already in tree ?

PS: this diff need rebasing/fix once D54881 land.

Yes, I'm all in favor of it, and I checked with srcmgr@ that having underscores is OK.

Yes, I'm all in favor of it, and I checked with srcmgr@ that having underscores is OK.

Meaning intel_thermal(4), if that wasn't clear.

There's no issues with _ in driver names unless it gets too carried away: _i_n_t_e_l___t_h_e_r_m_a_l_ would be right out.

Though we generally try to have the driver module match the driver name, and here they don't match. So I'd suggest renaming the module to intel_thermal as well.

! In D54882#1291723, @guest-seuros wrote:
@ziaee , shall we name this driver intelthermal or intel_thermal to mirror acpi_thermal < already in tree ?

intel_thermal is much better for consistency with acpi_thermal. I was not intending to say that underscores are prohibited in the other review, I was intending to say that naming the driver exactly what a different named in linux is confusing, especially because the "_core" appendix is not mentioned in my glance through the datasheets or any other doc and also seems like a lot of underscores. Sorry for the confusion.

share/man/man4/intelthermal.4
1–5 ↗(On Diff #175349)

please consider using the preferred license template for all of these. in the last one, you changed just the one in the manual and the driver was committed with the other files still showing this style.

remove stale _intel_pmc_core from modules Makefile