summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-11-21 13:25:32 -0600
committerMatt Spinler <spinler@us.ibm.com>2019-12-09 13:47:57 -0600
commita3c12a48a4ca3f7f4ced6cf1d9d9cf03d05a05d5 (patch)
tree0f347678a6bf981951768459e76c1afd282ba512 /extensions/openpower-pels
parentdf43a305cf41e51e62c8ccf8dba13008dfbb1971 (diff)
downloadphosphor-logging-a3c12a48a4ca3f7f4ced6cf1d9d9cf03d05a05d5.tar.gz
phosphor-logging-a3c12a48a4ca3f7f4ced6cf1d9d9cf03d05a05d5.zip
PEL: Reset host transmission state on restart
When the Repository class starts up, if it finds any existing PELs with a host transmission state of 'sent', set it back to 'new' so that it will get sent again, as the BMC restarted or the daemon crashed before the host could ack it. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ieeca2c1a92eabc0a22051be6b87cecbe0b1d519d
Diffstat (limited to 'extensions/openpower-pels')
-rw-r--r--extensions/openpower-pels/repository.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/extensions/openpower-pels/repository.cpp b/extensions/openpower-pels/repository.cpp
index 5414458..b15fd38 100644
--- a/extensions/openpower-pels/repository.cpp
+++ b/extensions/openpower-pels/repository.cpp
@@ -58,6 +58,23 @@ void Repository::restore()
PEL pel{data};
if (pel.valid())
{
+ // If the host hasn't acked it, reset the host state so
+ // it will get sent up again.
+ if (pel.hostTransmissionState() == TransmissionState::sent)
+ {
+ pel.setHostTransmissionState(TransmissionState::newPEL);
+ try
+ {
+ write(pel, dirEntry.path());
+ }
+ catch (std::exception& e)
+ {
+ log<level::ERR>(
+ "Failed to save PEL after updating host state",
+ entry("PELID=0x%X", pel.id()));
+ }
+ }
+
PELAttributes attributes{
dirEntry.path(), pel.userHeader().actionFlags(),
pel.hostTransmissionState(), pel.hmcTransmissionState()};
OpenPOWER on IntegriCloud