diff options
author | Edward A. James <eajames@us.ibm.com> | 2017-10-25 15:50:31 -0500 |
---|---|---|
committer | Edward A. James <eajames@us.ibm.com> | 2017-11-08 16:26:31 +0000 |
commit | 5e177970328acb51d7213d137b6b47cde0451780 (patch) | |
tree | 05a01cfa389ac11c2cf13b4dda66e99c2b1f2279 /occ_status.cpp | |
parent | f4aedeb33ae82d13c59867738e396dd100d8c3df (diff) | |
download | openpower-occ-control-5e177970328acb51d7213d137b6b47cde0451780.tar.gz openpower-occ-control-5e177970328acb51d7213d137b6b47cde0451780.zip |
Add additional device bind case if occActive is out-of-sync
This happens with bmc reboot if the host is up. BMC comes back up and
initial fsi load binds the first proc occ-hwmon device. OCC controller
starts and see's its bound, so occActive goes true. FSI rescan occurs
since host is up, unloading the first proc occ-hwmon device... Now we
can't enable it again since occActive is still true.
Resolves openbmc/openbmc#2325
Change-Id: Iac838bc51d1110f502ca0c7c5da78dc5e1780c98
Signed-off-by: Edward A. James <eajames@us.ibm.com>
Diffstat (limited to 'occ_status.cpp')
-rw-r--r-- | occ_status.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/occ_status.cpp b/occ_status.cpp index 5249fbe..36520b5 100644 --- a/occ_status.cpp +++ b/occ_status.cpp @@ -38,6 +38,27 @@ bool Status::occActive(bool value) device.unBind(); } } + else if (value && !device.bound()) + { + // Existing error watch is on a dead file descriptor. + // TODO: openbmc/openbmc#2285 + // removeErrorWatch(); + + /* + * In it's constructor, Status checks Device::bound() to see if OCC is + * active or not. + * Device::bound() checks for occX-dev0 directory. + * We will lose occX-dev0 directories during FSI rescan. + * So, if we start this application (and construct Status), and then + * later do FSI rescan, we will end up with occActive = true and device + * NOT bound. Lets correct that situation here. + */ + device.bind(); + + // Add error watch again + // TODO: openbmc/openbmc#2285 + // addErrorWatch(); + } return Base::Status::occActive(value); } |