Skip to content

arm64: dts: apple: enable J716c fan and hotspot monitoring - #2208

Open
erikwb wants to merge 1 commit into
mainfrom
j716c/smc-fans-hotspot
Open

erikwb wants to merge 1 commit into
mainfrom
j716c/smc-fans-hotspot

Conversation

@erikwb

@erikwb erikwb commented Nov 18, 2026 •

Copy link
Copy Markdown

Problem

The J716c (16-inch M5 Max MacBook Pro) leaves &smc_hwmon disabled, so its two fans and SMC temperature sensors (including the TCMb SoC hotspot used by the GPU thermal governor) are not exposed through hwmon or the macsmc_soc_die thermal zone.

Change

Enable &smc_hwmon in arch/arm64/boot/dts/apple/t6050-j716c.dts and include hwmon-fan-dual.dtsi, overriding both fans' mode keys to F0md/F1md with apple,fan-manual-control.

Keep both apple,discover-temperatures and apple,soc-die-keys = "TCMb" inherited from t6050-die0.dtsi. With macsmc-hwmon discovery supporting apple,soc-die-keys (commit ad0f93637543), this discovers all readable float T* SMC keys while also marking TCMb as the macsmc_soc_die thermal zone sensor. Fan targets remain under SMC automatic control until requested, and manual targets are clamped to the SMC-reported minimum and maximum speeds in drivers/hwmon/macsmc-hwmon.c.

Testing

  • Rebased onto integration/aurora (275d59d3bc82) at commit 37fee82e714e with human-only attribution (Signed-off-by: Erik Bourget <erik@ebourget.net>).
  • Verified make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-j716c.dtb and make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml with 0 hwmon schema warnings; ./scripts/checkpatch.pl --strict --git 275d59d3bc82..HEAD reports 0 errors, 0 warnings, and 0 checks; tools/asahi/hardware-defaults-tests.py (6/6), tools/asahi/t6050-combo-join-tests.py (3/3), and tools/testing/selftests/drivers/apple/macsmc-j713.py (9190 checks) pass.
  • Decompiled t6050-j716c.dtb confirms status = "okay", apple,discover-temperatures, apple,soc-die-keys = "TCMb", and fan-F0Ac/fan-F1Ac (F0md/F1md, apple,fan-manual-control).
  • On an earlier J716c build based on caccad389b9c with the smc_hwmon DT node enabled (prior to keeping apple,discover-temperatures), a fan-setting comparison on the same kernel measured 4K High FSR2 Balanced Cyberpunk 2077 throughput at 23.59/25.25 FPS under SMC automatic cooling vs 26.44/26.61 FPS at rated manual fan speeds (ABBA run order); a subsequent build at 77602a74a746 with the identical resolved smc_hwmon DT node probed macsmc-hwmon with 0 errors and exposed 344 temperature channels including TCMb.
  • Exact-head J716c hardware verification (37fee82e714e on integration/aurora 275d59d3bc82, default kernel command line):
    • macsmc-hwmon probed cleanly, registered macsmc_soc_die on TCMb (59243 mC), discovered 344 temperature channels including TCMb, and exposed Fan 1 (1350–5349 RPM) and Fan 2 (1350–5777 RPM).
    • In-range target tracking: writing (2600, 2800) RPM to fan1_target/fan2_target tracked on both tachometers at (2599, 2807) RPM (and 2500 RPM tracked at (2549, 2566) RPM).
    • Out-of-range clamping to SMC F*Mn/F*Mx bounds: writing 500 clamped readback targets to (1350, 1350) RPM (input (1346, 1351) RPM); writing 9999 clamped readback targets to (5349, 5777) RPM (input (5219, 5544) RPM).
    • Return to SMC automatic control: writing 0 to fan1_target/fan2_target returned both fans to SMC automatic control (target (1350, 1458) RPM, input (1350, 1455) RPM after 10 s).
    • s2idle cycle (rtcwake -m mem -s 10): rc=0, suspend_stats/success 0->1, fail=0, clean resume (PM: suspend exit).
    • Regression check: 0 SELinux/AVC denials (Arch ARM without SELinux), 0 new failed systemd units (1 pre-existing aurora-peripherals.service, matching the daily baseline), 0 macsmc-hwmon kernel errors (boot-time errors on plain 275d59d3bc82 were only from unmerged 27.2 GPU/DCPExt support on 2302600000.gpu and external 2b2e00000.dcp/302e00000.dcp, plus 382280000.usb PM: device_prepare(): genpd_prepare returns -11 on suspend prep).

Still to run

  • None.

Assisted-by: LLM (Anthropic:Claude, OpenAI:GPT-6.2 Sol, Google:Gemini 4 Neon, Google:Gemini 4 Hydrogen)

@RyanTheTide

Copy link
Copy Markdown

Blockers: 1.

The DT follows the J714s's: the same lower-case mode keys, and manual control on both fans. Manual targets are clamped to the minimum and maximum the SMC reports (drivers/hwmon/macsmc-hwmon.c:579-586), so the fan limits come from the machine.

  1. The commit message ends with "Developed with Claude Code." Commits should carry only the human Signed-off-by. Put the disclosure as the PR body's last line, Assisted-by: LLM (<Vendor>:<Model>). The body currently ends with "Created with Codex.".
  2. arch/arm64/boot/dts/apple/t6050-j716c.dts:189 deletes apple,discover-temperatures and keeps the TCMb die key, so the J716c exposes one temperature. The J714s, on the same SoC, keeps discovery and drops the die key instead. Neither the comment nor the commit message says why the J716c differs. If discovery is unsafe or wrong on this board, say so in the comment. Otherwise keep the two boards the same.

HW row: J716c on the default command line: sensors shows both fans and the hotspot. Writing fan1/fan2 targets inside the range moves the tachometers to them, a value outside the range is clamped, and dropping the request returns both fans to automatic control. One s2idle cycle, and 0 SELinux denials, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

erikwb added a commit that referenced this pull request Nov 21, 2026
Under sustained GPU load the SMC's automatic fan mode lets the SoC hotspot
pass 109 C on the J716c. Add fan assistance that leaves the firmware's
power budget and the CPU policy alone: while the GPU is busy and the
hotspot reaches 98 C, request the fans' rated speed. Hand them back to
automatic control after a 30 s hold in which the GPU was idle or the
hotspot stayed below 82 C, or at once when the hotspot cannot be read. A
partial request (a later fan refusing after an earlier one accepted) is
released before the next attempt. While boosted, the request is repeated
on each step on which the GPU is busy and the hotspot is at or above
82 C, so fans the SMC took back when the hwmon cell was unbound and bound
again between two such steps are set again. During the hold the request
is not repeated: fans the SMC took back then stay automatic until such a
step comes or the hold ends. A step that finds no provider reads no
hotspot and ends the boost, and a new boost starts at 98 C.

It is on by default wherever the SMC hwmon node describes what it needs:
the SoC hotspot as the only key of the SoC die temperature zone (TCMb in
apple,soc-die-keys), which is the only input the assistance reads, and at
least one fan a policy may set (apple,fan-manual-control) that names its
mode, target, minimum and maximum keys. The kernel fan request writes
every fan that names a mode key, so each of those must have
apple,fan-manual-control. Every boost request checks the node of the
bound provider it writes to, under the provider lock, so a replaced
provider is checked again. When the board is selected the device tree is
scanned for such a node with every parent available; without one the
governor stays idle. The new aurora.m5_hotspot_fans=0 opts
out. Whenever the host power budget controller (m5_thermal_governor bit
0) is enabled it owns the fans with its own curve, and the assistance
stays off.

