omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

T2 Mac mini: fan stuck at minimum, t2fanrd 'Fan not found' on linux-t2 7.3.4 (macsmc_hwmon binds, fan_control off); t2fanrd now archived

Open adamnickerson opened this issue 1 week ago • 4 comments

System details

Omarchy 4.5.0-3
Machine Apple Macmini8,1 (T2)
Kernel 7.3.4-arch1-Watanare-T2-1-t2 (linux-t2 7.3.4.arch1-1, arch-mact2 repo)
t2fanrd r16.48baf96-1

What happened

The fan sat at its minimum (1700 RPM, range 1700-4400) while the CPU die read 84°C. t2fanrd was crash-looping (restart counter over 247,000):

t2fanrd[...]: Error: Fan not found
t2fanrd.service: Main process exited, code=exited, status=1/FAILURE

Cause

  1. This kernel loads macsmc_hwmon (an Apple Silicon SMC driver) for the T2 SMC. Fans appear at /sys/class/hwmon/hwmonN/fan1_* (fan1_input, fan1_min, fan1_max, fan1_target). t2fanrd looks for applesmc, so it finds no fan.
  2. modprobe applesmc does not work as a fallback. It fails with applesmc: driver init failed (ret=-5)! after hanging modprobe in uninterruptible sleep for about 90 seconds.
  3. macsmc_hwmon ships with its unsafe fan_control parameter off. While off, every write to fan1_target returns EOPNOTSUPP (see macsmc_hwmon_write_fan() in drivers/hwmon/macsmc-hwmon.c).
  4. t2fanrd was archived upstream on 2026-11-16, so it will not get macsmc_hwmon support there.

Net effect: nothing controls the fan, and the machine runs hot with no visible error beyond the service restart loop.

Workaround that worked

/etc/modprobe.d/macsmc-fan.conf:

options macsmc_hwmon fan_control=1

plus a small systemd service that finds the macsmc_hwmon hwmon device by name and writes fan1_target along a linear curve (55°C to 75°C maps to min..max RPM; writing 0 hands control back to firmware). With it, the die dropped from 84°C to 61°C. Note fan1_min/fan1_max reads jitter by a few RPM, so the script re-reads them every cycle and keeps a 20 RPM margin, otherwise writes at the edges fail with EINVAL.

macsmc-fand script
#!/usr/bin/env bash
# Simple fan curve daemon for Macs using the macsmc_hwmon driver.
# Requires macsmc_hwmon.fan_control=1 (see /etc/modprobe.d/macsmc-fan.conf).
LOW=${LOW_TEMP:-55}; HIGH=${HIGH_TEMP:-75}
find_hwmon() { for h in /sys/class/hwmon/hwmon*; do [[ $(<"$h/name") == macsmc_hwmon ]] && echo "$h" && return; done; }
H=$(find_hwmon) || { echo "macsmc_hwmon not found" >&2; exit 1; }
T=""
for l in "$H"/temp*_label; do [[ $(<"$l") == *"(TC0F)"* ]] && T=${l%_label}_input; done
[[ -z $T ]] && for l in "$H"/temp*_label; do [[ $(<"$l") == *"(TCXC)"* ]] && T=${l%_label}_input; done
[[ -z $T ]] && { echo "no CPU temp sensor found" >&2; exit 1; }
# Writing 0 hands control back to the firmware
trap 'echo 0 > "$H/fan1_target"; exit 0' TERM INT
while :; do
  # min/max readings jitter slightly, so re-read each cycle and keep a margin
  MIN=$(( $(<"$H/fan1_min") + 20 )); MAX=$(( $(<"$H/fan1_max") - 20 ))
  t=$(( $(<"$T") / 1000 ))
  if   (( t <= LOW ));  then r=0
  elif (( t >= HIGH )); then r=$MAX
  else r=$(( MIN + (MAX-MIN)*(t-LOW)/(HIGH-LOW) )); fi
  echo "$r" > "$H/fan1_target" || echo "write of $r failed (temp ${t}C)" >&2
  sleep 2
done

Suggestion

  • Have the T2 installer set fan_control=1 for macsmc_hwmon.
  • Replace or patch t2fanrd, since upstream is archived. It could be a daemon that supports macsmc_hwmon, or something like the script above.
  • Possibly raise with the linux-t2 packagers whether macsmc_* should bind on T2 hardware at all, given applesmc can no longer initialize.

I have only tested on a Macmini8,1, so I don't know which other T2 models are affected.

