751043e9 | 29-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
Use hwmonio for attribute IO
Moves disparate error handling scenarios from the method doing the IO to the call point.
Resolves openbmc/openbmc#2166
Change-Id: I3b6d2e175433dd8b2946ae60381901f2d7ca
Use hwmonio for attribute IO
Moves disparate error handling scenarios from the method doing the IO to the call point.
Resolves openbmc/openbmc#2166
Change-Id: I3b6d2e175433dd8b2946ae60381901f2d7ca1798 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
8b574a7e | 25-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
Add hwmon io wrapper class
Add a convenience class for doing hwmon attribute sysfs IO.
A convenience class is warranted given some necessary workarounds for some GCC io exception bugs, and more imp
Add hwmon io wrapper class
Add a convenience class for doing hwmon attribute sysfs IO.
A convenience class is warranted given some necessary workarounds for some GCC io exception bugs, and more importantly to remove the burden of the rest of the application checking for ENOENT in the case of a driver unbind event.
Change-Id: I73d5a9aaaac1d5546109ae18854fe5db0b5acb26 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
f3aa9aef | 25-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
mainloop: Cache devpath at startup
Currently the devpath is determined after a bus error to make a callout. Finding the path at startup is less prone to race conditions around ENOENT on driver unlo
mainloop: Cache devpath at startup
Currently the devpath is determined after a bus error to make a callout. Finding the path at startup is less prone to race conditions around ENOENT on driver unload in the event of a callout.
Change-Id: I8ce8d9f630c8b7ecc398082002aa113ab352d3cb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
431d26a5 | 25-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
sysfs: refactor findCallout
- Export findCalloutPath so other modules can use it. - Change parameter to hwmon instance path to avoid fs::canonical outside sysfs.cpp. - Check for the iio-hwm
sysfs: refactor findCallout
- Export findCalloutPath so other modules can use it. - Change parameter to hwmon instance path to avoid fs::canonical outside sysfs.cpp. - Check for the iio-hwmon driver instead of relying on DT nodes having 'iio-hwmon' in them. - For iio devices, provide a /sys/devices path rather than a DT path. - Use existing application indenting and doxygen style.
Change-Id: I16c2dc7417eb68f7cbef44243f481df8040ec1fd Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
4e24ebd6 | 28-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
sysfs: refactor findHwmon
- Invert branch logic to reduce indent levels. - Handle disappearing hwmon instances while searching.
Change-Id: I20f93003bd3fa4f849341c4cf08a0f6a29bf785a Signed-off-by:
sysfs: refactor findHwmon
- Invert branch logic to reduce indent levels. - Handle disappearing hwmon instances while searching.
Change-Id: I20f93003bd3fa4f849341c4cf08a0f6a29bf785a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
f4bf63ad | 28-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
sysfs: refactor findPhandleMatch
- Use same indenting style as the rest of the application. - Invert branch logic to reduce indent levels. - Move logic that does not depend on loop variants outsi
sysfs: refactor findPhandleMatch
- Use same indenting style as the rest of the application. - Invert branch logic to reduce indent levels. - Move logic that does not depend on loop variants outside loop. - Fix a bug where the io-channels phandle is read from the wrong file. - Remove unnecessary try/catch block around DT IOs (DT is immutable). - Export findPhandle so other modules can use it. - Document current method limitations.
Change-Id: I34c1c6731a5e2334075b2d25c6583143c2997207 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
68c43b21 | 28-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
sysfs: Removed unused headers
Also put fstream in the right place.
Change-Id: I3c199c49f6c4068f0483b923f51dc4750aa42596 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> |
f9c83c48 | 10-Aug-2017 |
Matt Spinler <spinler@us.ibm.com> |
Add configure option to control how fails behave
Different platforms have different requirements for handling hwmon sysfs access failures.
The default behavior is now that the application will term
Add configure option to control how fails behave
Different platforms have different requirements for handling hwmon sysfs access failures.
The default behavior is now that the application will terminate if a hardware read fails, and rely on systemd restarting it as a way of doing retries.
The new configure option --enable-remove-from-dbus-on-fail will cause the application to remove the property permanently from D-Bus and never try to access it again, but not fail out. This was the previous (recently added) default behavior.
Change-Id: I6367f2e3e072a2ca9a3da700d4de1b6c34b219ff Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
e49b6a03 | 27-Jul-2017 |
Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> |
Change current label to reflect the terminology used in hwmon intf
Change-Id: I5ac1a7a8647968002ad81b600293ded019977ddc Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> |
7b587377 | 01-Aug-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
msl: Add a max31785 MSL checking script
Add a script that checks the firmware revision of a max31785 hwmon device and populates the MeetsMinimumShipLevel interface of the specified inventory items.
msl: Add a max31785 MSL checking script
Add a script that checks the firmware revision of a max31785 hwmon device and populates the MeetsMinimumShipLevel interface of the specified inventory items.
Change-Id: If3dd527d2815edffd3b8b425a15617290016769b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
3b8e36e2 | 28-Jul-2017 |
Matt Spinler <spinler@us.ibm.com> |
Allow EAGAIN failures
Certain devices are known to return EAGAIN failures when read too frequently, so be tolerant of them.
On startup, the code will retry for up to a second to get a good first re
Allow EAGAIN failures
Certain devices are known to return EAGAIN failures when read too frequently, so be tolerant of them.
On startup, the code will retry for up to a second to get a good first reading, and then in the main loop the code will just stick with the current value if it fails that way.
Resolves openbmc/openbmc#2038
Change-Id: I7621aa30429c43276239982a03ec3eef02ce9c6e Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
1e6324fa | 01-Jun-2017 |
Patrick Venture <venture@google.com> |
Don't exit program on sysfs read failures.
We have an unreliable fan in one of the test systems and at present if the sysfs entry is unavailable or returns failure, then the program will exit. The
Don't exit program on sysfs read failures.
We have an unreliable fan in one of the test systems and at present if the sysfs entry is unavailable or returns failure, then the program will exit. The program could be serving many sensors, and any one failure will cause it to exit. This is true not only when initially creating the sensors, but also if any sensor read fails at run-time.
Testing: I verified the program logged the failures, which may not be ideal if there is a buggy sensor, but, I also ran it and managed to catch it where the sensor wasn't there initially and it cleanly reported only the sensors that were responsive and didn't just exit.
There is certainly a case to be made for re-scanning periodically if the sensor returns or there was a timing issue, and there is a separate bug for that. This commit means only to make the program more robust on failure.
Change-Id: I310a3e3c0e0ea86e439341a296b741ded18f46f2 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
2f370c4e | 21-Jun-2017 |
Brandon Wyman <v2cib530@us.ibm.com> |
Fix high CPU usage noted with BMP280
The call to findCallOutPath() is really only needed if we have encountered a read or write error.
Change-Id: I81136156ba3a42546a5e2cec85283a0082358853 Signed-of
Fix high CPU usage noted with BMP280
The call to findCallOutPath() is really only needed if we have encountered a read or write error.
Change-Id: I81136156ba3a42546a5e2cec85283a0082358853 Signed-off-by: Brandon Wyman <v2cib530@us.ibm.com>
show more ...
|
ac8b7c6b | 13-Jun-2017 |
Andrew Geissler <andrewg@us.ibm.com> |
Don't exit with error when hwmon dir is removed
There is a race condition between when an hwmon directory is removed and systemd halting the phosphor-hwmon application monitoring it. This code chang
Don't exit with error when hwmon dir is removed
There is a race condition between when an hwmon directory is removed and systemd halting the phosphor-hwmon application monitoring it. This code change ensures the application does not return an error in these cases.
Resolves openbmc/openbmc#1789
Change-Id: If4f032759c522aa811d4092e7a7d8ea275480e4a Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
show more ...
|
1f8a9586 | 12-Jun-2017 |
Tom Joseph <tomjoseph@in.ibm.com> |
Add a level of indirection when naming the DBUS objects
The current design ignores the itemX_label sysfs attribute, if the environment variable is populated with the MODE_itemX="label", then fetch t
Add a level of indirection when naming the DBUS objects
The current design ignores the itemX_label sysfs attribute, if the environment variable is populated with the MODE_itemX="label", then fetch the label from itemX_label file.The actual label for the dbus object is fetched from the environment variable LABEL_item<label>.
Resolves openbmc/openbmc#1633
Change-Id: I0d4baaa91073dd5db75ac62277d78ad9b3065e64 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
show more ...
|
8af8a200 | 31-May-2017 |
Brandon Wyman <v2cib530@us.ibm.com> |
Update call out algorithm for iio hwmon instance
When readSysfsWithCallout() or writeSysfsWithCallout() get run, use the instancePath to search for a call out path. For instances with an hwmon drive
Update call out algorithm for iio hwmon instance
When readSysfsWithCallout() or writeSysfsWithCallout() get run, use the instancePath to search for a call out path. For instances with an hwmon driver, the passed in path should be used. For instances with an iio driver, search for a phandle file that has a value matching to that in the io-channels file for this phosphor-hwmon instance. If an error occurs on the read or write, use that matching phandle path to create a call out path.
Resolves openbmc/openbmc#1265
Change-Id: I6390d0dfb3d67ce8a55d171ca9a3cb8f3057a8c9 Signed-off-by: Brandon Wyman <v2cib530@us.ibm.com>
show more ...
|
4eb9858d | 24-May-2017 |
Brandon Wyman <v2cib530@us.ibm.com> |
Update algorithm to find iio hwmon instance
If the hwmon instance cannot be found via the path symlink, try to find the instance via the phandle value in io-channels.
Change-Id: I20966ec465baca41c1
Update algorithm to find iio hwmon instance
If the hwmon instance cannot be found via the path symlink, try to find the instance via the phandle value in io-channels.
Change-Id: I20966ec465baca41c1122afe714c1260926eade9 Signed-off-by: Brandon Wyman <v2cib530@us.ibm.com>
show more ...
|
ab10f164 | 22-May-2017 |
Patrick Venture <venture@google.com> |
Introduce interval configuration for sensor reads.
This introduces the ability to specify in the sensor label configuration file, a specific sleep interval. The interval is in this file to allow st
Introduce interval configuration for sensor reads.
This introduces the ability to specify in the sensor label configuration file, a specific sleep interval. The interval is in this file to allow straightforward interval control over the sensors listed in that file. Sensors grouped in the same file are treated as a group and run within the same instance.
Tested: I tested setting the interval in one of four running configurations and the change was picked up in that configuration while the others ran at the default interval.
Resolves openbmc/phosphor-hwmon#5
Change-Id: Ia9e474bc446090c8ac95dc2e6bf23a4fd6ccf7b7 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
62503a4e | 23-May-2017 |
Patrick Venture <venture@google.com> |
Exit early if no sensors matched.
Previously, if it finds that there are no sensors or no matching labels it would create the bus and then spin on the interval indefinitely doing nothing but occupyi
Exit early if no sensors matched.
Previously, if it finds that there are no sensors or no matching labels it would create the bus and then spin on the interval indefinitely doing nothing but occupying precious memory. Not that this is a case that is likely to happen in real-use, but it is a reasonable edge execution case that can be easily addressed. I ran into this when trying to momentarily stop it from reading the fans while I was running timing code. I had simply commented out the fan labels, but the program ran anyway -- now it didn't read the fans, but it seemed odd that it didn't simply exit when it had nothing to do.
There is a comment about checking for new sensors in the map, but this idea isn't fully fleshed out. Therefore, in the interim, this is a perfectly reasonable execution flow modification.
Change-Id: Idd2a9568b09148ffffe1af5c00193a0f394ec6a6 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
0a8de645 | 11-May-2017 |
Matt Spinler <spinler@us.ibm.com> |
Write pwmX_enable for fans that have a fanX_target
For fans that have a fanX_target hwmon sysfs attribute, write the pwmX_enable on startup to put that fan into RPM mode, which is safe to do because
Write pwmX_enable for fans that have a fanX_target
For fans that have a fanX_target hwmon sysfs attribute, write the pwmX_enable on startup to put that fan into RPM mode, which is safe to do because this application requires that the target is written in RPMs. The write will only occur if the pwm_enable file exists.
In the future, if fans with a target need to run in pwm mode, this code will need to be updated to convert between RPM and pwm anyway and the pwm_enable value can then be different based on that.
Resolves openbmc/openbmc#1584
Change-Id: I4f6f3ac8d6651314367aaf5c51ac176220f1fba6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
05711eb0 | 15-Apr-2017 |
Marri Devender Rao <devenrao@in.ibm.com> |
Cater for change in elog create and commit interface
Change-Id: I2a3fb65781965502d705bca772ebfb11e2334af9 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com> |
4e1f30f1 | 21-Mar-2017 |
Matthew Barth <msbarth@us.ibm.com> |
Update sysfs reads
Log an error with a device callout on read failures
Change-Id: Ic9cd7ce3964e49879efd4bb19f197fd6a306773c Signed-off-by: Matthew Barth <msbarth@us.ibm.com> |
048ac87f | 09-Mar-2017 |
Matthew Barth <msbarth@us.ibm.com> |
Update hwmon fan target sysfs entries
Override the default FanSpeed.Target set implementation so when a target value is written to the FanSpeed interface it is also updated in the related fan target
Update hwmon fan target sysfs entries
Override the default FanSpeed.Target set implementation so when a target value is written to the FanSpeed interface it is also updated in the related fan target sysfs file. This sets a particular fan to the given target speed.
Resolves openbmc/openbmc#962 Resolves openbmc/phosphor-hwmon#1
Change-Id: I867811737269b3f42d2a0dc15b37782a74f147b8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
show more ...
|
bf7b7b1d | 07-Mar-2017 |
Matthew Barth <msbarth@us.ibm.com> |
Create a FanSpeedObject interface
Create the FanSpeedObject target interface when the fanx_target sysfs file exists. The "xyz.openbmc_project.Control.Target" interface is on the /xyz/openbmc_project
Create a FanSpeedObject interface
Create the FanSpeedObject target interface when the fanx_target sysfs file exists. The "xyz.openbmc_project.Control.Target" interface is on the /xyz/openbmc_project/sensors/fan_tac/fan[#] object paths.
Change-Id: Ib4a099cff17cacea501b474969f292516db212b5 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
show more ...
|
5ec68abb | 27-Mar-2017 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
Use std::filesystem when generating callout paths
Change-Id: Ia4dbe7e27368a7136d3767f105f6af78d9627c3f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> |