Skip to content

hwmon: (macsmc) keep a fan whose optional keys are missing - #1084

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
rolotrealanis98:pr/macsmc-hwmon-optional-fan-keys
Nov 8, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
rolotrealanis98:pr/macsmc-hwmon-optional-fan-keys

Conversation

@rolotrealanis98

Copy link
Copy Markdown
Contributor

macsmc_hwmon_create_fan() drops the whole fan when any of apple,fan-minimum/-maximum/-target/-mode names a key the SMC does not have. The T6050 SMC spells the mode key F0md, not F0Md, so a fan description shared with older machines loses both fans. This keeps the fan, warns, drops that attribute, and allows manual control only when mode, target, minimum and maximum all exist. The apple,fan-manual-control check is unchanged.

Tested on: J716s, HWMON-T1 (2026-11-07): the series kernel with a DT that enables smc_hwmon with dual fans (apple,fan-mode = "F0md"/"F1md"). macsmc_hwmon registers; both fans are listed with min 1350 and max 5349/5777 rpm (0 rpm, fans off at 28 C), plus 60+ discovered temperature channels and the power keys. No probe warning, so every key that DT names exists; the missing-key path itself has not run on hardware. Fan control not tried (the T6050 SMC has no Ftst unlock key). macsmc-hwmon.o builds clean with W=1 on integration/aurora 7aee01a.

Dependencies: none. Applies on its own and on top of #941 (T6050 SMC sensors), which touches the same file elsewhere.

Open questions:

  • Is describing the T6050 mode key in the DT (apple,fan-mode = "F0md", as tested) the preferred way, or should the driver try both spellings?
  • Warning level: dev_warn once per missing key, or dev_info?

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Merge-train pre-review (11-08). It isn't on our merge list yet, so a maintainer decides. Keeping the fan when optional keys are missing, and clearing manual control unless min/max/target all exist, looks correct. One note: the dev_warn lines become boot-log warnings on any Mac whose DT names a key its SMC lacks; dev_info (or a single combined line per fan) would keep the warning level for real faults.

macsmc_hwmon_create_fan() returns an error, dropping the whole fan, when
any of apple,fan-minimum/-maximum/-target/-mode names a key the SMC does
not have. The T6050 (M5 Pro) SMC spells the mode key F0md instead of
F0Md, so a fan description shared with older machines loses both fans.
Treat the optional keys as optional: drop that attribute, report the
missing keys in one info-level line per fan, and only allow manual
control when the mode, target, minimum and maximum keys all exist.

Port of m5pro-linux integration patch 0003 to the Aurora driver, which
has since gained apple,fan-manual-control; that check is unchanged and
still sees the mode key cleared when manual control is not possible.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
Assisted-by: LLM Claude
@rolotrealanis98
rolotrealanis98 force-pushed the pr/macsmc-hwmon-optional-fan-keys branch from 8125f13 to 5de4194 Compare November 7, 2026 15:32
@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Agreed. In v2 (5de4194) the four dev_warns become one dev_info per fan that lists the missing optional keys, e.g. Fan F0Ac: optional keys not found: mode F0Md. The dev_warn for apple,fan-manual-control on a fan that cannot support it stays.

macsmc-hwmon.o builds clean with W=1. The J716s run (HWMON-T1) registers both fans, but the DT there names only keys the SMC has, so the missing-key path, and this message, has not run on hardware yet.

@RyanTheTide
RyanTheTide merged commit 286609d into aurora-silicon:integration/aurora Nov 8, 2026
1 check passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

Tested before merging, silent: one-shot test kernel 7.3.0-aurora-f4mtr3x/y = integration/aurora 36d9198 plus this PR, #1082, #1083, #1084, #1060 and the Touch ID series, all merged onto the current tip. It was booted once on each of the four fleet Macs (M2 J413, M1 Pro J316s, J616s M4 Pro, MacBook Neo J700), and our regression suite was compared with the fleet30 rows on the same Macs:

  • boot err-level lines and AVC: 0 on every Mac;
  • 12 suspend/resume cycles with speaker regrant;
  • Wi-Fi/BT reconnect, camera and display;
  • AVD decode bit-exact (fps within ±2%);
  • ANE runs and resumes.
    No regression came from these PRs.

For this PR in particular: the macsmc_hwmon fan attributes are identical between the test boot and the default boot on both fanned Macs:

  • M1 Pro and J616s: fan1/fan2 input, label, min, max and target.
  • Every fleet DT fan node lists all its optional keys, so nothing is dropped there.

Thank you, Rolando!

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