Repository navigation
Conversation
…ped manual fan resetAuto() discarded every writeKey result and logged "Reset to Apple defaults" unconditionally, so a rejected mode write — e.g. the firmware refusing fan-mode writes — left fans latched in manual while callers believed the reset succeeded: the SIGTERM shutdown path logs "released fans to auto" from this very result, and the watchdog / `.auto` paths rely on the throw to tell the client the truth. Every fan is still attempted before throwing, so one uncooperative key cannot strand the remaining fans in manual mode (supersedes the mode/Ftst part of ProducerGuy#30). Beyond ProducerGuy#30, fans whose AUTO-mode write failed stay in manual mode, and writing their target to 0 anyway would command a manual 0 RPM — a stopped, unsupervised fan. They keep their last (spinning) target instead, and the throw makes the caller retry the whole reset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
FanControl.resetAuto()discarded everywriteKeyresult and logged "Reset to Apple defaults" unconditionally. When a write is rejected — the common case being a non-root caller, where AppleSMC allows reads but the firmware rejects fan-mode writes — the fans stay latched in manual mode while every caller believes the reset succeeded. Two callers are directly affected today: the SIGTERM shutdown path logs "released fans to auto" from this call's result, and the watchdog /.autopaths rely on the throw to tell the client the truth.This is the same diagnosis as #30 — that PR is the right direction and this builds on it.
Fix
Testing
swift build+ fullswift testpass (152 tests). The change is in the SMC write path itself, which (like #30) has no hardware-free seam to unit-test; behavior is covered by review of the write sequence.