Skip to content

Fix MAX fan control on M1–M4 Apple Silicon - #2

Open
HerbertGao wants to merge 1 commit into
ecc521:mainfrom
HerbertGao:fix/apple-silicon-max-fan-control
Open

Fix MAX fan control on M1–M4 Apple Silicon#2
HerbertGao wants to merge 1 commit into
ecc521:mainfrom
HerbertGao:fix/apple-silicon-max-fan-control

Conversation

@HerbertGao

@HerbertGao HerbertGao commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Fix Apple Silicon MAX mode on M1–M4 machines by acquiring the Ftst fan-control gate before writing per-fan manual mode and target RPM keys.

The previous implementation attempted F%dmd = 1 directly, swallowed mode-write failures, and then wrote F%dTg. On an M1 Max this left thermalmonitord in control, so MAX remained near idle RPM even though the UI reported the fan as managed.

Changes

  • detect whether the machine exposes the M1–M4 Ftst gate;
  • enable Ftst before per-fan manual mode when present;
  • retain direct per-fan mode support for newer hardware without Ftst;
  • probe lowercase/uppercase fan-mode key variants without permanently caching transient probe errors;
  • serialize fan-control set/reset operations;
  • retry transient Ftst, mode, and target writes with bounded delays;
  • roll back to Apple control when target application fails;
  • clear Ftst when returning M1–M4 hardware to System control.

Scope

This PR intentionally changes only AppleSiliconSMC.swift. Broader lifecycle/state-machine changes discovered during review were kept out of this patch and proposed separately in #1.

Validation

  • swift test --package-path SMCKit — 13 tests passed
  • xcodebuild build -project CoolMyMac-App/CoolMyMac.xcodeproj -scheme CoolMyMac-Daemon -configuration Debug ONLY_ACTIVE_ARCH=YES CODE_SIGNING_ALLOWED=NO — passed
  • git diff --check — passed

Hardware validation status

The original failure was reproduced on MacBookPro18,2 / M1 Max. Final privileged daemon validation still needs a build signed with the upstream project's team identity, so this PR is opened as draft.

@HerbertGao HerbertGao changed the title Fix MAX fan control on M1–M4 Apple Silicon 修复 M1–M4 Apple Silicon 上的 MAX 风扇控制 Aug 1, 2026
@HerbertGao HerbertGao changed the title 修复 M1–M4 Apple Silicon 上的 MAX 风扇控制 Fix MAX fan control on M1–M4 Apple Silicon Aug 1, 2026
@HerbertGao
HerbertGao marked this pull request as ready for review August 1, 2026 09:19
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.

1 participant