Skip to content

[Darwin48V] Update fan_service to control fan leds#1286

Open
aalamsi22 wants to merge 1 commit into
facebook:mainfrom
aalamsi22:darwin48v_sync
Open

[Darwin48V] Update fan_service to control fan leds#1286
aalamsi22 wants to merge 1 commit into
facebook:mainfrom
aalamsi22:darwin48v_sync

Conversation

@aalamsi22

@aalamsi22 aalamsi22 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Updates the fan_service to control leds. Add rpmMin to fan configs for immediate fan failure detection.

Without rpmMin, fan_service relies solely on the 300s kFanFailThresholdInSec timeout to detect fan failure. When a fan is removed, fanRpm defaults to 0 but fanFailed stays false until 5minutes of continuous access failures elapse — leaving the LED green the entire time.

Adding rpmMin=2400 enables the immediate rpmMin check in ControlLogic.cpp: fanRpm (0) < rpmMin (2400) triggers fanFailed=true on the very next control loop cycle, bypassing the 300s delay.

The value 2400 is ~10% below the hardware minimum RPM floor of 2739, measured on rkd340 at PWM=0. This also catches degraded fans that can't maintain the CPLD's minimum speed.

Test Plan

fan_service_hw_test PASSES
fan leds update correctly on fan insertion/removal

@aalamsi22 aalamsi22 requested a review from a team as a code owner June 12, 2026 05:56
@meta-cla meta-cla Bot added the CLA Signed label Jun 12, 2026
@meta-codesync

meta-codesync Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this in D108456338.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant