summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@intel.com>2019-08-19 21:07:17 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2019-09-06 03:12:31 +0300
commit7046c58ecbbaf0e2f466cafbb9fb91dfe7b6a29d (patch)
treede4a70bb609a0a2f8391bdb95c4925096fcc0a5b
parent0765f013c380af9ced4aa6c1b8556d6606735a01 (diff)
downloadprovingground-7046c58ecbbaf0e2f466cafbb9fb91dfe7b6a29d.tar.xz
Add ERR1 timeout monitoring and logging
This adds ERR1 timeout monitoring to the host error monitor. When the ERR1 signal is asserted for more than 90 seconds, the BMC will log which CPU asserted the ERR1 signal. Tested: Manually triggered an ERR1 timeout and confirmed that the event is logged correctly. Change-Id: Ibed1faea7c80fc5ce0b1d5449ec4158d63ee3e0d Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
-rw-r--r--host_error_monitor/src/host_error_monitor.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/host_error_monitor/src/host_error_monitor.cpp b/host_error_monitor/src/host_error_monitor.cpp
index b7e81f7..7522e9b 100644
--- a/host_error_monitor/src/host_error_monitor.cpp
+++ b/host_error_monitor/src/host_error_monitor.cpp
@@ -41,6 +41,8 @@ const static constexpr int crashdumpTimeoutS = 300;
static boost::asio::steady_timer caterrAssertTimer(io);
// Timer for ERR0 asserted
static boost::asio::steady_timer err0AssertTimer(io);
+// Timer for ERR1 asserted
+static boost::asio::steady_timer err1AssertTimer(io);
// Timer for ERR2 asserted
static boost::asio::steady_timer err2AssertTimer(io);
// Timer for SMI asserted
@@ -51,6 +53,8 @@ static gpiod::line caterrLine;
static boost::asio::posix::stream_descriptor caterrEvent(io);
static gpiod::line err0Line;
static boost::asio::posix::stream_descriptor err0Event(io);
+static gpiod::line err1Line;
+static boost::asio::posix::stream_descriptor err1Event(io);
static gpiod::line err2Line;
static boost::asio::posix::stream_descriptor err2Event(io);
static gpiod::line smiLine;
@@ -179,6 +183,7 @@ static std::shared_ptr<sdbusplus::bus::match::match> startHostStateMonitor()
{
caterrAssertTimer.cancel();
err0AssertTimer.cancel();
+ err1AssertTimer.cancel();
err2AssertTimer.cancel();
smiAssertTimer.cancel();
}
@@ -819,6 +824,42 @@ static void err0Handler()
});
}
+static void err1AssertHandler()
+{
+ // Handle the standard ERR1 detection and logging
+ const static constexpr int err1 = 1;
+ errXAssertHandler(err1, err1AssertTimer);
+}
+
+static void err1Handler()
+{
+ if (!hostOff)
+ {
+ gpiod::line_event gpioLineEvent = err1Line.event_read();
+
+ bool err1 = gpioLineEvent.event_type == gpiod::line_event::FALLING_EDGE;
+ if (err1)
+ {
+ err1AssertHandler();
+ }
+ else
+ {
+ err1AssertTimer.cancel();
+ }
+ }
+ err1Event.async_wait(boost::asio::posix::stream_descriptor::wait_read,
+ [](const boost::system::error_code ec) {
+ if (ec)
+ {
+ std::cerr
+ << "err1 handler error: " << ec.message()
+ << "\n";
+ return;
+ }
+ err1Handler();
+ });
+}
+
static void err2AssertHandler()
{
// Handle the standard ERR2 detection and logging
@@ -971,6 +1012,12 @@ static void initializeErrorState()
err0AssertHandler();
}
+ // Handle CPU_ERR1 if it's asserted now
+ if (err1Line.get_value() == 0)
+ {
+ err1AssertHandler();
+ }
+
// Handle CPU_ERR2 if it's asserted now
if (err2Line.get_value() == 0)
{
@@ -1026,6 +1073,14 @@ int main(int argc, char* argv[])
return -1;
}
+ // Request CPU_ERR1 GPIO events
+ if (!host_error_monitor::requestGPIOEvents(
+ "CPU_ERR1", host_error_monitor::err1Handler,
+ host_error_monitor::err1Line, host_error_monitor::err1Event))
+ {
+ return -1;
+ }
+
// Request CPU_ERR2 GPIO events
if (!host_error_monitor::requestGPIOEvents(
"CPU_ERR2", host_error_monitor::err2Handler,