diff options
author | Matt Spinler <spinler@us.ibm.com> | 2019-12-11 14:44:50 -0600 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2020-01-27 08:06:26 -0600 |
commit | a943b15b54861a0cb136a062eb822d0ba1362788 (patch) | |
tree | 7a3ac58ac836855b29b2851db12ae30c844127f4 /extensions/openpower-pels | |
parent | f60ac27e3ee4aa7166065db93a3fc0ae2d9481ac (diff) | |
download | phosphor-logging-a943b15b54861a0cb136a062eb822d0ba1362788.tar.gz phosphor-logging-a943b15b54861a0cb136a062eb822d0ba1362788.zip |
PEL: Logic to enqueue a PEL to send to host
Fill in the function to determine if a PEL needs to be placed on the
qeueue to be sent up to the host. It involves checking both the host
and HMC transmission states, as well as the PEL action flags field.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I9f1a9fba1b7e6dc7a167f1c7e9dfd6c40d90883f
Diffstat (limited to 'extensions/openpower-pels')
-rw-r--r-- | extensions/openpower-pels/host_notifier.cpp | 28 | ||||
-rw-r--r-- | extensions/openpower-pels/host_notifier.hpp | 5 |
2 files changed, 33 insertions, 0 deletions
diff --git a/extensions/openpower-pels/host_notifier.cpp b/extensions/openpower-pels/host_notifier.cpp index ec5db41..2956b66 100644 --- a/extensions/openpower-pels/host_notifier.cpp +++ b/extensions/openpower-pels/host_notifier.cpp @@ -76,6 +76,34 @@ bool HostNotifier::addPELToQueue(const PEL& pel) bool HostNotifier::enqueueRequired(uint32_t id) const { bool required = true; + Repository::LogID i{Repository::LogID::Pel{id}}; + + if (auto attributes = _repo.getPELAttributes(i); attributes) + { + auto a = attributes.value().get(); + + if ((a.hostState == TransmissionState::acked) || + (a.hostState == TransmissionState::badPEL)) + { + required = false; + } + else if (a.actionFlags.test(hiddenFlagBit) && + (a.hmcState == TransmissionState::acked)) + { + required = false; + } + else if (a.actionFlags.test(dontReportToHostFlagBit)) + { + required = false; + } + } + else + { + using namespace phosphor::logging; + log<level::ERR>("Host Enqueue: Unable to find PEL ID in repository", + entry("PEL_ID=0x%X", id)); + required = false; + } return required; } diff --git a/extensions/openpower-pels/host_notifier.hpp b/extensions/openpower-pels/host_notifier.hpp index ee1ba0c..19ed64d 100644 --- a/extensions/openpower-pels/host_notifier.hpp +++ b/extensions/openpower-pels/host_notifier.hpp @@ -54,6 +54,11 @@ class HostNotifier * @brief Specifies if the PEL needs to go onto the queue to be * set to the host. * + * Only returns false if: + * - Already acked by the host (or they didn't like it) + * - Hidden and the HMC already got it + * - The 'do not report to host' bit is set + * * @param[in] id - The PEL ID * * @return bool - If enqueue is required |