diff options
author | Eddie James <eajames@us.ibm.com> | 2017-12-20 10:50:03 -0600 |
---|---|---|
committer | Eddie James <eajames@us.ibm.com> | 2017-12-20 15:54:01 -0600 |
commit | dae2d940092520c839a0af00970b448ca4c36a88 (patch) | |
tree | e4d0c608addc9e68468ce0d26f1e08e17fc13a5e /occ_manager.cpp | |
parent | 9fd2bdcab930620e67fce69dc6a9e6e11e9880b4 (diff) | |
download | openpower-occ-control-dae2d940092520c839a0af00970b448ca4c36a88.tar.gz openpower-occ-control-dae2d940092520c839a0af00970b448ca4c36a88.zip |
Only add presence watching when all OCCs are bound
The OCC present count returns the number of OCCs in the system. Before
we have bound the second OCC, this will be greater than the number of
OCCs the Manager has counted as Active, resulting in a mismatch, causing
an error.
Resolves openbmc/openbmc#2733
Change-Id: Ia37a6b152fb073cf3044c601501903bcdfe9d3fe
Signed-off-by: Eddie James <eajames@us.ibm.com>
Diffstat (limited to 'occ_manager.cpp')
-rw-r--r-- | occ_manager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/occ_manager.cpp b/occ_manager.cpp index 040676b..6fd0652 100644 --- a/occ_manager.cpp +++ b/occ_manager.cpp @@ -82,6 +82,15 @@ void Manager::statusCallBack(bool status) } activeCount += status ? 1 : -1; + + // Only start presence detection if all the OCCs are bound + if (activeCount == statusObjects.size()) + { + for (auto &obj : statusObjects) + { + obj->addPresenceWatchMaster(); + } + } } #ifdef I2C_OCC |