Read default power mode & IPS parameters from DBus
If the power mode or idle power saver parameters have never been set,
they will be read from a set of default parameters that are on DBus.
This allows individual systems to have different default settings.
Mode/IPS parameters moved from Settings to OCC.Control
Code verified on Everest hardware with multiple scenarios including
host reboots, BMC reboots, OCC resets.
Change-Id: Id02613455db7f382791ff37c7dc420dbea1e0906
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_status.cpp b/occ_status.cpp
index 0cb9b46..5abf6dd 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -39,15 +39,15 @@
lastState = 0;
// Call into Manager to let know that we have bound
- if (this->callBack)
+ if (this->managerCallBack)
{
- this->callBack(value);
+ this->managerCallBack(value);
}
}
else
{
#ifdef POWER10
- if (device.master())
+ if (pmode && device.master())
{
// Prevent mode changes
pmode->setMasterActive(false);
@@ -60,9 +60,9 @@
#endif
// Call into Manager to let know that we will unbind.
- if (this->callBack)
+ if (this->managerCallBack)
{
- this->callBack(value);
+ this->managerCallBack(value);
}
// Stop watching for errors
@@ -109,8 +109,11 @@
void Status::deviceError()
{
#ifdef POWER10
- // Prevent mode changes
- pmode->setMasterActive(false);
+ if (pmode && device.master())
+ {
+ // Prevent mode changes
+ pmode->setMasterActive(false);
+ }
#endif
// This would deem OCC inactive
@@ -204,7 +207,7 @@
#ifdef POWER10
if (OccState(state) == OccState::ACTIVE)
{
- if (device.master())
+ if (pmode && device.master())
{
// Set the master OCC on the PowerMode object
pmode->setMasterOcc(path);