facebook / fboss

Facebook Open Switching System Software for controlling network switches.
Other
860 stars 295 forks source link

Meru800bfa: add UCD90320 sensors #196

Closed adamcalabrigo closed 4 days ago

adamcalabrigo commented 5 months ago

Summary

Adds sensor support for UCD90320 and corrects the names of two existing temp sensors to follow the convention used by the other temp sensors. Note that this is supported on P2 only currently.

Testing

Tested on Meru800bfa.

ucd90320 is correctly initialized:

[ 5416.277630] ucd9000 12-0011: Device ID UCD90320U|3.0.0.3323|211011
[ 5417.830854] i2c i2c-12: new_device: Instantiated device ucd90320 at 0x11

platform_manager creates the symlink for the UCD90320 sensors. From the service log:

Creating symlink from /run/devmap/sensors/SMB_UCD90320 to /sys/bus/i2c/devices/12-0011/hwmon/hwmon19. DevicePath: /SMB_SLOT@0/[SMB_UCD90320]

Ran sensor_service and ensured that the new sensors are being polled correctly. From the service log:

SMB_DPM_12V: Path=/run/devmap/sensors/SMB_UCD90320/in1_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_1V2_DKR: Path=/run/devmap/sensors/SMB_UCD90320/in4_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_1V9_DKR: Path=/run/devmap/sensors/SMB_UCD90320/in3_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_3V3: Path=/run/devmap/sensors/SMB_UCD90320/in7_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_3V3_DKR: Path=/run/devmap/sensors/SMB_UCD90320/in2_input, Compute=@/1000.0, FRU=SMB
SMB_DPM_5V0: Path=/run/devmap/sensors/SMB_UCD90320/in8_input, Compute=@/1000.0, FRU=SMB
...
SMB_DPM_5V0 (/run/devmap/sensors/SMB_UCD90320/in8_input) : 4.928                                                                                                                                        
SMB_DPM_3V3_DKR (/run/devmap/sensors/SMB_UCD90320/in2_input) : 3.305                                                                                                                                    
SMB_DPM_3V3 (/run/devmap/sensors/SMB_UCD90320/in7_input) : 3.311                                                                                                                                        
SMB_DPM_1V2_DKR (/run/devmap/sensors/SMB_UCD90320/in4_input) : 1.197                                                                                                                                    
SMB_DPM_12V (/run/devmap/sensors/SMB_UCD90320/in1_input) : 12.089

On P1, platform_manager logs the failures:

Failures in PmUnit SMB at /SMB_SLOT@0
1. Failed to create i2c device for SMB_UCD90320 (ucd90320) at bus: 12, addr: 0x11 with exit status 0
2. Failed to create a symlink /run/devmap/sensors/SMB_UCD90320 for DevicePath /SMB_SLOT@0/[SMB_UCD90320]. Reason: SMB_UCD90320 is not plugged-in to the platform

sensor_service logs the failures also:

Could not read data for SMB_DPM_12V from path:/run/devmap/sensors/SMB_UCD90320/in1_input, error:File does not exist
Could not read data for SMB_DPM_1V2_DKR from path:/run/devmap/sensors/SMB_UCD90320/in4_input, error:File does not exist
Could not read data for SMB_DPM_1V9_DKR from path:/run/devmap/sensors/SMB_UCD90320/in3_input, error:File does not exist
Could not read data for SMB_DPM_3V3 from path:/run/devmap/sensors/SMB_UCD90320/in7_input, error:File does not exist
Could not read data for SMB_DPM_3V3_DKR from path:/run/devmap/sensors/SMB_UCD90320/in2_input, error:File does not exist
Could not read data for SMB_DPM_5V0 from path:/run/devmap/sensors/SMB_UCD90320/in8_input, error:File does not exist
Processed 145 Sensors. 6 Failures.
facebook-github-bot commented 5 months ago

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

joancaneus commented 5 months ago

@adamcalabrigo can you please also add the P1 testing log in this PR?

facebook-github-bot commented 4 months ago

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

somasun commented 4 months ago

@adamcalabrigo - are the failures for UCD90320 in P1 expected? If so, why?

adamcalabrigo commented 3 weeks ago

@joancaneus I have since retested P1 with the updated CPLD image and there are no more failures.

adamcalabrigo commented 4 days ago

Redundant to the changes in #208