From f01c878ce424847b2298549aa99bfe7ad4ec2378 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Tue, 7 Nov 2017 09:33:10 -0600 Subject: Resolve power supply errors when they're replaced Add Witherspoon dbus-monitor rules to watch for power supplies to become present. When that happens, invoke the callback to resolve all errors that have that power supply as a callout. This will cause the enclosure fault LEDs to turn off when a power supply is replaced (if no other faults were also setting those LEDs.) Change-Id: I16e603d18fe3c458e1f062e12a7aa0a6a2f4300e Signed-off-by: Matt Spinler --- .../power-supply-policy.yaml | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/power/witherspoon-power-supply-policy/power-supply-policy.yaml b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/power/witherspoon-power-supply-policy/power-supply-policy.yaml index 930901565..a97f4b898 100644 --- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/power/witherspoon-power-supply-policy/power-supply-policy.yaml +++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/power/witherspoon-power-supply-policy/power-supply-policy.yaml @@ -155,3 +155,61 @@ - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH value: /xyz/openbmc_project/inventory/system/chassis/powersupply1 type: string + +- name: resolve power supply0 errors if present + description: > + 'If power supply0 is present, call the resolve ps0 errors callback.' + class: condition + condition: count + paths: power supply0 + properties: power supply present + callback: resolve power supply0 errors + countop: '>' + countbound: 0 + op: '==' + bound: true + +- name: resolve power supply1 errors if present + description: > + 'If power supply1 is present, call the resolve ps1 errors callback.' + class: condition + condition: count + paths: power supply1 + properties: power supply present + callback: resolve power supply1 errors + countop: '>' + countbound: 0 + op: '==' + bound: true + +- name: resolve power supply0 errors + class: callback + callback: resolve callout + paths: power supply0 + properties: power supply present + callout: /xyz/openbmc_project/inventory/system/chassis/powersupply0 + +- name: resolve power supply1 errors + class: callback + callback: resolve callout + paths: power supply1 + properties: power supply present + callout: /xyz/openbmc_project/inventory/system/chassis/powersupply1 + +- name: watch power supply0 present for resolving error logs + description: > + 'On supply present state changes, check if errors need to be resolved.' + class: watch + watch: property + paths: power supply0 + properties: power supply present + callback: resolve power supply0 errors if present + +- name: watch power supply1 present for resolving error logs + description: > + 'On supply present state changes, check if errors need to be resolved.' + class: watch + watch: property + paths: power supply1 + properties: power supply present + callback: resolve power supply1 errors if present -- cgit v1.2.1