tools/asahi/m5-hotspot-fans-dt-tests.py compiles these checks against
libfdt with a recording stand-in for the fan request, and runs them on
synthetic trees and the T6050 board trees (the J716c with #2208's full
description included), checking the exact set of fans each accepted
request writes.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
erikwb added a commit that referenced this pull request Nov 21, 2026
Under sustained GPU load the SMC's automatic fan mode lets the SoC hotspot
pass 109 C on the J716c. Add fan assistance that leaves the firmware's
power budget and the CPU policy alone: while the GPU is busy and the
hotspot reaches 98 C, request the fans' rated speed. Hand them back to
automatic control after a 30 s hold in which the GPU was idle or the
hotspot stayed below 82 C, or at once when the hotspot cannot be read. A
partial request (a later fan refusing after an earlier one accepted) is
released before the next attempt. While boosted, the request is repeated
on each step on which the GPU is busy and the hotspot is at or above
82 C, so fans the SMC took back when the hwmon cell was unbound and bound
again between two such steps are set again. During the hold the request
is not repeated: fans the SMC took back then stay automatic until such a
step comes or the hold ends. A step that finds no provider reads no
hotspot and ends the boost, and a new boost starts at 98 C.

It is on by default wherever the SMC hwmon node describes what it needs:
the SoC hotspot as the only key of the SoC die temperature zone (TCMb in
apple,soc-die-keys), which is the only input the assistance reads, and at
least one fan a policy may set (apple,fan-manual-control) that names its
mode, target, minimum and maximum keys. The kernel fan request writes
every fan that names a mode key, so each of those must have
apple,fan-manual-control. Every boost request checks the node of the
bound provider it writes to, under the provider lock, so a replaced
provider is checked again. When the board is selected the device tree is
scanned for such a node with every parent available; without one the
governor stays idle. The new aurora.m5_hotspot_fans=0 opts
out. Whenever the host power budget controller (m5_thermal_governor bit
0) is enabled it owns the fans with its own curve, and the assistance
stays off.

tools/asahi/m5-hotspot-fans-dt-tests.py compiles these checks against
libfdt with a recording stand-in for the fan request, and runs them on
synthetic trees and the T6050 board trees (the J716c with #2208's full
description included), checking the exact set of fans each accepted
request writes.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb force-pushed the j716c/smc-fans-hotspot branch from 6bac3f1 to ed06b61 Compare November 22, 2026 00:31
@erikwb

erikwb commented Nov 22, 2026

Copy link
Copy Markdown
Author

Note

🤖 Gemini 4 Neon responding on behalf of erikwb

