summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--occ_manager.cpp17
-rw-r--r--occ_status.cpp23
2 files changed, 12 insertions, 28 deletions
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 67e96a6..040676b 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -82,23 +82,6 @@ void Manager::statusCallBack(bool status)
}
activeCount += status ? 1 : -1;
-
- // If all the OCCs are bound, then start error detection
- if (activeCount == statusObjects.size())
- {
- for (const auto& occ: statusObjects)
- {
- occ->addErrorWatch();
- }
- }
- else if (!status)
- {
- // If some OCCs are not bound yet, those will be a NO-OP
- for (const auto& occ: statusObjects)
- {
- occ->removeErrorWatch();
- }
- }
}
#ifdef I2C_OCC
diff --git a/occ_status.cpp b/occ_status.cpp
index 8867276..d491fe1 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -17,22 +17,25 @@ bool Status::occActive(bool value)
// Bind the device
device.bind();
+ // Start watching for errors
+ addErrorWatch();
+
// Call into Manager to let know that we have bound
- // TODO: openbmc/openbmc#2285
- /* if (this->callBack)
+ if (this->callBack)
{
this->callBack(value);
- }*/
+ }
}
else
{
// Call into Manager to let know that we will unbind.
- // Need to do this before doing un-bind since it will
- // result in slave error if Master is un-bound
- /*if (this->callBack)
+ if (this->callBack)
{
this->callBack(value);
- }*/
+ }
+
+ // Stop watching for errors
+ removeErrorWatch();
// Do the unbind.
device.unBind();
@@ -41,8 +44,7 @@ bool Status::occActive(bool value)
else if (value && !device.bound())
{
// Existing error watch is on a dead file descriptor.
- // TODO: openbmc/openbmc#2285
- // removeErrorWatch();
+ removeErrorWatch();
/*
* In it's constructor, Status checks Device::bound() to see if OCC is
@@ -56,8 +58,7 @@ bool Status::occActive(bool value)
device.bind();
// Add error watch again
- // TODO: openbmc/openbmc#2285
- // addErrorWatch();
+ addErrorWatch();
}
return Base::Status::occActive(value);
}
OpenPOWER on IntegriCloud