Author: Alexander Hansen alexander.hansen@9elements.com
Other contributors: None
Created: July 22, 2024
OpenBMC must support the OCP LED Policy. Currently there are some problematic cases in which the Policy is not supported by existing services like phosphor-led-manager.
STS (blue) | FAULT (amber) | NAME |
---|---|---|
1 | 0 | "All OK" |
0 | 1 | "Module missing / fault" |
1 | 1 | LED Priority (cannot represent the fault state) |
STS | FAULT | action |
---|---|---|
0 | 0 | initial state |
1 | 0 | assert ok |
1 | 1 | assert fault |
1 | 1 | final state |
When for example both of these groups are asserted, the change in LED state will be determined by the LED priority. The result is not allowed in the state diagram in Spec.
In this trivial example we can fix it by just assigning Priority "Off" to the led-blue. But that's not possible at the time of writing (commit bdbfcde).
There are other examples with more LEDs where that alone will not fix the issue.
Here we pretend that LED Priority "Off" is allowed and discover that it will not be sufficient to fix the issue.
AC OK (blue) | FAULT (amber) | LOW V (amber) | BACK UP (amber) | State |
---|---|---|---|---|
1 | 0 | 0 | 0 | "AC OK" |
0 | 1 | 0 | 0 | "AC Fault" |
0 | 1 | 1 | 0 | "AC Under Voltage" |
0 | 0 | 0 | 1 | "Backup due to AC Outage" |
AC OK (blue) | FAULT (amber) | LOW V (amber) | BACK UP (amber) | State |
---|---|---|---|---|
0 | 0 | 0 | 1 | "Backup due to AC Outage" |
AC OK (blue) | FAULT (amber) | LOW V (amber) | BACK UP (amber) | State |
---|---|---|---|---|
0 | 0 | 0 | 1 | LED Priority (for reference) |
0 | 0 | 0 | 0 | initial state |
1 | 0 | 0 | 0 | assert "AC OK" |
0 | 0 | 0 | 0 | assert "AC Fault" |
0 | 0 | 0 | 0 | final state |
The final state is undefined according to Spec 6.4.
The different possible LED priorities do not matter here, since "Backup due to AC Outage" could very well be the highest priority state. And choosing any other LED Priority will prevent it from being applied completely when any other state is asserted simultaneously.
By now it becomes clear that what's needed is a way to define priorities in terms of groups and not single LEDs.
Quick summary of what's important for us here:
Extend the concept of "Priority" to groups in phosphor-led-manager. The group priority will be an integer value. A larger number means higher priority for that group. This allows users to have configurations like:
with locating and fault states having higher priorities. The LEDs would always be in a consistent state. The change can be done in a backwards-compatible way.
{ "leds": [ { "group": "enclosure_identify", "Priority": 2, "members": [ { "Name": "sys_id", "Action": "Blink" }, { "Name": "rear_id", "Action": "Blink" } ] }, { "group": "fault", "Priority": 1, "members": [ { "Name": "sys_id", "Action": "On" }, { "Name": "fault", "Action": "On" } ] }, { "group": "unrelated", "members": [ { "Name": "rear_id", "Action": "On" } ] } ] }
The group priority and led priority can be mutually exclusive in configuration to prevent any issues arising from mixed use. So the existing configs continue to work with individual LED Priority and when a group priority is assigned, we assume the user wants to use that for configuration.
Extend phosphor-led-sysfs to expose 2 LEDs (blue/amber) as a single LED.
Allow Priority "Off" for LED config.
Allow the mixed use of group and individual led priority
Allow each LED to configure the priority of groups it represents, instead of just one state.
Allow configuring an "indicator" that's comprised of multiple LEDs and then just define states for that indicator.
Only display the group that was last asserted, in case of conflicting groups
Need to
There should be no impact on d-bus except if we choose to expose the led group priority.
How will this be tested? How will this feature impact CI testing?
The feature can easily be unit-tested.