Related: #5155, #12393, #18007. t2fanrd (archived): GnomedDev/T2FanRD#15, #17.

adamnickerson avatar Nov 21 '26 03:11 adamnickerson

Codex High read this report and the current quattro T2 setup in install/hardware/apple/fix-t2.sh, which installs t2fanrd and enables its service. The fan behavior could not be reproduced on the test workers because they lack T2 hardware. This was the only diagnostic review.

Classification remains unsettled because the second classifier returned no usable class. This awaits maintainer review of the kernel/daemon compatibility report before verification can proceed.

omarchybot avatar Nov 21 '26 03:11 omarchybot

The classification is now agreed as a hardware compatibility bug. I checked the current T2 installer, the Omarchy package recipe, and the packaged r16 source. That revision searches the legacy APP0001:00/fan* layout and uses fanN_manual/fanN_output. It has no discovery path for the hwmonN/fanN_target interface you describe. This is consistent with the startup failure, but I have not verified the running driver or reproduced it on a T2 Mac.

Upstream's archive notice points to standard hwmon daemons or the sharpenedblade fork. The current Omarchy package recipe still pins r16. Enabling fan_control alone does not change that revision's fan discovery. The kernel documentation marks manual control as unsafe because thermal fail-safe behavior is not guaranteed, so neither a new default nor a replacement daemon is verified here.

Please share these read-only outputs from the affected installation, and say which reflect the original failure and which reflect your workaround. The service log and driver paths will help distinguish this from the older Mac mini report #19178, whose cause is still unestablished. The fan-section change in #18020 and resume hook in #12590 do not add hwmon support.

uname -r
pacman -Q linux-t2 t2fanrd
systemctl cat t2fanrd.service
journalctl -b -u t2fanrd --no-pager -n 60
for h in /sys/class/hwmon/hwmon*; do
  [[ -r $h/name ]] || continue
  printf '\n%s: ' "$h"
  cat "$h/name"
  readlink -f "$h/device/driver"
  grep -H . "$h"/fan1_* 2>/dev/null
done
if [[ -r /sys/module/macsmc_hwmon/parameters/fan_control ]]; then
  cat /sys/module/macsmc_hwmon/parameters/fan_control
fi

GPT-6 in Codex reviewed this; its reasoning effort is not exposed. No hardware tests ran because the disposable workers lack a T2 SMC. No second opinion was available: Opus 5.5 High exhausted its weekly quota, and both the availability check and item-review attempt failed. This remains open, waiting on the diagnostics above; no fix is verified.

omarchybot avatar Nov 23 '26 14:11 omarchybot

Confirmed on a 2-fan MacBookPro16,1 (AMD Radeon Pro dGPU) after testing arch-mact2/linux-t2 7.3.5.arch1-4 alongside Omarchy's packaged t2fanrd r16.48baf96-2.

1. Original failure diagnostics (fresh boot on 7.3.5, before any workaround)

$ uname -r
7.3.5-arch1-Watanare-Uninstall-Omarchy-T2-4-t2

$ pacman -Q omarchy linux-t2 t2fanrd
omarchy 4.5.0-3
linux-t2 7.3.5.arch1-4
t2fanrd r16.48baf96-2

$ cat /sys/module/macsmc_hwmon/parameters/fan_control
N

systemctl cat t2fanrd.service:

# /usr/lib/systemd/system/t2fanrd.service
[Unit]
Description=Fan control for Macs with the Apple T2 chip

[Service]
Type=simple
ExecStart=/usr/bin/t2fanrd
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target

journalctl -b -u t2fanrd --no-pager (crash-looping every 2s, counter at 28 before stopping it):

Nov 28 09:03:18 MacBookPro systemd[1]: t2fanrd.service: Scheduled restart job, restart counter is at 28.
Nov 28 09:03:18 MacBookPro systemd[1]: Started Fan control for Macs with the Apple T2 chip.
Nov 28 09:03:18 MacBookPro t2fanrd[4234]: Error: Fan not found
Nov 28 09:03:18 MacBookPro systemd[1]: t2fanrd.service: Main process exited, code=exited, status=1/FAILURE
Nov 28 09:03:18 MacBookPro systemd[1]: t2fanrd.service: Failed with result 'exit-code'.

Relevant hwmon devices:

/sys/class/hwmon/hwmon1: amdgpu
/sys/bus/pci/drivers/amdgpu
  (also exposes fan1_enable, fan1_input, fan1_min, fan1_max, fan1_target)

/sys/class/hwmon/hwmon6: macsmc_hwmon
/sys/bus/platform/drivers/macsmc-hwmon
/sys/class/hwmon/hwmon6/fan1_input:1832
/sys/class/hwmon/hwmon6/fan1_label:Fan 0
/sys/class/hwmon/hwmon6/fan1_max:5616
/sys/class/hwmon/hwmon6/fan1_min:1836
/sys/class/hwmon/hwmon6/fan1_target:1836
/sys/class/hwmon/hwmon6/fan2_input:1699
/sys/class/hwmon/hwmon6/fan2_label:Fan 1
/sys/class/hwmon/hwmon6/fan2_max:5200
/sys/class/hwmon/hwmon6/fan2_min:1700
/sys/class/hwmon/hwmon6/fan2_target:1700

(On Omarchy's working linux-t2 1:7.2.15.arch1-1 baseline, applesmc-acpi-0 binds at /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:104/APP0001:00/ and t2fanrd controls both fans normally.)

2. Live macsmc_hwmon & suspend/resume verification on MacBookPro16,1

  • With fan_control=N, writing 3000 to fan1_target fails (exit 1).
  • /sys/module/macsmc_hwmon/parameters/fan_control is writable at runtime (-rw-r--r--); echo 1 > /sys/module/macsmc_hwmon/parameters/fan_control switches it to Y without reboot or module reload.
  • Writing 3000 to both fan1_target and fan2_target ramped both fans up (2851 / 2841 RPM within 4s).
  • Writing 0 to both targets cleanly returned control to Apple firmware (fan1_target → 1836, fan2_target → 1700; inputs dropped back to 1915 / 1794 RPM).
  • Suspend/resume: Pre-suspend targets (3000 RPM) were reset by SMC firmware during sleep to idle minimums (1836 / 1700), while /sys/class/hwmon/hwmon6 and fan_control=Y persisted across resume. Immediately after resume, writing 3200 to both fan1_target and fan2_target worked without re-toggling anything (3011 / 3036 RPM), and writing 0 again handed control back to firmware.

3. Notes on sharpenedblade/t2fanrd (01df44d, currently in arch-mact2)

Inspecting sharpenedblade/t2fanrd at 01df44d—it adds hwmon _target support, ignores amdgpu, and enables /sys/module/macsmc_hwmon/parameters/fan_control on startup, but has 3 gaps to watch if Omarchy adopts it:

  1. No firmware handback on exit for macsmc_hwmon: FanController::set_manual(false) is a no-op when manual_file is None, so stopping the daemon never writes 0 to fanN_target (leaving fans pinned at the last set RPM).
  2. Breaks 7.2 applesmc on MacBookPro16,1: Commit 89b02ee globs /sys/devices/pci*/*/*/*/APP0001:00/fan*_input, whereas on linux-t2 7.2.15 this Mac's APP0001:00 lives under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:104/APP0001:00/ (and is not exposed in /sys/class/hwmon/).
  3. Startup-only min/max: Reads fanN_min/fanN_max once at startup with no jitter margin, which risks EINVAL on machines where min/max readings fluctuate slightly.

JamesCaudill avatar Nov 28 '26 14:11 JamesCaudill

JamesCaudill’s fresh-boot logs show the same Fan not found restart loop on a two-fan MacBookPro16,1 with arch-mact2’s 7.3.5 kernel. Both fans are visible to macsmc_hwmon, while the packaged r16 daemon looks only for the legacy fan interface. The same Mac reportedly controls both fans on Omarchy’s 7.2.15 kernel. The stable package index serves that kernel, and the repository switch for existing T2 installs is included in v4.6.0-rc1. Hardware logs · Repository migration

The referenced fork at 01df44d can discover hwmon targets, but its shutdown code skips returning those fans to firmware control. @adamnickerson, if you can retest the Mac mini after booting Omarchy’s linux-t2 1:7.2.15.arch1-1 with t2fanrd r16.48baf96-2, please share uname -r, whether t2fanrd.service stays active, and whether the fan responds during normal use. Fork revision

GPT-6 High in Codex checked the daemon source, package indexes and migration. Opus 5.5 High and muse-wonder via pi, thinking high agreed on the kernel and daemon mismatch. Reviewer independence is uncertain. This session relied on the posted logs for hardware evidence.

omarchybot avatar Nov 28 '26 14:11 omarchybot