summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add support for sensorName field in yamlHEADmasterAlexander Filippov2019-04-103-11/+55
| | | | | | | | | | | | | | | We want to have ability to specify the human readable names for the OCC sensors. E.g. `CPU0_OCC` instead of `occ_4_0050`. This commit allows to specify a `sensorName` field in the YAML config for each sensor, and this name will be used in the sensor object DBus path. If the field is not specified, previous behavior will be used. Tested: the command `busctl tree org.open_power.OCC.Control --list` must show specified names. Change-Id: I2f05f7bf44120554ea07b9ee0aac9cfbd33ac376 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* build: install into bin instead of sbinPatrick Venture2019-04-101-1/+1
| | | | | | | Installs into bin instead of sbin per guidelines. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I4350c46e143ff7acdbeb6fa7ae6960c14aa50ef1
* Fix error attribute naming for Linux 5.0Eddie James2019-04-098-29/+218
| | | | | | | | | | | | There was a slight change to one of the error attributes as part of the OCC driver upstreaming process. This commit also adds unit tests for the error attributes. This required some refactoring to support the unit tests. Resolves openbmc/openbmc#3505 Signed-off-by: Eddie James <eajames@us.ibm.com> Change-Id: I665b46e44b18befc8a728f7246bcda82f1f1a71c
* MAINTAINERS: Add Eddie JamesBrad Bishop2019-02-141-1/+1
| | | | | | | Eddie knows way more about this application than I do. Change-Id: Ic0fd8dea53515d890ecc0eed1c96bfffc1662342 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: pkg anti-pattern: use defaultsPatrick Venture2019-02-131-9/+5
| | | | | | | | Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing. Change-Id: Iba453ba564da46c020e9cf72d7fb6c998d9904ab Signed-off-by: Patrick Venture <venture@google.com>
* powercap: Fix std::variant usageWilliam A. Kennington III2018-11-061-2/+3
| | | | | | | | Only mapbox has the .get() member function. Use the std::get compatible function instead. Change-Id: If132312404d1a0322889d6ad7bdb6b1cb399e075 Signed-off-by: William A. Kennington III <wak@google.com>
* build: set language to C++Patrick Venture2018-10-291-0/+1
| | | | | | | Set the language in the build to C++. Change-Id: Ib580d7470be92b198e2ad98ca4b7672aa5a3d26e Signed-off-by: Patrick Venture <venture@google.com>
* clang-format: Update to match docs repoGunnar Mills2018-10-1826-1161/+1213
| | | | | | | | | | Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting Change-Id: Id6760866dedbaeafd83ea8ef2e0303e30b8955aa Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* events: Add missing memory header includeBrad Bishop2018-10-181-0/+2
| | | | | | | Include memory so we don't require a specific include ordering. Change-Id: I2f5d195b07191963cb194de100ddf3523c295b93 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* openpower-occ-control: use c++17Vernon Mauery2018-10-041-1/+1
| | | | | | | Update configure.ac to choose the c++17 standard Change-Id: I4a9a6ef0aa9631da91ffbc83b1d36c838b56cdd4 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Revert "Add Bus class to reset OCC bus driver"Eddie James2018-07-116-109/+15
| | | | | | | | | This reverts commit b5508d7a0fd9202c37cc02aea045f189e991dd09. The new SBEFIFO driver handles recovery on it's own, making this code unnecessary. Change-Id: I65dfb0ff4a67c6f7e225c6dcf68366768236f47a Signed-off-by: Eddie James <eajames@us.ibm.com>
* passthrough: only open /dev/occX during the operationEddie James2018-06-272-1/+22
| | | | | | | | The file handle was left open constantly, resulting in dead file handles when FSI is rescanned. Change-Id: I1ca8b330131eaad3e3672f5e8fbc3b994e8c34d6 Signed-off-by: Eddie James <eajames@us.ibm.com>
* tests: Quick fix for googletestWilliam A. Kennington III2018-06-271-1/+1
| | | | | | | | | | | | | | | | | The test cases need to be linked agaist not only -lgmock_main and -lgmock but also against -lgtest to pull in all of the needed symbols. Specifically the build was missing the ::testing::Test symbol. Googletest changed the way they link their libraries in the newer version. Instead of including all the objects for libgtest inside of libgmock, they have libgmock append a DT_NEEDED on libgtest. This is breaking out linking process. Since we are using googletest functionality, link against libgtest as expected. Tested: Unit tests build and pass again. Change-Id: I56be07eec7d89e0042edba35b64ce1d94f85c4b4 Signed-off-by: William A. Kennington III <wak@google.com>
* Add MAINTAINERS fileAndrew Jeffery2018-06-051-0/+45
| | | | | Change-Id: I6209893dc77bd05a3beaf0cb80cabba5f6c20fdb Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-302-3/+3
| | | | | | | | | | | Partly resolves openbmc/openbmc 2905 Also, fixed related problem with parenthesis in occ_presence.cpp. Tested: static_assert only Change-Id: Ib0dbf9c895e9f636ddc873221fd1ef93980c0353 Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Add Bus class to reset OCC bus driverEddie James2018-05-096-15/+109
| | | | | | | | | | | | | | | | | | | | For some systems, the OCC is accessed over the SBEFIFO, acting as a bus. If the SBE experiences a failure, the SBEFIFO driver is unable to recover. Therefore, the OCC control application must force a reset of the SBEFIFO driver when the OCC goes active. Add a Bus class and reset method to unbind and bind the appropriate SBEFIFO devices when the OCC devices are bound. Testing: Powered on the system successfully. Injected SBE error through a putscom. Without this fix, I intermittently saw SBEFIFO errors on the BMC after the injection. With the fix, I saw no errors despite ~20 iterations. Resolves openbmc/openbmc#3156 Change-Id: I0f9a230c57d0a3a7b59a874f62cdb1d93c6dcdfb Signed-off-by: Eddie James <eajames@us.ibm.com>
* Spelling fixesGunnar Mills2018-04-082-2/+2
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Ia7364df04fb1f1842d07b41da23a6fc7c7bd6b3c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Change occ-hwmon device namesEddie James2018-03-193-9/+5
| | | | | | | Device names changed in 4.13, so update them here. Change-Id: Ieb92f55499f3577dbfd737ea870a69dd4f351bc2 Signed-off-by: Eddie James <eajames@us.ibm.com>
* Retry OCC read operationsAndrew Geissler2018-01-241-13/+26
| | | | | | | | | | | OCC communication can get intermittent failures. Retry all reads 3 times before declaring a failure and exiting out of the openpower-occ-control application. Resolves openbmc/openbmc#2805 Change-Id: I34dca5bc3c19a1f88975b427bdb6a683b41dbcb7 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Modify default value for configure option "install_error_yaml"Marri Devender Rao2018-01-171-1/+1
| | | | | | | | | | | Modified default value for install_error_yaml configure option to "No" As the option is set to "yes" during build it is not finding packages that are required for target build. Change-Id: I0813bf2c59ecfb63bcb0da3c4a55cc51f378d553 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Install error yaml files to shared locationMarri Devender Rao2018-01-162-51/+68
| | | | | Change-Id: Id7ffc23fbea28f303521bb04faaaa13b931a3e09 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Only add presence watching when all OCCs are boundEddie James2017-12-203-5/+24
| | | | | | | | | | | | 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>
* Re-enable OCC error watchingEdward A. James2017-12-122-28/+12
| | | | | | | | | | 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>
* Powercap: add p8 supportLei YU2017-12-126-7/+55
| | | | | | | | | | P8 uses i2c-occ and powercap is not created. Add P8 support by creating powercap object with i2c device name. Fixes openbmc/openbmc#2688 Change-Id: Ia63070d63f4392cc4b084ab628cdbdcf4206c883 Signed-off-by: Lei YU <mine260309@gmail.com>
* Add watches for throttling reported by the OCCEddie James2017-12-128-24/+95
| | | | | | | | | | | Add Error objects to watch the sysfs entries provided by the OCC hwmon driver that report various types of throttling. Also needed to add a boolean input to the Error callback interface. Resolves openbmc/openbmc#1821 Change-Id: I4425770a92ace0f73024b3dc4c577ce46957a62a Signed-off-by: Eddie James <eajames@us.ibm.com>
* Create OCC objects on app startupDeepak Kodihalli2017-12-041-19/+3
| | | | | | | | | | | | | | | | | | Previously OCC objects would be created either in response (D-Bus signals) to CPU inventory objects being created, or if the CPU objects were already present when the openpower-occ-control app starts. We've had few issues where it has seemed like the OCC objects never got created, or did not get created in time; the CPU objects were created though. This is suggestive of either a race, or the D-Bus signal being missed altogether. Simplify by creating OCC objects when the app starts (we know how many OCC objects to create based on system specific config), instead of doing it reactively. The OCC objects will be marked active only when we're sent a sensor from the host asking to do so. That's not changing. Change-Id: I782ea4f120292542e3c7b32b1e0acfa8efb5e8e6 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add OCC present count detection and watchEdward A. James2017-11-1711-25/+190
| | | | | | | | | | | | | | | | Add a Presence child class of Error to handle detecting the number of OCCs available. Add an instance of this Presence class if the Device detects that it is the master OCC, since the number of present OCCs is only reported by the master OCC. When a change to the number of OCCs reported is detected, compare with the number of OCCs determined to be active by the Manager, and if there is a mismatch, follow the usual error path (reset OCC, etc). Partially resolves openbmc/openbmc#2285 See https://gerrit.openbmc-project.xyz/#/c/7843/ Change-Id: Idbaca52b307992d9b01fe15439ab746ef6d64397 Signed-off-by: Edward A. James <eajames@us.ibm.com>
* Add additional device bind case if occActive is out-of-syncEdward A. James2017-11-081-0/+21
| | | | | | | | | | | | | 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>
* Update Journal Variable NamesGunnar Mills2017-11-031-1/+1
| | | | | | | | Journal entry variable names should be uppercase. https://www.freedesktop.org/software/systemd/man/sd_journal_print.html Change-Id: I73f88faec688e2e95a5bad5f974306b005128504 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Spelling fixes in configure.acGunnar Mills2017-10-311-1/+1
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Ie5e9c8d7452af232c939ad7716b707bfe19b3c1e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add occ_ prefix for i2c occ dbus objectsLei YU2017-10-264-6/+22
| | | | | | | | | | | | | | I2c occ dbus objects path were their i2c addresses, e.g. 3_0050. This does not indicate it's occ objects, and it does not work with op-occ-disable/enable services, which searches "occ" key words in object path. So add "occ_" prefix for i2c occ dbus objects, e.g. occ_3_0050, to indicate it's occ objects and work well with op-occ-disable/enable services. Change-Id: I21712f2fb7cf6138248f6986b84f99c90c3fa3a2 Signed-off-by: Lei YU <mine260309@gmail.com>
* Always watch for CPU inventory creationDeepak Kodihalli2017-10-251-15/+13
| | | | | | | | | | | | | | | | | | Previously the app would watch for CPU inventory being created (in order to create OCC objects) only if no CPU inventory existed when the app starts. This logic breaks when some of the CPUs exist out of the max possible, because we would never watch for those missing CPU objects being potentially created in the next boot. Instead, always watch for CPU inventory being created via the d-bus InterfacesAdded signal. This is safe in case a persisted CPU object existed in the inventory, because the signal would not fire on that object. Resolves openbmc/openbmc#2515. Change-Id: I0b7ae84d98cd05fe355d4ff56ebaa14da3a3098a Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Check only CPU presence before reconstructing OCCsDeepak Kodihalli2017-10-251-6/+1
| | | | | | | | | | | | | | | | OCC d-bus objects are typically created in response to the CPU inventory being created. At this point of time we just know the CPU is present. It may not be functional. Of course if the CPU is not functional, then the host may or may not choose to set the OCC active, but the OCC object must have been created in response to a present CPU. This commit employs the same logic for reconstructing OCC objects when the OCC app restarts. Previously an OCC object would be created only if corresponding CPU is present and functional. Instead, check only for presence. Change-Id: I4f85a644237b5b5aa7dc3e52d266375b786a8c0a Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Split occ_manager.hpp into header and source filesVishwanatha Subbanna2017-09-263-124/+158
| | | | | | | | occ_manager.hpp is growing and hence this commit splits into header and source files Change-Id: I3203520c50910d39055fea98b770de55796bb074 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Set OccActive property on application startVishwanatha Subbanna2017-09-263-3/+24
| | | | | | | | | | | | | | | | | | | | | Host sends OCC active status command just once as part of power on operation and when that is sent, occ control application binds the device. As part of bind, a sysfs file gets created that would be used to communicate the occ error status back to user. If occ control application terminates and restarts, then it needs some way to set OccActive property and this commit adds that support. Solution is to check if the device is already bound by checking the presence of the OCC_HWMON_PATH/occ<number>-dev0 and set the property if found Fixes openbmc/openbmc#2238 Change-Id: I920b52e3970cc91af50b5bc68ead44c66eab8944 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Disable OCC error monitoringVishwanatha Subbanna2017-09-131-4/+5
| | | | | | | This is a quick hack until openbmc/openbmc#2285 is resolved Change-Id: I2cb5f61a258bdfe014df63a0b44e444e13d366a9 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Remove hub FSI scan which was part of OCC bindVishwanatha Subbanna2017-09-023-38/+0
| | | | | | | | Scanning hub FSI is now moved to a service file since it's needed prior to power on and hence this change is not needed. Change-Id: If2d0d8f5c7e1b405d6e858e0f2da8fc7b505cd86 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Seek to file offset 0 after reading error fileVishwanatha Subbanna2017-09-021-1/+14
| | | | | | | | | | | | | | | | For a fd watching for data in sysfs file, a poll would return immediately after read unless file is closed and re-opened OR stream is seeked to 0. This commit chooses latter. From stackoverflow: Once poll/select indicates that the value has changed, you need to close and re-open the file, or seek to 0 and read again. Also, use EPOLLPRI | EPOLLERR than EPOLLIN as needed by sysfs_inotify Change-Id: I243cdfd9a09c567eac5e52abd9980ebf90b94f89 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Change signature of getServiceVishwanatha Subbanna2017-09-012-5/+5
| | | | | | | | | | | | | getService() has [bus, interface, path] as parameter and the caller invoked it with [bus, path, interface] and that resulted in a failure. Although the fix can be put into the caller to pass the right arguments, better fix would be to change the signature of getService() to receive path and then the interface as that is what has been followed all over and the deviation resulted in this bug. Change-Id: I3efe7f4f0a2d0bceb7e6e801cd68de6b2624fbe0 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add unit tests for utils and refactor MakefilesLei YU2017-08-284-28/+196
| | | | | | | | | | | 1. Add unit tests for utils; 2. Put the common code shared by app and utest into a library, and link the library to app and utest. This eliminates the duplicated compiled objects. 3. Update .gitignore Change-Id: I05ee93c2b23748a1e038eeec3534d49b94911366 Signed-off-by: Lei YU <mine260309@gmail.com>
* Add I2C OCC support for P8 systemsLei YU2017-08-288-4/+211
| | | | | | | | | | | | | | P8 system uses I2C OCC and it uses different driver for occ-hwmon. Add `--enable-i2c-occ` configure option to enable the support. It searches i2c device names in sysfs to get all occ-hwmon devices and use the i2c device name to bind/unbind the driver. The occ control object path for I2C OCC hwmon becomes something like /org/open_power/control/3_0050, where 3_0050 is the i2c address. Change-Id: I8b9d8d4429c563528dc88fb2679b265c53d7a2d5 Signed-off-by: Lei YU <mine260309@gmail.com>
* Only consider CPUs that are Present and FunctionalVishwanatha Subbanna2017-08-233-9/+123
| | | | | | | | | | | | | | | OCC control application looks at CPU inventory and creates D-Bus objects. In some of the cases, hostboot marks the CPU as Not Present but also marks Functional and this results in creating an OCC object for the CPU which is not present. Need to filter CPUs based on Present and Functional properties to address the issue and this commit adds that support. Fixes openbmc/openbmc#2024 Change-Id: I58a06bfd09131bc3deba8f132547095c53bde5e1 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Remove creating sdbusplus handler in occ_finderVishwanatha Subbanna2017-08-233-4/+6
| | | | | | | | | | occ finder was creating a separate sdbusplus handler to access the Inventory instead of using the one which is already available. This commit will enforce using the bus which is already created. Change-Id: Ic256f185b67c661ba551139d5e057eee3ac67c7e Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Enable OCC error monitoringVishwanatha Subbanna2017-08-235-25/+118
| | | | | | | Fixes openbmc/openbmc#2165 Change-Id: I93f317a32c910f279003fa0fce6ae2d597f90312 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Reset hub scan variable when OCC goes inactiveAndrew Geissler2017-08-161-0/+3
| | | | | | | | | | Need to re-scan the second processors hub chip on every boot of the system Resolves openbmc/openbmc#2161 Change-Id: I089140333462d83f66a0ad207fecb679cba79210 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Delay opening OCC device until bindVishwanatha Subbanna2017-08-113-18/+80
| | | | | | | Fixes openbmc/openbmc#2118 Change-Id: If9e2610fe7443daa2196b0e5989f81bc544266b2 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Call Hub FSI scan service prior to doing OCC bindVishwanatha Subbanna2017-08-113-2/+41
| | | | | | | | | | This is needed to make sure that the /dev/occ files are created that are needed to communicate with OCC device. Also, calling to this service is needed only when the first call to do OCC bind is received. Change-Id: I40466b8b74753b2f2366be385a8b066e912b32e4 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Reset OCC on error conditionVishwanatha Subbanna2017-08-026-3/+182
| | | | | | | | | | After detecting the error in the OCC, invokes OccReset command in Host Control dbus object with the sensor ID of the failing OCC Fixes openbmc/openbmc#1363 Change-Id: I608dbbb943d3b39d0709d6f350ab799e771a13e9 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Use generated occ to sensor ID mapVishwanatha Subbanna2017-08-027-2/+108
| | | | | Change-Id: I948cc33ef05c2c49353277f4d5df958012a9801f Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Reconstruct OCC objects on app restartDeepak Kodihalli2017-08-015-18/+151
| | | | | | | | | | | | | The OCC objects would get created when corresponding CPU inventory items get added. This doesn't cover a scenario where the OCC app restarts. If the CPU inventory is already present when the app starts, construct OCC objects as well. Resolves openbmc/openbmc#1824. Change-Id: I4994d93ba6f528ca67977604ccb1da717563092a Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
OpenPOWER on IntegriCloud