Addressed both items in ed06b6189817:

  1. Attribution: Amended the commit to human identity only (Erik Bourget <erik@ebourget.net>, Signed-off-by: only, removed Developed with Claude Code.), and updated the PR body to the standard sections ending with a single Assisted-by: LLM (...) line.
  2. Temperature discovery: Removed /delete-property/ apple,discover-temperatures; from arch/arm64/boot/dts/apple/t6050-j716c.dts so J716c inherits both apple,discover-temperatures and apple,soc-die-keys = "TCMb" from t6050-die0.dtsi. Because commit ad0f93637543 (hwmon: macsmc: Let discovered temperatures join the SoC die zone) lets listed die keys mark their discovered channels instead of colliding with discovery, J716c now discovers all readable float T* SMC keys (matching J714s and J775D) while keeping the macsmc_soc_die thermal zone on TCMb (J714s's /delete-property/ apple,soc-die-keys; predates ad0f93637543, as noted in t6050-j716s.dts).

Verified make ARCH=arm64 apple/t6050-j716c.dtb builds cleanly (0 warnings) and the decompiled DTB matches the live J716c smc_hwmon node (both fans, 344 discovered T* channels, and macsmc_soc_die on TCMb). The full default-cmdline HW row (in-range target tracking, out-of-range clamping, return to automatic control, one s2idle cycle, and 0 failed units/SELinux denials/new kernel errors) is noted under Still to run in the PR description.

erikwb added a commit that referenced this pull request Nov 22, 2026
Under sustained GPU load the SMC's automatic fan mode lets the SoC hotspot
pass 109 C on the J716c. Add fan assistance that leaves the firmware's
power budget and the CPU policy alone: while the GPU is busy and the
hotspot reaches 98 C, request the fans' rated speed. Hand them back to
automatic control after a 30 s hold in which the GPU was idle or the
hotspot stayed below 82 C, or at once when the hotspot cannot be read. A
partial request (a later fan refusing after an earlier one accepted) is
released before the next attempt. While boosted, the request is repeated
on each step on which the GPU is busy and the hotspot is at or above
82 C, so fans the SMC took back when the hwmon cell was unbound and bound
again between two such steps are set again. During the hold the request
is not repeated: fans the SMC took back then stay automatic until such a
step comes or the hold ends. A step that finds no provider reads no
hotspot and ends the boost, and a new boost starts at 98 C.

It is on by default wherever the SMC hwmon node describes what it needs:
the SoC hotspot as the only key of the SoC die temperature zone (TCMb in
apple,soc-die-keys), which is the only input the assistance reads, and at
least one fan a policy may set (apple,fan-manual-control) that names its
mode, target, minimum and maximum keys. The kernel fan request writes
every fan that names a mode key, so each of those must have
apple,fan-manual-control. Every boost request checks the node of the
bound provider it writes to, under the provider lock, so a replaced
provider is checked again. When the board is selected the device tree is
scanned for such a node with every parent available; without one the
governor stays idle. Whenever the host power budget controller
(m5_thermal_governor bit 0) is enabled it owns the fans with its own
curve, and the assistance stays off.

tools/asahi/m5-hotspot-fans-dt-tests.py compiles these checks against
libfdt with a recording stand-in for the fan request, and runs them on
synthetic trees and the T6050 board trees (the J716c with #2208's full
description included), checking the exact set of fans each accepted
request writes.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@RyanTheTide

Copy link
Copy Markdown

Thanks, ed06b61 covers both points: the commit carries only the human Signed-off-by, and t6050-j716c.dts:187-206 now keeps temperature discovery and the TCMb die key together, which the base supports since ad0f936 (a listed key joins its discovered channel instead of adding one). The fan nodes match the binding and the limits come from the SMC.

Looks good to me. The only thing left is the hardware row you already list, on this exact commit and the default command line: in-range fan1/fan2 targets tracked, an out-of-range value clamped, release returning both fans to automatic, one s2idle cycle, and 0 SELinux denials, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at ed06b6189817: 0 code, CI, policy, or attribution blockers.

Checked:

  • DT & safety (§1/§2/§3): arch/arm64/boot/dts/apple/t6050-j716c.dts enables &smc_hwmon, includes hwmon-fan-dual.dtsi, sets T6050 F0md/F1md mode keys with apple,fan-manual-control, and inherits both apple,discover-temperatures and apple,soc-die-keys = "TCMb" from t6050-die0.dtsi (which drivers/hwmon/macsmc-hwmon.c supports since ad0f93637543, letting the discovered TCMb channel supply macsmc_soc_die). Manual fan targets remain clamped to the SMC-reported F*Mn/F*Mx bounds and default to SMC automatic control.
  • Attribution (§4): Commit ed06b6189817 carries human author/committer and Signed-off-by: only.
  • CI: dt-checks and host-tests green.

Still owed before approval/merge (§5):

  • The J716c hardware verification row already listed under Still to run, booting this exact commit (ed06b6189817) on the default kernel command line: in-range fan1_target/fan2_target tracking, out-of-range clamping, return to automatic mode on release, one s2idle cycle, and regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors).

Assisted-by: LLM (Gemini 4 Neon)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 review at verified live head ed06b6189817c8c5f4ed885c41f1689fe453acf5 (live integration/aurora 0f111a0dc307, not superseded; live CI 2/2 green: dt-checks and host-tests).

Checklist Summary

  • §1 No model gating, §2 Production-ready, §3 Safety, §4 Attribution, §6 Naming: PASS (0 code/policy/attribution/naming/CI blockers).
    • Enables &smc_hwmon in arch/arm64/boot/dts/apple/t6050-j716c.dts, includes hwmon-fan-dual.dtsi, sets T6050 F0md/F1md mode keys with apple,fan-manual-control, and inherits both apple,discover-temperatures and apple,soc-die-keys = "TCMb" from t6050-die0.dtsi (supported together in drivers/hwmon/macsmc-hwmon.c since ad0f93637543).
    • Manual fan speed targets default to SMC automatic control and are clamped to the SMC-reported F*Mn/F*Mx bounds in macsmc-hwmon.c (§3 limits come from the machine).
    • Commit ed06b6189817 carries human author/committer (Erik Bourget) and human Signed-off-by: only.
    • Note: PR #2162 (70a00e583b03) updated &pinctrl_ap's gpio-reserved-ranges three lines above &smc_hwmon in t6050-j716c.dts; 3-way merge remains clean, though rebasing onto current integration/aurora when running the final boot test is recommended.

Blocker (§5 Evidence)

  1. Exact-head J716c hardware & regression row missing: Earlier tests ran on older custom kernel 7.3.0-ewb270+ and did not cover out-of-range clamping, automatic-mode release, s2idle, or full regression counts (as noted under ## Still to run). Before approval/merge, please post a J716c boot at exact live head ed06b6189817 (or rebased onto current integration/aurora) on the default kernel command line confirming:
    • In-range fan1_target/fan2_target tracking;
    • Out-of-range target clamping to SMC F*Mn/F*Mx bounds;
    • Return to SMC automatic control on release;
    • One s2idle cycle;
    • Regression counts: 0 SELinux denials, 0 failed units, and 0 new kernel errors.

Assisted-by: LLM (Gemini 4 Neon)

Enable the J716c SMC hwmon node and include hwmon-fan-dual.dtsi with the
T6050 F0md/F1md mode keys and manual fan control enabled.

Keep both apple,discover-temperatures and apple,soc-die-keys ("TCMb")
inherited from t6050-die0.dtsi so all readable T* float sensors are
discovered while the discovered TCMb channel also supplies the
macsmc_soc_die thermal zone.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb force-pushed the j716c/smc-fans-hotspot branch from ed06b61 to 37fee82 Compare November 24, 2026 02:32
@erikwb

erikwb commented Nov 24, 2026

Copy link
Copy Markdown
Author

Note

🤖 Gemini 4 Hydrogen responding on behalf of erikwb

Rebased j716c/smc-fans-hotspot onto current integration/aurora (275d59d3bc82) at 37fee82e714e as recommended around PR #2162's &pinctrl_ap change in arch/arm64/boot/dts/apple/t6050-j716c.dts, and cleaned the prior internal build tag from the PR description.

Verified locally on 37fee82e714e:

  • make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-j716c.dtb and dt_binding_check (Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml) pass with 0 hwmon warnings, and the decompiled hwmon node matches status = "okay", apple,discover-temperatures, apple,soc-die-keys = "TCMb", and fan-F0Ac/fan-F1Ac (F0md/F1md, apple,fan-manual-control).
  • ./scripts/checkpatch.pl --strict --git 275d59d3bc82..HEAD reports 0 errors, 0 warnings, and 0 checks.
  • tools/asahi/hardware-defaults-tests.py, tools/asahi/t6050-combo-join-tests.py, and tools/testing/selftests/drivers/apple/macsmc-j713.py pass.

Completed the exact-head 37fee82e714e J716c hardware verification row on the default kernel command line and updated the PR description accordingly:

  • macsmc-hwmon probed cleanly with 344 temperature channels, macsmc_soc_die on TCMb, Fan 1 (1350–5349 RPM), and Fan 2 (1350–5777 RPM).
  • In-range fan1_target/fan2_target (2600, 2800) RPM tracked to (2599, 2807) RPM; out-of-range writes clamped to SMC bounds (500 -> (1350, 1350) RPM, 9999 -> (5349, 5777) RPM); writing 0 returned both fans to SMC automatic control ((1350, 1455) RPM after 10 s).
  • One s2idle cycle (rtcwake -m mem -s 10) resumed cleanly (suspend_stats/success 0->1, fail=0).
  • Regression check: 0 SELinux/AVC denials, 0 new failed units (matching baseline aurora-peripherals.service), and 0 macsmc-hwmon kernel errors.
  • Clarified the earlier Cyberpunk 2077 numbers in Testing by commit (caccad389b9c with smc_hwmon DT enabled, explicitly framed as an ABBA fan-setting comparison between automatic cooling and rated fan speeds) and removed the completed hardware row from Still to run.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants