Skip to content

[Mellanox] fix fan speed tolerance from hardcode to hw-mgmt sysfs reading#28598

Open
yuazhe wants to merge 1 commit into
sonic-net:masterfrom
yuazhe:master_fix_fan_speed
Open

[Mellanox] fix fan speed tolerance from hardcode to hw-mgmt sysfs reading#28598
yuazhe wants to merge 1 commit into
sonic-net:masterfrom
yuazhe:master_fix_fan_speed

Conversation

@yuazhe

@yuazhe yuazhe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Why I did it

The fixed 50% tolerance is too tight for PSU fans and can cause false low-speed warnings when the actual speed is just below the threshold, such as 29% against a 60% target. Using the PSU fan’s actual min/max RPM range makes the tolerance reflect the hardware behavior more accurately.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Overrode get_speed_tolerance() in PsuFan to read psu{N}_fan_min and psu{N}_fan_max from hw-management, then convert them to a percentage with 100 * min_rpm // max_rpm. If max_rpm is 0, it falls back to the default 50% tolerance.

How to verify it

Check that /var/run/hw-management/thermal/psu{N}_fan_min and psu{N}_fan_max contain valid values, then restart pmon and monitor thermalctld logs. The repeated Fan low speed warning around 29% current speed and 60% target speed should no longer appear as a false warning.

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO):
Failure type:

Tested branch

  • master
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608
  • N/A

Test result

202605: 20260531.42

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Yuanzhe Liu <yualiu@nvidia.com>
@yuazhe
yuazhe requested a review from lguohan as a code owner July 23, 2026 08:08
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants