[PlatformManager] Symlink creation to adapt to versioned devices#1138
[PlatformManager] Symlink creation to adapt to versioned devices#1138aalamsi22 wants to merge 1 commit into
Conversation
somasun
left a comment
There was a problem hiding this comment.
So far our versioning has been such that all symlinks work on all versions of hardware. The device which gets pointed to could differ based on the version (eg /run/devmap/sensors/A_SENSOR/temp_input could be a different i2cdevice of platform variant x compared variant y), but the symlinks exist on all versions of hardware.
According to this PR, we could end with different set of symlinks based on the version of the hardware. For example, /run/devmap/sensors/A_SENSOR/temp_input exists only on variant x, and does not exist on variant y. This breaks some assumptions. For example, fan_service of fw_util does not bother checking versions of the hardware before trying to resolve a symlink. Even if the device symlink which you plan to support based on the PR, will not be referenced from fan/sensor/fw_util or any downstream consumer, there is no guarantee that this feature will not allow creation of such device symlinks in the future. If our canary/release testing has only variant x hardware (and not variant y), we will miss such issues until it lands in production and causes issues.
I suggest retaining the exact same symlinks between all variants of any particular hardware.
Fair enough, I'm not opposed to maintaining the same symlinks. However there are a few challenges that still remain with that and they need to be addressed some other way:
The second point can be addressed by acknowledging the errors as “Expected”. The first point is challenging because it makes hwmon devices harder to reference by other services, e.g. a versioned sensor config accessing devices created by a versioned platform_manager config. We can work around this by always setting the default PMUnit as the latest revision and accept that any devices that are removed in later revisions won’t have symlinks created on older revisions. |
Summary
Depends on the following in order:
[PlatformManager] allow pciDeviceConfigs diff across versioned PmUnits #1137
[PlatformManager] allow embeddedSensorConfigs diff across versioned PmUnits #1136
[PlatformManager] pmUnitVersion support for versionedPmUnitConfigs #1065
Testing
Testing on Versioned PmUnit
When a symlink points to a device that doesn't exist at all
Matching to a versioned PmUnit
Where devices
/[DOES_NOT_EXIST_IN_DEFAULT]only exists in the versioned SCM v1.2.3/[ONLY_EXISTS_IN_DEFAULT]only exists in default SCM pmUnitAs expected, ONLY_EXISTS_IN_DEFAULT does not exist. Nor is the symlink created
And DOES_NOT_EXIST_IN_DEFAULT device and symlink are created
Without the changes in this PR, build/platform_manager crashes on
/[DOES_NOT_EXIST_IN_DEFAULT]And if
/[DOES_NOT_EXIST_IN_DEFAULT]is removed, we still get "unexpected errors" on/[ONLY_EXISTS_IN_DEFAULT]when loading default pmunit.How about loading default PmUnit? (Non-matching versioned PmUnit)
Hw & Sw Tests
platform_manager_hw_test ran against default & versioned PmUnit