Repository navigation
hwmon: (macsmc) keep a fan whose optional keys are missing - #1084
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
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
8125f13 to
5de4194
Compare
|
Agreed. In v2 (5de4194) the four
|
|
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:
For this PR in particular: the macsmc_hwmon fan attributes are identical between the test boot and the default boot on both fanned Macs:
Thank you, Rolando! |
macsmc_hwmon_create_fan()drops the whole fan when any ofapple,fan-minimum/-maximum/-target/-modenames a key the SMC does not have. The T6050 SMC spells the mode keyF0md, notF0Md, 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. Theapple,fan-manual-controlcheck is unchanged.Tested on: J716s, HWMON-T1 (2026-11-07): the series kernel with a DT that enables
smc_hwmonwith dual fans (apple,fan-mode = "F0md"/"F1md").macsmc_hwmonregisters; 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 noFtstunlock key).macsmc-hwmon.obuilds clean withW=1onintegration/aurora7aee01a.Dependencies: none. Applies on its own and on top of #941 (T6050 SMC sensors), which touches the same file elsewhere.
Open questions:
apple,fan-mode = "F0md", as tested) the preferred way, or should the driver try both spellings?dev_warnonce per missing key, ordev_info?