blob: 2dd57eb4679a0570e5e6ba5d0648dc74c3b3ac60 [file] [log] [blame]
Andrew Geisslere426b582020-05-28 12:40:55 -05001#include "config.h"
2
3#include "chassis_state_manager.hpp"
4
5#include "xyz/openbmc_project/Common/error.hpp"
6#include "xyz/openbmc_project/State/Shutdown/Power/error.hpp"
7
Matt Spinlerbbbc0162020-11-11 14:43:50 -06008#include <fmt/format.h>
9
Andrew Geisslere426b582020-05-28 12:40:55 -050010#include <cereal/archives/json.hpp>
11#include <phosphor-logging/elog-errors.hpp>
12#include <phosphor-logging/log.hpp>
Andrew Geissler0029a5d2017-01-24 14:48:35 -060013#include <sdbusplus/bus.hpp>
William A. Kennington III09568ff2018-05-11 00:03:12 -070014#include <sdbusplus/exception.hpp>
William A. Kennington IIId998f822018-10-17 23:17:57 -070015#include <sdeventplus/event.hpp>
16#include <sdeventplus/exception.hpp>
Andrew Geisslere426b582020-05-28 12:40:55 -050017
Andrew Geisslerf2b22e82021-03-12 14:47:03 -060018#include <filesystem>
Andrew Geisslere426b582020-05-28 12:40:55 -050019#include <fstream>
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -050020
Andrew Geisslera90a31a2016-12-13 16:16:28 -060021namespace phosphor
22{
23namespace state
24{
25namespace manager
26{
27
28// When you see server:: you know we're referencing our base class
29namespace server = sdbusplus::xyz::openbmc_project::State::server;
30
31using namespace phosphor::logging;
William A. Kennington IIId998f822018-10-17 23:17:57 -070032using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
Aatir Manzur27115ae2019-07-23 16:25:38 -050033using sdbusplus::xyz::openbmc_project::State::Shutdown::Power::Error::Blackout;
Josh D. King6838ea92017-04-11 13:39:18 -050034constexpr auto CHASSIS_STATE_POWEROFF_TGT = "obmc-chassis-poweroff@0.target";
Andrew Geissler58a18012018-01-19 19:36:05 -080035constexpr auto CHASSIS_STATE_HARD_POWEROFF_TGT =
36 "obmc-chassis-hard-poweroff@0.target";
Josh D. King6838ea92017-04-11 13:39:18 -050037constexpr auto CHASSIS_STATE_POWERON_TGT = "obmc-chassis-poweron@0.target";
Andrew Geissler0029a5d2017-01-24 14:48:35 -060038
Josh D. King697474c2017-03-02 11:15:55 -060039constexpr auto ACTIVE_STATE = "active";
40constexpr auto ACTIVATING_STATE = "activating";
41
Andrew Geisslerce80f242017-01-24 13:25:33 -060042/* Map a transition to it's systemd target */
Andrew Geissler58a18012018-01-19 19:36:05 -080043const std::map<server::Chassis::Transition, std::string> SYSTEMD_TARGET_TABLE =
44 {
Andrew Geissler8cf2f9a2017-07-21 11:58:04 -050045 // Use the hard off target to ensure we shutdown immediately
46 {server::Chassis::Transition::Off, CHASSIS_STATE_HARD_POWEROFF_TGT},
Andrew Geissler58a18012018-01-19 19:36:05 -080047 {server::Chassis::Transition::On, CHASSIS_STATE_POWERON_TGT}};
Andrew Geisslerce80f242017-01-24 13:25:33 -060048
Andrew Geissler58a18012018-01-19 19:36:05 -080049constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
50constexpr auto SYSTEMD_OBJ_PATH = "/org/freedesktop/systemd1";
Andrew Geisslerce80f242017-01-24 13:25:33 -060051constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
52
Josh D. King697474c2017-03-02 11:15:55 -060053constexpr auto SYSTEMD_PROPERTY_IFACE = "org.freedesktop.DBus.Properties";
54constexpr auto SYSTEMD_INTERFACE_UNIT = "org.freedesktop.systemd1.Unit";
55
Andrew Geissler0029a5d2017-01-24 14:48:35 -060056void Chassis::subscribeToSystemdSignals()
Andrew Geissler2ec3a7e2016-12-13 22:01:28 -060057{
Andrew Geissler3a30b052019-05-14 15:54:37 -050058 try
59 {
60 auto method = this->bus.new_method_call(
61 SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH, SYSTEMD_INTERFACE, "Subscribe");
Andrew Geissler5b950272019-05-24 12:27:51 -050062 this->bus.call(method);
Andrew Geissler3a30b052019-05-14 15:54:37 -050063 }
Patrick Williams0a675212021-09-02 09:49:43 -050064 catch (const sdbusplus::exception::exception& ex)
Andrew Geissler3a30b052019-05-14 15:54:37 -050065 {
66 log<level::ERR>("Failed to subscribe to systemd signals",
67 entry("ERR=%s", ex.what()));
68 elog<InternalFailure>();
69 }
Andrew Geissler2ec3a7e2016-12-13 22:01:28 -060070
Andrew Geissler0029a5d2017-01-24 14:48:35 -060071 return;
Andrew Geissler2ec3a7e2016-12-13 22:01:28 -060072}
73
Andrew Geisslerdff50ed2016-12-13 20:39:04 -060074// TODO - Will be rewritten once sdbusplus client bindings are in place
75// and persistent storage design is in place and sdbusplus
76// has read property function
77void Chassis::determineInitialState()
78{
Patrick Williams2975e262020-05-13 18:01:09 -050079 std::variant<int> pgood = -1;
Andrew Geissler58a18012018-01-19 19:36:05 -080080 auto method = this->bus.new_method_call(
81 "org.openbmc.control.Power", "/org/openbmc/control/power0",
82 "org.freedesktop.DBus.Properties", "Get");
Andrew Geisslerdff50ed2016-12-13 20:39:04 -060083
84 method.append("org.openbmc.control.Power", "pgood");
William A. Kennington III09568ff2018-05-11 00:03:12 -070085 try
86 {
William A. Kennington III9a2f37c2018-06-28 16:18:37 -070087 auto reply = this->bus.call(method);
Anthony Wilson32c532e2018-10-25 21:56:07 -050088 reply.read(pgood);
William A. Kennington III9a2f37c2018-06-28 16:18:37 -070089
Patrick Williams37413dc2020-05-13 11:29:54 -050090 if (std::get<int>(pgood) == 1)
William A. Kennington III9a2f37c2018-06-28 16:18:37 -070091 {
92 log<level::INFO>("Initial Chassis State will be On",
93 entry("CHASSIS_CURRENT_POWER_STATE=%s",
94 convertForMessage(PowerState::On).c_str()));
95 server::Chassis::currentPowerState(PowerState::On);
96 server::Chassis::requestedPowerTransition(Transition::On);
97 return;
98 }
Matt Spinler9eab9862018-07-11 14:13:52 -050099 else
100 {
101 // The system is off. If we think it should be on then
102 // we probably lost AC while up, so set a new state
103 // change time.
104 uint64_t lastTime;
105 PowerState lastState;
106
107 if (deserializeStateChangeTime(lastTime, lastState))
108 {
109 if (lastState == PowerState::On)
110 {
Aatir Manzur27115ae2019-07-23 16:25:38 -0500111 report<Blackout>();
Matt Spinler9eab9862018-07-11 14:13:52 -0500112 setStateChangeTime();
113 }
114 }
115 }
William A. Kennington III09568ff2018-05-11 00:03:12 -0700116 }
Patrick Williams0a675212021-09-02 09:49:43 -0500117 catch (const sdbusplus::exception::exception& e)
William A. Kennington III09568ff2018-05-11 00:03:12 -0700118 {
William A. Kennington III9a2f37c2018-06-28 16:18:37 -0700119 // It's acceptable for the pgood state service to not be available
120 // since it will notify us of the pgood state when it comes up.
121 if (e.name() != nullptr &&
122 strcmp("org.freedesktop.DBus.Error.ServiceUnknown", e.name()) == 0)
123 {
124 goto fail;
125 }
Andrew Geisslerdff50ed2016-12-13 20:39:04 -0600126
William A. Kennington III9a2f37c2018-06-28 16:18:37 -0700127 // Only log for unexpected error types.
128 log<level::ERR>("Error performing call to get pgood",
129 entry("ERROR=%s", e.what()));
130 goto fail;
Andrew Geisslerdff50ed2016-12-13 20:39:04 -0600131 }
William A. Kennington III09568ff2018-05-11 00:03:12 -0700132
133fail:
134 log<level::INFO>("Initial Chassis State will be Off",
135 entry("CHASSIS_CURRENT_POWER_STATE=%s",
136 convertForMessage(PowerState::Off).c_str()));
137 server::Chassis::currentPowerState(PowerState::Off);
138 server::Chassis::requestedPowerTransition(Transition::Off);
Andrew Geisslerdff50ed2016-12-13 20:39:04 -0600139
140 return;
141}
142
Andrew Geisslerce80f242017-01-24 13:25:33 -0600143void Chassis::executeTransition(Transition tranReq)
144{
145 auto sysdTarget = SYSTEMD_TARGET_TABLE.find(tranReq)->second;
146
Andrew Geissler58a18012018-01-19 19:36:05 -0800147 auto method = this->bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH,
148 SYSTEMD_INTERFACE, "StartUnit");
Andrew Geisslerce80f242017-01-24 13:25:33 -0600149
150 method.append(sysdTarget);
151 method.append("replace");
152
153 this->bus.call_noreply(method);
154
155 return;
156}
157
Josh D. King697474c2017-03-02 11:15:55 -0600158bool Chassis::stateActive(const std::string& target)
159{
Patrick Williams2975e262020-05-13 18:01:09 -0500160 std::variant<std::string> currentState;
Josh D. King697474c2017-03-02 11:15:55 -0600161 sdbusplus::message::object_path unitTargetPath;
162
Andrew Geissler58a18012018-01-19 19:36:05 -0800163 auto method = this->bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH,
164 SYSTEMD_INTERFACE, "GetUnit");
Josh D. King697474c2017-03-02 11:15:55 -0600165
166 method.append(target);
Josh D. King697474c2017-03-02 11:15:55 -0600167
William A. Kennington III09568ff2018-05-11 00:03:12 -0700168 try
169 {
Anthony Wilson32c532e2018-10-25 21:56:07 -0500170 auto result = this->bus.call(method);
William A. Kennington III09568ff2018-05-11 00:03:12 -0700171 result.read(unitTargetPath);
172 }
Patrick Williams0a675212021-09-02 09:49:43 -0500173 catch (const sdbusplus::exception::exception& e)
William A. Kennington III09568ff2018-05-11 00:03:12 -0700174 {
Anthony Wilson32c532e2018-10-25 21:56:07 -0500175 log<level::ERR>("Error in GetUnit call", entry("ERROR=%s", e.what()));
William A. Kennington III09568ff2018-05-11 00:03:12 -0700176 return false;
177 }
Josh D. King697474c2017-03-02 11:15:55 -0600178
Andrew Geissler58a18012018-01-19 19:36:05 -0800179 method = this->bus.new_method_call(
180 SYSTEMD_SERVICE,
181 static_cast<const std::string&>(unitTargetPath).c_str(),
182 SYSTEMD_PROPERTY_IFACE, "Get");
Josh D. King697474c2017-03-02 11:15:55 -0600183
184 method.append(SYSTEMD_INTERFACE_UNIT, "ActiveState");
Josh D. King697474c2017-03-02 11:15:55 -0600185
Anthony Wilson32c532e2018-10-25 21:56:07 -0500186 try
Josh D. King697474c2017-03-02 11:15:55 -0600187 {
Anthony Wilson32c532e2018-10-25 21:56:07 -0500188 auto result = this->bus.call(method);
189 result.read(currentState);
190 }
Patrick Williams0a675212021-09-02 09:49:43 -0500191 catch (const sdbusplus::exception::exception& e)
Anthony Wilson32c532e2018-10-25 21:56:07 -0500192 {
193 log<level::ERR>("Error in ActiveState Get",
194 entry("ERROR=%s", e.what()));
Josh D. King697474c2017-03-02 11:15:55 -0600195 return false;
196 }
197
Patrick Williams37413dc2020-05-13 11:29:54 -0500198 const auto& currentStateStr = std::get<std::string>(currentState);
William A. Kennington III7a0689a2018-11-12 17:19:33 -0800199 return currentStateStr == ACTIVE_STATE ||
200 currentStateStr == ACTIVATING_STATE;
Josh D. King697474c2017-03-02 11:15:55 -0600201}
202
Patrick Williams8f8ba392017-05-05 15:47:39 -0500203int Chassis::sysStateChange(sdbusplus::message::message& msg)
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600204{
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600205 sdbusplus::message::object_path newStateObjPath;
206 std::string newStateUnit{};
207 std::string newStateResult{};
208
Andrew Geissler58a18012018-01-19 19:36:05 -0800209 // Read the msg and populate each variable
William A. Kennington III09568ff2018-05-11 00:03:12 -0700210 try
211 {
Andrew Geissler9b8af4f2019-09-12 14:19:14 -0500212 // newStateID is a throwaway that is needed in order to read the
213 // parameters that are useful out of the dbus message
214 uint32_t newStateID{};
William A. Kennington III09568ff2018-05-11 00:03:12 -0700215 msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
216 }
Patrick Williams0a675212021-09-02 09:49:43 -0500217 catch (const sdbusplus::exception::exception& e)
William A. Kennington III09568ff2018-05-11 00:03:12 -0700218 {
219 log<level::ERR>("Error in state change - bad encoding",
220 entry("ERROR=%s", e.what()),
221 entry("REPLY_SIG=%s", msg.get_signature()));
222 return 0;
223 }
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600224
Andrew Geissler58a18012018-01-19 19:36:05 -0800225 if ((newStateUnit == CHASSIS_STATE_POWEROFF_TGT) &&
226 (newStateResult == "done") && (!stateActive(CHASSIS_STATE_POWERON_TGT)))
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600227 {
Andrew Jeffery55b983e2017-04-19 11:11:26 +0930228 log<level::INFO>("Received signal that power OFF is complete");
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600229 this->currentPowerState(server::Chassis::PowerState::Off);
Matt Spinler9eab9862018-07-11 14:13:52 -0500230 this->setStateChangeTime();
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600231 }
Andrew Geissler58a18012018-01-19 19:36:05 -0800232 else if ((newStateUnit == CHASSIS_STATE_POWERON_TGT) &&
233 (newStateResult == "done") &&
234 (stateActive(CHASSIS_STATE_POWERON_TGT)))
235 {
236 log<level::INFO>("Received signal that power ON is complete");
237 this->currentPowerState(server::Chassis::PowerState::On);
Matt Spinler9eab9862018-07-11 14:13:52 -0500238 this->setStateChangeTime();
Andrew Geisslerf2b22e82021-03-12 14:47:03 -0600239
240 // Remove temporary file which is utilized for scenarios where the
241 // BMC is rebooted while the chassis power is still on.
242 // This file is used to indicate to chassis related systemd services
243 // that the chassis is already on and they should skip running.
244 // Once the chassis state is back to on we can clear this file.
245 auto size = std::snprintf(nullptr, 0, CHASSIS_ON_FILE, 0);
246 size++; // null
247 std::unique_ptr<char[]> chassisFile(new char[size]);
248 std::snprintf(chassisFile.get(), size, CHASSIS_ON_FILE, 0);
249 if (std::filesystem::exists(chassisFile.get()))
250 {
251 std::filesystem::remove(chassisFile.get());
252 }
Andrew Geissler58a18012018-01-19 19:36:05 -0800253 }
Andrew Geissler0029a5d2017-01-24 14:48:35 -0600254
255 return 0;
256}
257
Andrew Geisslera90a31a2016-12-13 16:16:28 -0600258Chassis::Transition Chassis::requestedPowerTransition(Transition value)
259{
260
Matt Spinlerbbbc0162020-11-11 14:43:50 -0600261 log<level::INFO>(fmt::format("Change to Chassis Requested Power State: {}",
262 convertForMessage(value))
263 .c_str());
Andrew Geisslerce80f242017-01-24 13:25:33 -0600264 executeTransition(value);
Andrew Geisslera90a31a2016-12-13 16:16:28 -0600265 return server::Chassis::requestedPowerTransition(value);
266}
267
268Chassis::PowerState Chassis::currentPowerState(PowerState value)
269{
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500270 PowerState chassisPowerState;
Matt Spinlerbbbc0162020-11-11 14:43:50 -0600271 log<level::INFO>(fmt::format("Change to Chassis Power State: {}",
272 convertForMessage(value))
273 .c_str());
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500274
275 chassisPowerState = server::Chassis::currentPowerState(value);
Patrick Williams45a1ed72021-04-30 21:02:43 -0500276 pohTimer.setEnabled(chassisPowerState == PowerState::On);
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500277 return chassisPowerState;
278}
279
Patrick Williams45a1ed72021-04-30 21:02:43 -0500280uint32_t Chassis::pohCounter(uint32_t value)
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500281{
Patrick Williams45a1ed72021-04-30 21:02:43 -0500282 if (value != pohCounter())
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500283 {
Patrick Williams45a1ed72021-04-30 21:02:43 -0500284 ChassisInherit::pohCounter(value);
Matt Spinler81957842018-07-11 10:37:12 -0500285 serializePOH();
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500286 }
Patrick Williams45a1ed72021-04-30 21:02:43 -0500287 return pohCounter();
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500288}
289
Patrick Williams45a1ed72021-04-30 21:02:43 -0500290void Chassis::pohCallback()
William A. Kennington IIId998f822018-10-17 23:17:57 -0700291{
292 if (ChassisInherit::currentPowerState() == PowerState::On)
293 {
Patrick Williams45a1ed72021-04-30 21:02:43 -0500294 pohCounter(pohCounter() + 1);
William A. Kennington IIId998f822018-10-17 23:17:57 -0700295 }
296}
297
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500298void Chassis::restorePOHCounter()
299{
300 uint32_t counter;
Matt Spinler81957842018-07-11 10:37:12 -0500301 if (!deserializePOH(POH_COUNTER_PERSIST_PATH, counter))
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500302 {
303 // set to default value
Patrick Williams45a1ed72021-04-30 21:02:43 -0500304 pohCounter(0);
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500305 }
306 else
307 {
Patrick Williams45a1ed72021-04-30 21:02:43 -0500308 pohCounter(counter);
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500309 }
310}
311
Matt Spinler81957842018-07-11 10:37:12 -0500312fs::path Chassis::serializePOH(const fs::path& path)
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500313{
314 std::ofstream os(path.c_str(), std::ios::binary);
315 cereal::JSONOutputArchive oarchive(os);
Patrick Williams45a1ed72021-04-30 21:02:43 -0500316 oarchive(pohCounter());
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500317 return path;
318}
319
Patrick Williams45a1ed72021-04-30 21:02:43 -0500320bool Chassis::deserializePOH(const fs::path& path, uint32_t& pohCounter)
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500321{
322 try
323 {
324 if (fs::exists(path))
325 {
326 std::ifstream is(path.c_str(), std::ios::in | std::ios::binary);
327 cereal::JSONInputArchive iarchive(is);
Patrick Williams45a1ed72021-04-30 21:02:43 -0500328 iarchive(pohCounter);
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500329 return true;
330 }
331 return false;
332 }
333 catch (cereal::Exception& e)
334 {
335 log<level::ERR>(e.what());
336 fs::remove(path);
337 return false;
338 }
339 catch (const fs::filesystem_error& e)
340 {
341 return false;
342 }
343
344 return false;
345}
346
347void Chassis::startPOHCounter()
348{
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500349 auto dir = fs::path(POH_COUNTER_PERSIST_PATH).parent_path();
350 fs::create_directories(dir);
351
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500352 try
353 {
William A. Kennington IIId998f822018-10-17 23:17:57 -0700354 auto event = sdeventplus::Event::get_default();
355 bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
356 event.loop();
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500357 }
William A. Kennington IIId998f822018-10-17 23:17:57 -0700358 catch (const sdeventplus::SdEventError& e)
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500359 {
William A. Kennington IIId998f822018-10-17 23:17:57 -0700360 log<level::ERR>("Error occurred during the sdeventplus loop",
361 entry("ERROR=%s", e.what()));
Nagaraju Goruganticb781fe2018-04-06 13:41:01 -0500362 phosphor::logging::commit<InternalFailure>();
363 }
Andrew Geisslera90a31a2016-12-13 16:16:28 -0600364}
365
Matt Spinler9eab9862018-07-11 14:13:52 -0500366void Chassis::serializeStateChangeTime()
367{
368 fs::path path{CHASSIS_STATE_CHANGE_PERSIST_PATH};
369 std::ofstream os(path.c_str(), std::ios::binary);
370 cereal::JSONOutputArchive oarchive(os);
371
372 oarchive(ChassisInherit::lastStateChangeTime(),
373 ChassisInherit::currentPowerState());
374}
375
376bool Chassis::deserializeStateChangeTime(uint64_t& time, PowerState& state)
377{
378 fs::path path{CHASSIS_STATE_CHANGE_PERSIST_PATH};
379
380 try
381 {
382 if (fs::exists(path))
383 {
384 std::ifstream is(path.c_str(), std::ios::in | std::ios::binary);
385 cereal::JSONInputArchive iarchive(is);
386 iarchive(time, state);
387 return true;
388 }
389 }
390 catch (std::exception& e)
391 {
392 log<level::ERR>(e.what());
393 fs::remove(path);
394 }
395
396 return false;
397}
398
399void Chassis::restoreChassisStateChangeTime()
400{
401 uint64_t time;
402 PowerState state;
403
404 if (!deserializeStateChangeTime(time, state))
405 {
406 ChassisInherit::lastStateChangeTime(0);
407 }
408 else
409 {
410 ChassisInherit::lastStateChangeTime(time);
411 }
412}
413
414void Chassis::setStateChangeTime()
415{
416 using namespace std::chrono;
417 uint64_t lastTime;
418 PowerState lastState;
419
420 auto now =
421 duration_cast<milliseconds>(system_clock::now().time_since_epoch())
422 .count();
423
424 // If power is on when the BMC is rebooted, this function will get called
425 // because sysStateChange() runs. Since the power state didn't change
426 // in this case, neither should the state change time, so check that
427 // the power state actually did change here.
428 if (deserializeStateChangeTime(lastTime, lastState))
429 {
430 if (lastState == ChassisInherit::currentPowerState())
431 {
432 return;
433 }
434 }
435
436 ChassisInherit::lastStateChangeTime(now);
437 serializeStateChangeTime();
438}
439
Andrew Geisslera90a31a2016-12-13 16:16:28 -0600440} // namespace manager
441} // namespace state
Andrew Geisslera965cf02018-08-31 08:37:05 -0700442} // namespace phosphor