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

Meru800bia: adds P2 devices and sensors to PM/sensor_service #195

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adamcalabrigo
Copy link
Contributor

@adamcalabrigo adamcalabrigo commented Apr 24, 2024

Summary

Adds two devices (new to P2) to platform_manager.json then updates sensor_service.json to track the new sensors.
Also adds initRegSettings for temperature sensor devices to override default hardware thresholds.

Testing

Verified on Meru800bia.

Started platform_manager, which succeeds and creates the correct new symlinks. From the service log:

Creating symlink from /run/devmap/sensors/SMB_MAX6581 to /sys/bus/i2c/devices/12-004d/hwmon/hwmon8. DevicePath: /SMB_SLOT@0/[SMB_MAX6581]
Creating symlink from /run/devmap/sensors/SMB_MGMT_TMP75 to /sys/bus/i2c/devices/20-0048/hwmon/hwmon14. DevicePath: /SMB_SLOT@0/[SMB_MGMT_TMP75]

Started sensor_service and verified that the new devices are being polled and are correctly reading sensors. From the service log:

SMB_J3_BOARD_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp1_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_CORE_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp2_input, Compute=@/1000.0, FRU=SMB                                                                                                      
SMB_J3_DIODE_FAB0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp3_input, Compute=@/1000.0, FRU=SMB                                                                                                      
SMB_J3_DIODE_FAB1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp4_input, Compute=@/1000.0, FRU=SMB                                                                                                      
SMB_J3_DIODE_HBM0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp7_input, Compute=@/1000.0, FRU=SMB                                                                                                      
SMB_J3_DIODE_HBM1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp8_input, Compute=@/1000.0, FRU=SMB                                                                                                      
SMB_J3_DIODE_NIF0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp5_input, Compute=@/1000.0, FRU=SMB                                                                                                      
SMB_J3_DIODE_NIF1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp6_input, Compute=@/1000.0, FRU=SMB
SMB_MGMT_INLET_TEMP: Path=/run/devmap/sensors/SMB_MGMT_TMP75/temp1_input, Compute=@/1000.0, FRU=SMB
...
SMB_J3_BOARD_TEMP (/run/devmap/sensors/SMB_MAX6581/temp1_input) : 36.25
SMB_J3_DIODE_CORE_TEMP (/run/devmap/sensors/SMB_MAX6581/temp2_input) : 60.125
SMB_J3_DIODE_FAB0_TEMP (/run/devmap/sensors/SMB_MAX6581/temp3_input) : 58.625
SMB_J3_DIODE_FAB1_TEMP (/run/devmap/sensors/SMB_MAX6581/temp4_input) : 59.125
SMB_J3_DIODE_HBM0_TEMP (/run/devmap/sensors/SMB_MAX6581/temp7_input) : 55.375
SMB_J3_DIODE_HBM1_TEMP (/run/devmap/sensors/SMB_MAX6581/temp8_input) : 55
SMB_J3_DIODE_NIF0_TEMP (/run/devmap/sensors/SMB_MAX6581/temp5_input) : 61
SMB_J3_DIODE_NIF1_TEMP (/run/devmap/sensors/SMB_MAX6581/temp6_input) : 60.5

Registers are initialized correctly:

I0520 20:22:02.897955  2311 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-12
I0520 20:22:02.897962  2311 I2cExplorer.cpp:116] Setting up i2c device 12-0049. Writing 1 bytes at register 3
I0520 20:22:02.898873  2311 I2cExplorer.cpp:132] Creating i2c device SMB_TMP75_FRONT (tmp75) at i2c-12
V0520 20:22:02.898889  2311 PlatformUtils.cpp:15] Executing command: echo tmp75 0x49 > /sys/bus/i2c/devices/i2c-12/new_device
I0520 20:22:03.004415  2311 I2cExplorer.cpp:174] Created i2c device SMB_TMP75_FRONT (tmp75) at /sys/bus/i2c/devices/12-0049
I0520 20:22:03.004444  2311 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-12
I0520 20:22:03.004450  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004a. Writing 1 bytes at register 3
I0520 20:22:03.005340  2311 I2cExplorer.cpp:132] Creating i2c device SMB_TMP75_REAR (tmp75) at i2c-12
V0520 20:22:03.005354  2311 PlatformUtils.cpp:15] Executing command: echo tmp75 0x4a > /sys/bus/i2c/devices/i2c-12/new_device
I0520 20:22:03.110370  2311 I2cExplorer.cpp:174] Created i2c device SMB_TMP75_REAR (tmp75) at /sys/bus/i2c/devices/12-004a
I0520 20:22:03.110399  2311 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-12
I0520 20:22:03.110406  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 32
I0520 20:22:03.111308  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 33
I0520 20:22:03.112212  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 34
I0520 20:22:03.113115  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 35
I0520 20:22:03.114017  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 36
I0520 20:22:03.114919  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 37
I0520 20:22:03.115829  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 38
I0520 20:22:03.116330  2311 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 39
I0520 20:22:03.117245  2311 I2cExplorer.cpp:132] Creating i2c device SMB_MAX6581 (max6581) at i2c-12
V0520 20:22:03.117258  2311 PlatformUtils.cpp:15] Executing command: echo max6581 0x4d > /sys/bus/i2c/devices/i2c-12/new_device
I0520 20:22:03.181843  2311 I2cExplorer.cpp:174] Created i2c device SMB_MAX6581 (max6581) at /sys/bus/i2c/devices/12-004d
I0520 20:22:03.181867  2311 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-13
I0520 20:22:03.181873  2311 I2cExplorer.cpp:116] Setting up i2c device 13-0048. Writing 1 bytes at register 3
I0520 20:22:03.182794  2311 I2cExplorer.cpp:132] Creating i2c device FAN_TMP75 (tmp75) at i2c-13
V0520 20:22:03.182806  2311 PlatformUtils.cpp:15] Executing command: echo tmp75 0x48 > /sys/bus/i2c/devices/i2c-13/new_device
I0520 20:22:03.288357  2311 I2cExplorer.cpp:174] Created i2c device FAN_TMP75 (tmp75) at /sys/bus/i2c/devices/13-0048

Also verified on P1:

PM will log failure in setting up P2 devices:

Failures in PmUnit SMB at /SMB_SLOT@0
1. Failed to create i2c device for SMB_MAX6581 (max6581) at bus: 12, addr: 0x4d with exit status 0
2. Failed to create i2c device for SMB_MGMT_TMP75 (tmp75) at bus: 20, addr: 0x48 with exit status 0
3. Failed to create a symlink /run/devmap/sensors/SMB_MAX6581 for DevicePath /SMB_SLOT@0/[SMB_MAX6581]. Reason: SMB_MAX6581 is not plugged-in to the platform
4. Failed to create a symlink /run/devmap/sensors/SMB_MGMT_TMP75 for DevicePath /SMB_SLOT@0/[SMB_MGMT_TMP75]. Reason: SMB_MGMT_TMP75 is not plugged-in to the platform

Registers for present devices are initialized correctly:

I0520 20:27:45.681740  7595 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-12
I0520 20:27:45.681749  7595 I2cExplorer.cpp:116] Setting up i2c device 12-0049. Writing 1 bytes at register 3
I0520 20:27:45.682672  7595 I2cExplorer.cpp:132] Creating i2c device SMB_TMP75_FRONT (tmp75) at i2c-12
V0520 20:27:45.682691  7595 PlatformUtils.cpp:15] Executing command: echo tmp75 0x49 > /sys/bus/i2c/devices/i2c-12/new_device
I0520 20:27:45.788043  7595 I2cExplorer.cpp:174] Created i2c device SMB_TMP75_FRONT (tmp75) at /sys/bus/i2c/devices/12-0049
I0520 20:27:45.788078  7595 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-12
I0520 20:27:45.788086  7595 I2cExplorer.cpp:116] Setting up i2c device 12-004a. Writing 1 bytes at register 3
I0520 20:27:45.789017  7595 I2cExplorer.cpp:132] Creating i2c device SMB_TMP75_REAR (tmp75) at i2c-12
V0520 20:27:45.789033  7595 PlatformUtils.cpp:15] Executing command: echo tmp75 0x4a > /sys/bus/i2c/devices/i2c-12/new_device
I0520 20:27:45.894108  7595 I2cExplorer.cpp:174] Created i2c device SMB_TMP75_REAR (tmp75) at /sys/bus/i2c/devices/12-004a
I0520 20:27:45.894130  7595 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-12
I0520 20:27:45.894135  7595 I2cExplorer.cpp:116] Setting up i2c device 12-004d. Writing 1 bytes at register 32
E0520 20:27:45.895047  7595 PlatformExplorer.cpp:565] write() failed to write to /dev/i2c-12, errno = Input/output error
I0520 20:27:45.895066  7595 I2cExplorer.cpp:132] Creating i2c device SMB_MAX6581 (max6581) at i2c-12
V0520 20:27:45.895086  7595 PlatformUtils.cpp:15] Executing command: echo max6581 0x4d > /sys/bus/i2c/devices/i2c-12/new_device
I0520 20:27:45.999155  7595 I2cExplorer.cpp:227] I2cDevice at busNum: 12 and addr: 004d is not yet created. Waiting for 5s
E0520 20:27:50.999283  7595 PlatformExplorer.cpp:580] Failed to create i2c device for SMB_MAX6581 (max6581) at bus: 12, addr: 0x4d with exit status 0
I0520 20:27:50.999335  7595 I2cDevIo.cpp:85] Creating I2cRdWrIo for /dev/i2c-13
I0520 20:27:50.999342  7595 I2cExplorer.cpp:116] Setting up i2c device 13-0048. Writing 1 bytes at register 3
I0520 20:27:51.000044  7595 I2cExplorer.cpp:132] Creating i2c device FAN_TMP75 (tmp75) at i2c-13
V0520 20:27:51.000063  7595 PlatformUtils.cpp:15] Executing command: echo tmp75 0x48 > /sys/bus/i2c/devices/i2c-13/new_device
I0520 20:27:51.085118  7595 I2cExplorer.cpp:174] Created i2c device FAN_TMP75 (tmp75) at /sys/bus/i2c/devices/13-0048

sensor_service logs missing sensors:

Could not read data for SMB_J3_BOARD_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp1_input, error:File does not exist
Could not read data for SMB_J3_DIODE_CORE_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp2_input, error:File does not exist
Could not read data for SMB_J3_DIODE_FAB0_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp3_input, error:File does not exist
Could not read data for SMB_J3_DIODE_FAB1_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp4_input, error:File does not exist
Could not read data for SMB_J3_DIODE_HBM0_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp7_input, error:File does not exist
Could not read data for SMB_J3_DIODE_HBM1_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp8_input, error:File does not exist
Could not read data for SMB_J3_DIODE_NIF0_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp5_input, error:File does not exist
Could not read data for SMB_J3_DIODE_NIF1_TEMP from path:/run/devmap/sensors/SMB_MAX6581/temp6_input, error:File does not exist
Could not read data for SMB_MGMT_INLET_TEMP from path:/run/devmap/sensors/SMB_MGMT_TMP75/temp1_input, error:File does not exist

@facebook-github-bot
Copy link
Contributor

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

@joancaneus
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@adamcalabrigo has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

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

facebook-github-bot pushed a commit that referenced this pull request Sep 19, 2024
Summary:
# Description
- Symlinks are now organized in the following order for each PMUnit starting from root:
  - Fpgas
  - I2c Buses
  - SMB Idrpom
  - I2c devices
  - Embedded sensors
  - Xcvrs
  - Spi Devices
- Meru800BFA: Added symlinks to spi devices
- Sensor service configs are sorted based on the order of i2c devices they’re on
-  Removed symlink for "/[IDPROM]" on Meru800BIA as PM handles creating the symlink without a config for it.
- Meru800BIA now uses the lm75 driver instead of tmp75. The tmp75 driver is not compatible with some of the parts sourced from some vendors which can cause unexpected behavior.  The lm75 is a more general driver and avoids any part specific configurations.
- PM configs updated to configure temp sensors overtemp limits

PR includes all changes in the following PRs: #195, #196

# Test

### Meru800BFA:
- Flash devices symlinks
```
# ls -al /run/devmap/flashes/
total 0
drwxr-xr-x 2 root root 140 Aug 27 17:52 .
drwxr-xr-x 9 root root 180 Aug 27 17:13 ..
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI0_MASTER0_DEVICE1 -> /dev/spidev2005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI1_MASTER0_DEVICE1 -> /dev/spidev3005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI2_MASTER0_DEVICE1 -> /dev/spidev4005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:52 SMB_SPI3_MASTER0_DEVICE1 -> /dev/spidev5005.0
lrwxrwxrwx 1 root root  17 Aug 27 17:13 SMB_SPI_MASTER0_DEVICE1 -> /dev/spidev5005.0
```
- PM initializes successfully. Some "failures" are reported but are not caused by this PR.
  - Wrong FAN CPLD firmware  version path. The version files are located under hwmon directories that the check omits. . Likely introduced by 77d10bc
  - Known failure logs due to SCM_IDPROM_P1
```
 Failed to open firmware version file /run/devmap/cplds/FAN0_CPLD/cpld_ver: No such file or directory
 Failed to open firmware version file /run/devmap/cplds/FAN0_CPLD/cpld_sub_ver: No such file or directory
 Reporting firmware version for FAN0_CPLD - version string:0.0 ODS value:0
 Failed to open firmware version file /run/devmap/cplds/FAN1_CPLD/cpld_ver: No such file or directory
 Failed to open firmware version file /run/devmap/cplds/FAN1_CPLD/cpld_sub_ver: No such file or directory
 Reporting firmware version for FAN1_CPLD - version string:0.0 ODS value:0
 Failed to open firmware version file /run/devmap/cplds/FAN2_CPLD/cpld_ver: No such file or directory
 Failed to open firmware version file /run/devmap/cplds/FAN2_CPLD/cpld_sub_ver: No such file or directory
 Reporting firmware version for FAN2_CPLD - version string:0.0 ODS value:0
 Reporting firmware version for MERU800BFA_SMB_CPLD - version string:4.4 ODS value:4004
 Reporting firmware version for MERU800BFA_SMB_FPGA0 - version string:1.19 ODS value:1019
 Reporting firmware version for MERU800BFA_SMB_FPGA1 - version string:1.19 ODS value:1019
 Reporting firmware version for MERU800BFA_SMB_FPGA2 - version string:1.26 ODS value:1026
 Reporting firmware version for MERU800BFA_SMB_FPGA3 - version string:1.23 ODS value:1023
 Reporting firmware version for MERU_SCM_CPLD - version string:4.13 ODS value:4013
 Completed setting up devices with errors
 Failures in PmUnit SCM at /
 1. Failed to create i2c device for SCM_IDPROM_P1 (24c512) at bus: 3, addr: 0x50 with exit status 0
 2. Failed to create a symlink /run/devmap/eeproms/MERU_SCM_EEPROM_P1 for DevicePath /[SCM_IDPROM_P1]. Reason: SCM_IDPROM_P1 is not plugged-in to the platform
```
- sensor_service
```
========================================================
Processed 147 Sensors. 0 Failures.
Using thread manager (resource pools not enabled) on address/port 5970: runtime: thriftFlagNotSet, , thrift flag: false, enable gflag: false, disable gflag: false
Processed 147 Sensors. 0 Failures.
Processed 147 Sensors. 0 Failures.
Processed 147 Sensors. 0 Failures.
```

### Meru800BIA:
- PM initializes successfully. Some "failures" are reported but are not caused by this PR.
  - Wrong FAN CPLD firmware version path. The version files are located under hwmon directories that the check omits. Likely introduced by 77d10bc
  - Known failure logs due to SCM_IDPROM_P1
```
Failed to open firmware version file /run/devmap/cplds/FAN_CPLD/cpld_ver: No such file or directory
Failed to open firmware version file /run/devmap/cplds/FAN_CPLD/cpld_sub_ver: No such file or directory
Reporting firmware version for FAN_CPLD - version string:0.0 ODS value:0
Reporting firmware version for MERU800BIA_SMB_FPGA - version string:4.13 ODS value:4013
Reporting firmware version for MERU_SCM_CPLD - version string:4.13 ODS value:4013
Completed setting up devices with errors
Failures in PmUnit SCM at /
1. Failed to create i2c device for SCM_IDPROM_P1 (24c512) at bus: 3, addr: 0x50 with exit status 0
2. Failed to create a symlink /run/devmap/eeproms/MERU_SCM_EEPROM_P1 for DevicePath /[SCM_IDPROM_P1]. Reason: SCM_IDPROM_P1 is not plugged-in to the platform
```
- sensor_service
```
SMB_J3_BOARD_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp1_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_CORE_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp2_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_FAB0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp3_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_FAB1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp4_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_NIF0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp5_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_NIF1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp6_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_HBM0_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp7_input, Compute=@/1000.0, FRU=SMB
SMB_J3_DIODE_HBM1_TEMP: Path=/run/devmap/sensors/SMB_MAX6581/temp8_input, Compute=@/1000.0, FRU=SMB
SMB_MGMT_INLET_TEMP: Path=/run/devmap/sensors/SMB_MGMT_TMP75/temp1_input, Compute=@/1000.0, FRU=SMB
========================================================
Processed 79 Sensors. 0 Failures.
Using thread manager (resource pools not enabled) on address/port 5970: runtime: thriftFlagNotSet, , thrift flag: false, enable gflag: false, disable gflag: false
Processed 79 Sensors. 0 Failures.
Processed 79 Sensors. 0 Failures.
Processed 79 Sensors. 0 Failures.
```

Pull Request resolved: #208

Reviewed By: kimdo8736

Differential Revision: D61759564

Pulled By: joancaneus

fbshipit-source-id: 38ba3b449637e937ee5e450a9b82c57ad301c570
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.

3 participants