Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fanctrl] Fix fanctrl crash when system thermal direction is unknown #151

Merged

Conversation

pphuchar
Copy link
Collaborator

- What I did
Fix fan control bug that causes segmentation fault when system P/N is not recognized by it.
Update the following component P/N of F2B airflow models:

  1. Product PN(TLV): R1241-F9019-01
  2. FANs PN(FRU): R1241-FN019-013JW
  3. PSU PN(FRU): DPS-1100FB

- How I did it
Handle the case when system P/N is not recognized by set fan speed to max and exit the program.
Add error log about unrecognize P/N in the system log.

- How to verify it
Change System P/N in TLV EEPROM to something else like "EMPTY" or remove P/N feild.
Then run service fanctrl restart the fand_v2 MUST not crash.
An error about unrecognized system P/N logged in the system log.

- Description for the changelog

Fix questone2db fancontrol app crash

Test log:

root@sonic:/home/admin# ./fand_v2 
root@sonic:/home/admin# show logging fand_v2
Dec 23 19:33:40.591913 sonic DEBUG fand_v2: Starting up;  system should have 4 fans.
Dec 23 19:33:40.603766 sonic NOTICE fand_v2: Initializing FSC policy
Dec 23 19:33:40.780370 sonic ERR fand_v2: unrecognized system P/N in TLV EEPROM
Dec 23 19:33:40.780780 sonic ERR fand_v2: system thermal direction is unknown, FAN speed is set to 100%
Dec 23 19:33:41.851546 sonic ERR fand_v2: FAN1 airflow direction mismatch, direction is B2F, system direction is Unknown
Dec 23 19:33:42.760146 sonic ERR fand_v2: FAN2 airflow direction mismatch, direction is B2F, system direction is Unknown
Dec 23 19:33:43.667902 sonic ERR fand_v2: FAN3 airflow direction mismatch, direction is B2F, system direction is Unknown
Dec 23 19:33:44.575923 sonic ERR fand_v2: FAN4 airflow direction mismatch, direction is B2F, system direction is Unknown
Dec 23 19:33:45.489170 sonic ERR fand_v2: PSU1 airflow direction mismatch, direction is B2F, system direction is Unknown
Dec 23 19:33:46.396972 sonic ERR fand_v2: PSU2 airflow direction mismatch, direction is B2F, system direction is Unknown
Dec 23 19:33:46.397534 sonic NOTICE fand_v2: Failed, Unknown thermal direction
Dec 23 19:33:46.397862 sonic NOTICE fand_v2: Trying to exit...
Dec 23 19:33:46.398189 sonic NOTICE fand_v2: exit
root@sonic:/home/admin# 

[platform/fanctrl] Fix daemon crash when thermal direction is unknown.

 *Fix pointer uninitialized when thermal direction is unknown.
 *If thermal direction is unknown, set fan speed to 100% and exit program.
 *Update new F2B system and fans Part-Number.
@pphuchar pphuchar self-assigned this Apr 16, 2020
@pphuchar pphuchar added the enhancement New feature or request label Apr 16, 2020
Copy link

@mudsut4ke mudsut4ke left a comment

Choose a reason for hiding this comment

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

Look good, Can you attach a test log when service work as normal ?

@pphuchar
Copy link
Collaborator Author

Look good, Can you attach a test log when service work as normal ?

Still waiting for a new FANs/PSUs FRU image...

@pphuchar
Copy link
Collaborator Author

Look good, Can you attach a test log when service work as normal ?

Normal running with F2B fans and a psu.

Dec 30 17:36:18 sonic systemd[1]: Started Service for fancontrol.
Dec 30 17:36:18 sonic fand_v2[2064]: Initializing FSC policy
Dec 30 17:36:18 sonic fand_v2[2064]: system thermal direction is F2B
Dec 30 17:36:19 sonic fand_v2[2064]: FAN1 airflow direction match, direction is F2B, system direction is F2B
Dec 30 17:36:20 sonic fand_v2[2064]: FAN2 airflow direction match, direction is F2B, system direction is F2B
Dec 30 17:36:21 sonic fand_v2[2064]: FAN3 airflow direction match, direction is F2B, system direction is F2B
Dec 30 17:36:22 sonic fand_v2[2064]: FAN4 airflow direction match, direction is F2B, system direction is F2B
Dec 30 17:36:22 sonic fand_v2[2064]: PSU1 airflow direction match, direction is F2B, system direction is F2B
Dec 30 17:36:22 sonic fand_v2[2064]: PSU2 eeprom is ABNORMAL, read PSU2 eeprom failed
Dec 30 17:36:22 sonic fand_v2[2064]: setting F2B thermal policy
Dec 30 17:36:22 sonic fand_v2[2064]: PID configure: using default PID params
Dec 30 17:36:22 sonic fand_v2[2064]: SWITCH_TEMP: setpoint=95.000000, p=3.000000, i=0.300000, d=0.300000
Dec 30 17:36:22 sonic fand_v2[2064]: CPU_TEMP: setpoint=-15.000000, p=2.000000, i=0.500000, d=0.500000
Dec 30 17:36:28 sonic fand_v2[2064]: PSU2 is power off
Dec 30 17:36:28 sonic fand_v2[2064]: critical temp 13, fan speed 44%
Dec 30 17:36:28 sonic fand_v2[2064]: Fan speed changing from 50% to 44%

@pphuchar pphuchar marked this pull request as ready for review April 23, 2020 12:20
@pphuchar pphuchar merged commit 4310a25 into SONIC-DEV:201911_cel_wb Apr 24, 2020
@pphuchar pphuchar deleted the 201911_cel_wb-fix-q2bd-fand branch May 13, 2020 12:32
mudsut4ke pushed a commit that referenced this pull request Jan 25, 2021
d155c1e 2020-07-10 | use kstrtol_from_user in dni_dps460 driver (#151)

Signed-off-by: Guohan Lu <lguohan@gmail.com>
mudsut4ke pushed a commit that referenced this pull request Jan 25, 2021
* src/sonic-snmpagent 89b7b2c...c702a57 (7):
  > Revert "[rfc1213] Interface MIB add l3 vlan interfaces & aggregate rif counters (#133)" (#151)
  > Update transceiver info DB key names (#146)
  > Fix LGTM reported alert of PR#141 (#142)
  > [Namespace] Fix interfaces counters in InterfacesMIB RFC 2863 (#141)
  > [Namespace]: Fix SNMP AgentX  socket connection timeout when using Namespace.get_all()  (#140)
  > [rfc1213] Interface MIB add l3 vlan interfaces & aggregate rif counters (#133)
  > Fix undefined variable and warning message (#134)

* src/sonic-py-swsssdk a83366e...2df4f40 (3):
  > Allowing TCP connections with namespace as well. (#81)
  > [port_util] add get_rif_port_map, get_vlan_interface_oid_map (#78)
  > Updates to the namespace API's for test_moduleLoad.py (#77)

Note that sonic-snmpagent submodule update is dependent upon sonic-py-swsssdk update, so updating both submodules in this PR.
mudsut4ke pushed a commit that referenced this pull request Jan 25, 2021
…ic-net#6124)

This PR updates the submodule sonic-platform-common, sonic-platform-daemons

For sonic-platform-common update following commits are added
a8823a3 [sonic_y_cable] add check_mux_direction api for y_cable (#151)
7c0301d Modular Chassis - APIs for midplane monitoring (#148)
6f7d8a0 Fix some LGTM alerts; Add LGTM badges to README.md (#146)

for sonic-platform-daemons update following commits are added
73e6ddd [xcvrd] replace check_active_linked_tor_side api to check_mux_direction (#131)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
mudsut4ke pushed a commit that referenced this pull request Mar 16, 2021
This PR includes the following commit in sonic-platform-daemons

068bccc [xcvrd] Store mux_cable telemetry data in State DB (#148)
93cac0a [ci]: download from sonic-buildimage.vs artifact (#152)
d651e9b [GitHub] Add pull request template (#151)
bd7830b [pcied] Remove unnecessary message and move the configuration path (#144)
9080fda [ci] Call pip2/3 using sudo (#150)
de60784 [ci] Test and build packages using Azure Pipelines (#149)
8bf0fd1 [ledd] Refactor to allow for more thorough unit testing; Increase unit test coverage (#147)
26bdc9e Set up CI with Azure Pipelines
1fcaa57 [pcied] Add PCIe AER stats collection (#100)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
jerseyang pushed a commit that referenced this pull request Jun 4, 2021
This PR includes the following commit in sonic-platform-daemons

068bccc [xcvrd] Store mux_cable telemetry data in State DB (#148)
93cac0a [ci]: download from sonic-buildimage.vs artifact (#152)
d651e9b [GitHub] Add pull request template (#151)
bd7830b [pcied] Remove unnecessary message and move the configuration path (#144)
9080fda [ci] Call pip2/3 using sudo (#150)
de60784 [ci] Test and build packages using Azure Pipelines (#149)
8bf0fd1 [ledd] Refactor to allow for more thorough unit testing; Increase unit test coverage (#147)
26bdc9e Set up CI with Azure Pipelines
1fcaa57 [pcied] Add PCIe AER stats collection (#100)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants