Skip to content

arm64: dts: apple: t8152-j873g: let userspace set the fan speed - #3632

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
ericvhileman:fix/t8152-j873g-fan-manual-control
Nov 29, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
ericvhileman:fix/t8152-j873g-fan-manual-control

Conversation

@ericvhileman

Copy link
Copy Markdown
Contributor

What: Mark the J873g (Mac mini M6) fan apple,fan-manual-control, so fan1_target is writable and userspace can raise the fan, which the SMC's automatic mode leaves at its 1000 rpm minimum under load.

Tested: J873g / T8152 (Mac mini M6) at e92996a1062: fan1_target 0644; 2200 rpm ran at 2200 and went back to the SMC's 1000 rpm after 0; 9900 was clamped to the 4900 rpm maximum; 15 min all-core load with the fan held at 1000 rpm peaked at 89.6 C with no trip and no SMC override; a reboot with the fan held came up under SMC control; 0 failed units and the same kernel warnings as with the base DTB.

Risk: two-way door · J873g only (one devicetree property)

Not yet: s2idle and poweroff with the fan held (this Mac mini is headless and remote, with no RTC to wake it); a second J873g; a row on an Aurora distribution kernel and its default command line (this row's kernel is a NixOS build of main at 66fbacc273c6, command line below); CHECK_DTBS on my side (the apple,smc-hwmon binding declares the property; dt-checks covers it here).

@joshuaswarren

Details

fan-F0Ac already names the mode, target, minimum and maximum keys (F0md, F0Tg, F0Mn, F0Mx); this adds only apple,fan-manual-control and a comment with the reason, as t6050-j714s.dts (#1944) and t6041-j575c.dts (#2898) do. No driver change.

  • Until hwmon: macsmc: Drop the fan_control module parameter #2448 dropped it, macsmc_hwmon.fan_control=1 was the only way to set this fan; J873g: all CPU performance states under SMC thermal zones (M6 Mac mini) #1798's rows used it for a userspace fan controller on this Mac (fan up to 4344-4900 rpm; 1305 bogo ops/s with it, 970 with the fan held at its minimum). Since hwmon: macsmc: Drop the fan_control module parameter #2448 the devicetree property is the only path, and J873g does not have it.
  • The driver clamps every nonzero target to the SMC's F0Mn/F0Mx, read fresh on each write, and writing 0 hands the fan back to the SMC (Documentation/hwmon/macsmc-hwmon.rst).
  • This SMC has no Ftst unlock key; F0md (ui8) is writable and takes the manual mode directly, as on the J575c.
  • J873g's devicetree has no apple,soc-die-* properties, so hotspot fan assistance stays off, and no SoC-die passive trip, so the M5 governor's fan curve does not govern; the property makes no kernel policy drive the fan.
  • The property gives no fan curve; a userspace curve (or a future kernel policy) decides the speed. On this model under macOS 27 the fan follows the CPU die temperature: 60 s macmon samples over 7 days on J873g Mac minis show 1000 rpm below about 58 C, a 90th percentile of 2613 rpm at 71 C, and a highest sampled speed of 2620 rpm.
  • The branch is on 66fbacc273c61117ed2e927991843742f828a11b, the commit the test Mac's kernel was built from. Both trial boots run that kernel binary, initramfs and command line; only the DTB differs. It merges into main (498d53fd4a701fdb37a292db6d7938503bd03955) without conflicts, and the merged t8152-j873g.dtb, decompiled with dtc -s, differs from main's only by this property. drivers/hwmon/macsmc-hwmon.c is identical at both; drivers/mfd/macsmc.c and include/linux/mfd/macsmc.h have changed on main since (mfd: macsmc: Initialise the completions before the RTKit #2935, mfd: macsmc: take the dark wake reasons from the device tree #3272, thermal: apple-pmp: validate SMC rail key metadata once per binding #3288), which this row does not exercise.
Evidence

Machine and build. Mac mini M6, apple,j873g / apple,t8152; system firmware 27.2, OS firmware 27.0; aura Stage 1 1.0.0b14, Stage 2 1.0.0b17. Kernel 7.3.0 built from 66fbacc273c6 (NixOS 26.11 with nixos-aurora). Command line: user4k=on earlycon console=tty0 rd.shell=0 rd.emergency=reboot nvme_apple.flush_interval=0 firmware_class.path=/run/aurora-firmware/vendorfw quiet rd.udev.log_level=3 udev.log_level=3 systemd.show_status=auto root=fstab loglevel=3 lsm=landlock,yama,bpf panic=15 arm64.nowfxt. SELinux is not enabled on this system, so there is no denial count.

Method. Two aura-try boot= one-shot trials on 2026-11-29, each the installed kernel, initramfs and command line with one of two DTBs, both built from this branch as scripts/Makefile.dtbs builds them (clang -E, then dtc -@):

DTB commit sha256 decompiled difference
base 66fbacc273c6 946d3b0aa41c… (byte-identical to the Mac's installed base DTB)
head e92996a10623 c7298ea3f9f9… apple,fan-manual-control; in fan-F0Ac, nothing else

Load is 12 × sha256sum /dev/zero for 900 s. Temperatures are the 30 CPU die zones (smc-te*, smc-tp*), read about once a second and logged every 11 s; "hottest" is the hottest of them, "mean" their mean. Their lowest passive trip is 110 C; the load would have stopped at 105 C.

Base DTB (the fan as it is on main).

Check Result
fan1_target 0444; echo 2200 > fan1_target as root: Permission denied; fan stays at 1000 rpm
900 s all-core load, SMC automatic mode fan 999-1001 rpm in every logged sample; die mean 38.5 → 79.5 C, hottest zone peak 88.6 C; no cooling device left state 0; no thermal or SMC kernel message

Head DTB.

Check Result
fan1_target 0644; fan1_min 1000, fan1_max 4900; the property is in /proc/device-tree
2200, then 0 2207 rpm after 3 s, 2200-2201 for the next 9 s; after 0: 949 rpm at 3 s, 1000 rpm from 6 s on, fan1_target reads 1000
9900 (above fan1_max), then 0 fan1_target reads 4900; 4990 rpm after 3 s, then 4898-4910; after 0: 892 rpm at 3 s, 1000 rpm from 6 s on
900 s all-core load, fan held at 1000 rpm fan 999-1001 rpm in every logged sample; die mean 40.6 → 80.4 C, hottest zone peak 89.6 C, 20 C below the passive trip; no cooling device left state 0; the SMC did not override, trip or shut down; after 0 the fan stays under the SMC at 1000 rpm
2200 held, then systemctl reboot next boot (installed DTB, nothing in userspace setting the fan): 1000 rpm, fan1_target 1000 at 20 s uptime
kernel log no stays in mode … after release or cannot hand the fans back on any boot

Die temperature under the two loads (fan at 1000 rpm in both):

t base, SMC automatic: mean / hottest head, held at 1000 rpm: mean / hottest
10 s 51.5 / 59.0 C 53.7 / 61.3 C
3 min 71.3 / 79.7 C 73.8 / 82.5 C
6.5 min 75.8 / 85.3 C 77.6 / 86.7 C
10 min 77.7 / 86.6 C 79.2 / 88.1 C
13 min 79.1 / 88.0 C 79.9 / 88.9 C
peak 79.5 / 88.6 C 80.4 / 89.6 C

Regression, base boot against head boot. 0 failed units on both. Kernel messages at warning level and above in the first 120 s, with numbers and addresses folded: the same 16 distinct lines (54 messages) on both, none from macsmc; 10 messages at error level and above on each, counted at 125 s of uptime. macsmc-hwmon logs the same two lines on both (CPU0 cluster / CPU1 cluster: higher states handed to its thermal zones).

In automatic mode the J873g SMC holds its fan at the F0Mn minimum;
t8152-j873-thermal.dtsi records it there even at 93 C under sustained
full load. fan1_target is read-only because fan-F0Ac has no
apple,fan-manual-control, so nothing on Linux can raise the fan. Mark
the fan apple,fan-manual-control, as the J714s and J575c fans are, so
userspace can set it, for a fan curve like the one macOS runs on this
Mac.

The node already names the F0md mode key. This SMC has no Ftst unlock
key; F0md is writable and takes the manual mode directly. The SMC
drives the fan until userspace writes a target, and writing 0 hands it
back. The J873g devicetree describes no SoC die fan trip and no
hotspot fan assistance, so no kernel thermal policy takes the fan.

Signed-off-by: Eric Hileman <4987539+ericvhileman@users.noreply.github.com>
@ericvhileman
ericvhileman requested review from a team as code owners November 29, 2026 15:35

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at e92996a1

Blockers: none

Checked:

  • Audited +8/-0 DT addition in arch/arm64/boot/dts/apple/t8152-j873g.dts (DCO Signed-off-by: present, MERGEABLE on main, What:/Tested:/Risk: two-way present).
  • Verified apple,fan-manual-control is a valid boolean property in Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml (L184) and that fan-F0Ac already defines all required companion keys (F0Mn, F0Mx, F0Tg, F0md).
  • Verified drivers/hwmon/macsmc-hwmon.c (L572, L1366) gates writable fan1_target on apple,fan-manual-control with clamping to [F0Mn, F0Mx] and automatic SMC handback on 0, without engaging hotspot fan assistance (no apple,soc-die-* properties in the J873g DT).
  • Exact-head e92996a1 J873g (T8152, FW 27.2) hardware row verified (fan1_target 0644, 2200 rpm applied and returned to 1000 rpm on 0, 9900 clamped to 4900 rpm max, 15-min all-core load check, clean reboot back to SMC control, 0 failed units).
Evidence
  • arch/arm64/boot/dts/apple/t8152-j873g.dts L505–525: single boolean apple,fan-manual-control; under fan-F0Ac, matching t6050-j714s.dts and t6041-j575c.dts.
  • Fork PR dt-checks was skipped; let readiness / dt-checks clear if triggered before merge.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at e92996a1. App approved (NEON-PR-REVIEW2); rows J873g-exact-head, board-DT-only. Merges under the 6-point rule 1 h from now once hosted CI is green, unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at e92996a1. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J873g-exact-head;board-DT-only. (5) There's no blocking review. (6) Dj was pinged here 63 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit f3a872a into aurora-silicon:main Nov 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants