diff options
| author | Edward A. James <eajames@us.ibm.com> | 2017-11-08 16:18:57 -0600 |
|---|---|---|
| committer | Edward A. James <eajames@us.ibm.com> | 2017-12-12 15:54:57 +0000 |
| commit | 9fd2bdcab930620e67fce69dc6a9e6e11e9880b4 (patch) | |
| tree | 11ec513cef0e3cd7a8b0156f12eae9cf7cf27fc8 | |
| parent | 41470e56e5dce5d9d138fd2a136f0010571bc613 (diff) | |
| download | openpower-occ-control-9fd2bdcab930620e67fce69dc6a9e6e11e9880b4.tar.gz openpower-occ-control-9fd2bdcab930620e67fce69dc6a9e6e11e9880b4.zip | |
Re-enable OCC error watching
Driver and OCC application should now correctly report errors from the
OCC with no false positives.
Resolves openbmc/openbmc#2285
Change-Id: Ifc4668ab75f26529f071317ead6ab4f77c3a0e7c
Signed-off-by: Edward A. James <eajames@us.ibm.com>
| -rw-r--r-- | occ_manager.cpp | 17 | ||||
| -rw-r--r-- | occ_status.cpp | 23 |
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); } |

