summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-wht/recipes-core/host-error-monitor/host-error-monitor/0002-Add-a-workaround-for-spurious-CPU-errors.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-wht/recipes-core/host-error-monitor/host-error-monitor/0002-Add-a-workaround-for-spurious-CPU-errors.patch')
-rw-r--r--meta-openbmc-mods/meta-wht/recipes-core/host-error-monitor/host-error-monitor/0002-Add-a-workaround-for-spurious-CPU-errors.patch133
1 files changed, 133 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-wht/recipes-core/host-error-monitor/host-error-monitor/0002-Add-a-workaround-for-spurious-CPU-errors.patch b/meta-openbmc-mods/meta-wht/recipes-core/host-error-monitor/host-error-monitor/0002-Add-a-workaround-for-spurious-CPU-errors.patch
new file mode 100644
index 000000000..2a573311f
--- /dev/null
+++ b/meta-openbmc-mods/meta-wht/recipes-core/host-error-monitor/host-error-monitor/0002-Add-a-workaround-for-spurious-CPU-errors.patch
@@ -0,0 +1,133 @@
+From d0e4130b2d1e0e44efc8fd6e180487853625edd6 Mon Sep 17 00:00:00 2001
+From: "Jason M. Bills" <jason.m.bills@intel.com>
+Date: Mon, 17 Aug 2020 15:52:22 -0700
+Subject: [PATCH] Add a workaround for spurious CPU errors
+
+There is a possible issue where GPIO event interrupts are getting
+missed causing false errors to be logged.
+
+This adds a check that the host is still on and the error is still
+asserted before logging an error.
+
+Tested:
+Confirmed that a spurious SMI event was ignored correctly after
+this change.
+
+Change-Id: Id83d9d67b15dcf9035e6448086b140e5c7dab4fe
+Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
+---
+ src/host_error_monitor.cpp | 77 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 77 insertions(+)
+
+diff --git a/src/host_error_monitor.cpp b/src/host_error_monitor.cpp
+index ca089f70d..fd453ccdc 100644
+--- a/src/host_error_monitor.cpp
++++ b/src/host_error_monitor.cpp
+@@ -797,6 +797,18 @@ static void caterrAssertHandler()
+ }
+ return;
+ }
++ // Confirm that this is a real failure by checking that the host is on
++ if (hostOff)
++ {
++ return;
++ }
++ // And that the signal is still asserted
++ if (caterrLine.get_value() != 0)
++ {
++ std::cerr
++ << "CPU_CATERR not asserted after timeout. Error ignored.\n";
++ return;
++ }
+ std::cerr << "CATERR asserted for " << std::to_string(caterrTimeoutMs)
+ << " ms\n";
+ beep(beepCPUIERR);
+@@ -1270,6 +1282,48 @@ static void errXAssertHandler(const int errPin,
+ }
+ return;
+ }
++ // Confirm that this is a real failure by checking that the host is on
++ if (hostOff)
++ {
++ return;
++ }
++ // And that the signal is still asserted
++ switch (errPin)
++ {
++ case 0:
++ {
++ if (err0Line.get_value() != 0)
++ {
++ std::cerr << "CPU_ERR0 not asserted after timeout. Error "
++ "ignored.\n";
++ return;
++ }
++ break;
++ }
++ case 1:
++ {
++ if (err1Line.get_value() != 0)
++ {
++ std::cerr << "CPU_ERR1 not asserted after timeout. Error "
++ "ignored.\n";
++ return;
++ }
++ break;
++ }
++ case 2:
++ {
++ if (err2Line.get_value() != 0)
++ {
++ std::cerr << "CPU_ERR2 not asserted after timeout. Error "
++ "ignored.\n";
++ return;
++ }
++ break;
++ }
++ default:
++ std::cerr << "Invalid ERR pin asserted\n";
++ return;
++ }
+ std::cerr << "ERR" << std::to_string(errPin) << " asserted for "
+ << std::to_string(errTimeoutMs) << " ms\n";
+ if (errPinCPUs.count())
+@@ -1379,6 +1433,18 @@ static void err2AssertHandler()
+ }
+ return;
+ }
++ // Confirm that this is a real failure by checking that the host is on
++ if (hostOff)
++ {
++ return;
++ }
++ // And that the signal is still asserted
++ if (err2Line.get_value() != 0)
++ {
++ std::cerr
++ << "CPU_ERR2 not asserted after timeout. Error ignored.\n";
++ return;
++ }
+ conn->async_method_call(
+ [](boost::system::error_code ec,
+ const std::variant<bool>& property) {
+@@ -1447,6 +1513,17 @@ static void smiAssertHandler()
+ }
+ return;
+ }
++ // Confirm that this is a real failure by checking that the host is on
++ if (hostOff)
++ {
++ return;
++ }
++ // And that the signal is still asserted
++ if (smiLine.get_value() != 0)
++ {
++ std::cerr << "SMI not asserted after timeout. Error ignored.\n";
++ return;
++ }
+ std::cerr << "SMI asserted for " << std::to_string(smiTimeoutMs)
+ << " ms\n";
+ smiTimeoutLog();
+--
+2.17.1
+