61baea42 | 12-Oct-2022 |
Zev Weiss <zev@bewilderbeest.net> |
hwmontempsensor: Remove redundant emptiness check
If the paths vector is empty the for loop iterating over it won't do anything, and since there's nothing after the loop there's no need to check and
hwmontempsensor: Remove redundant emptiness check
If the paths vector is empty the for loop iterating over it won't do anything, and since there's nothing after the loop there's no need to check and return early.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I58a23919eec1c51efc2897a71f8cb38c1b8e3d0b
show more ...
|
8569bf2a | 11-Oct-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Add getPollRate helper function
This open-coded pattern had been duplicated in a few places; deduplicate and increase readability by adding a dedicated function. While we're at it, also ensure the
Add getPollRate helper function
This open-coded pattern had been duplicated in a few places; deduplicate and increase readability by adding a dedicated function. While we're at it, also ensure the configured value isn't inf or NaN.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I5f8fe788eb342ca3bf8b52bd6a2e7cc3364f45e1
show more ...
|
2c5a1f2d | 05-Oct-2022 |
JeffLin <JeffLin2@quantatw.com> |
Change EM's ObjectManager path
In newest Openbmc version, intelcpusensor will send error log: intelcpusensor[2634]: While calling GetManagedObjects on service:xyz.openbmc_project.EntityManager excep
Change EM's ObjectManager path
In newest Openbmc version, intelcpusensor will send error log: intelcpusensor[2634]: While calling GetManagedObjects on service:xyz.openbmc_project.EntityManager exception name:org.freedesktop.DBus.Error.UnknownObjectand description:Unknown object '/'. was thrown/.
After PR https://gerrit.openbmc.org/c/openbmc/entity-manager/+/57279 merged into Openbmc master, dbus path of "GetManagedObjects" is changed.
Refs: https://gerrit.openbmc.org/c/openbmc/entity-manager/+/57279 https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/57291
Tested: Check ADC, Hwmon, PSU and IntelCPU snesor works good with no GetManagedObjects error.
Signed-off-by: JeffLin <JeffLin2@quantatw.com> Change-Id: I9c4d9109377d5210fdd941efc051fa7021b40bd9
show more ...
|
9da019cc | 28-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
clang-15: fixes for boolean simplification
clang-tidy-15 is reporting the following issue:
``` ../src/ExternalSensorMain.cpp:227:17: error: boolean expression can be simplified by DeMorgan's theore
clang-15: fixes for boolean simplification
clang-tidy-15 is reporting the following issue:
``` ../src/ExternalSensorMain.cpp:227:17: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors] if (!(std::isfinite(timeoutSecs) && (timeoutSecs >= 0.0))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! || < ```
Apply automatic fix from clang-tidy.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If218521e68dd7b879d7e145bcd78a858f8778052
show more ...
|
3e620af1 | 20-Sep-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
treewide: change EM's ObjectManager path
EntityManager moves its ObjectManager in commit [1], this patch is to change accordingly. Please see [1] for why we made that change.
[1] https://gerrit.ope
treewide: change EM's ObjectManager path
EntityManager moves its ObjectManager in commit [1], this patch is to change accordingly. Please see [1] for why we made that change.
[1] https://gerrit.openbmc.org/c/openbmc/entity-manager/+/57279
Tested: code compiles. I don't have a system with this RedundancySensor enabled. But code inspection can show that only ObjectManager patch changed.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ic2437b36f3303ab3e74c579ed5a268bf5824d0d6
show more ...
|
41f49c03 | 21-Sep-2022 |
Zev Weiss <zev@bewilderbeest.net> |
DeviceMgmt: add I2CDeviceParams::deviceStatic() method
This will be used to determine whether a given i2c device is statically instantiated via a device tree or if it's a dynamically-created device
DeviceMgmt: add I2CDeviceParams::deviceStatic() method
This will be used to determine whether a given i2c device is statically instantiated via a device tree or if it's a dynamically-created device managed by userspace. As dbus-sensors daemons assume responsibility for device lifecycle management this can be used to distinguish between static and dynamic device nodes even if a previous process crashed after instantiating one (whereas a simple presence check might mistake a device that was instantiated but not cleaned up for a static device and thus never remove it).
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I3911b0cace60689766993a8be3b8f160f71de2d1
show more ...
|
3ee959ad | 21-Sep-2022 |
Zev Weiss <zev@bewilderbeest.net> |
DeviceMgmt: split I2CDeviceParams out of I2CDevice
The parameters struct now exists on its own, separately from the device struct which instantiates the kernel device in its constructor and removes
DeviceMgmt: split I2CDeviceParams out of I2CDevice
The parameters struct now exists on its own, separately from the device struct which instantiates the kernel device in its constructor and removes it in its destructor. This allows the parameters to exist standalone so that we can do things like use an instance of it to check if a device is already instantiated without attempting to do so.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Ib1c37ee26e27e59020a8e26916e697729a3661af
show more ...
|
9b4a20e9 | 06-Sep-2022 |
Ed Tanous <edtanous@google.com> |
Move to steady_timer
deadline_timer and steady_timer have one important difference, the former runs off CLOCK_REALTIME, and the later runs off CLOCK_MONOTONIC. For a long time we've relied on deadli
Move to steady_timer
deadline_timer and steady_timer have one important difference, the former runs off CLOCK_REALTIME, and the later runs off CLOCK_MONOTONIC. For a long time we've relied on deadline_timer incorrectly, given that dbus-sensors does not care in the least about the calendar time, and only cares about the difference between sensor scans.
Fortunately, this likely has no effect on the behavior of the sensors most of the time, and in general, in a time change, the clock generally moves forward, so all timers would immediately expire, scan all sensors, and move on. phosphor-pid-control is intentionally designed to handle this case, so it's quite likely that a user would never notice it, and even if they did, would have to be looking at a debug console the moment it happened.
The other effect is that in most cases, sensors call clock_gettime more than they probably need to, which might slow down the performance.
This commit moves all usages of sensor timing to steady_timer, which should give us more consistent results, and (in theory at least) be faster. Because of stdlib compliance things, this also has the effect of us dropping our dependence on boost::posix_time, and move to std::chrono::duration objects, per the coding standard.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I69f948fb3f0fc0dfd7fd196d26ba46742a3e15a7
show more ...
|
e330c0c1 | 06-Sep-2022 |
Hao Jiang <jianghao@google.com> |
FileHandle: only close on valid fd
When fd < 0, we didn't open the fd given the fd is invalid. So we won't need to close the fd as well. The current implement prints false alarm on move constructer/
FileHandle: only close on valid fd
When fd < 0, we didn't open the fd given the fd is invalid. So we won't need to close the fd as well. The current implement prints false alarm on move constructer/assignment.
Signed-off-by: Hao Jiang <jianghao@google.com> Change-Id: Ib6e0227fd1ba865ca037e8e5f8d1fc0dcc304185
show more ...
|
9c47bd7e | 26-Aug-2022 |
Justin Ledford <justinledford@google.com> |
fansensor: enable fan sensors through fanN_enable sysfs if available
The hwmon sysfs standard defines a fanN_enable file to enable or disable the sensors[0]. This change will attempt to enable the s
fansensor: enable fan sensors through fanN_enable sysfs if available
The hwmon sysfs standard defines a fanN_enable file to enable or disable the sensors[0]. This change will attempt to enable the sensors with this enable file if they are found.
Tested: with max31790 and recent patch[1] and saw that fanN_enable files were 0 before fansensor started, and 1 after fansensor started, with the appropriate entity-manager config.
[0]: https://www.kernel.org/doc/html/latest/hwmon/sysfs-interface.html#fans [1]: https://patchwork.kernel.org/project/linux-hwmon/patch/20220829195930.2521755-1-justinledford@google.com/
Signed-off-by: Justin Ledford <justinledford@google.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic56a6528d3fa468d54c03c674540179d4a56036b
show more ...
|
d29f8aa0 | 03-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
hwmontempsensor: Convert sensorTypes to I2CDeviceTypeMap
We're going to managing these devices internally soon; rather than duplicating most of the information in sensorTypes in a separate data stru
hwmontempsensor: Convert sensorTypes to I2CDeviceTypeMap
We're going to managing these devices internally soon; rather than duplicating most of the information in sensorTypes in a separate data structure we can instead use a single one that can serve both purposes.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Ic3444c93674fd485debc27207b6f086ff6c222b9
show more ...
|
dabd48dd | 03-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Add device-management infrastructure
We're moving toward having dbus-sensors take over sensor device lifecycle management from entity-manager; this code (loosely based on entity-manager's include/de
Add device-management infrastructure
We're moving toward having dbus-sensors take over sensor device lifecycle management from entity-manager; this code (loosely based on entity-manager's include/devices.hpp and src/overlay.cpp) provides some general-purpose utilities for instantiating and destroying devices.
This also includes a variant of setupPropertiesChangedMatches() taking an I2CDeviceTypeMap instead of a span of C strings, so that we can support both existing sensor daemons and ones that get converted to use that instead of the simple string arrays they currently employ.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I39fcd0de2c70cd58b4d132cdcae5f82319732dbb
show more ...
|
054aad8f | 18-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Remove Configuration interface prefix from utils APIs
This eliminates some repetitive verbosity from daemons that handle a lot of different sensor types (such as hwmontempsensor and psusensor). It
Remove Configuration interface prefix from utils APIs
This eliminates some repetitive verbosity from daemons that handle a lot of different sensor types (such as hwmontempsensor and psusensor). It also positions us to more cleanly use a single data structure for both existing APIs like GetSensorConfiguration() and setupPropertiesChangedMatches(), as well as upcoming I2C device-management support.
Tested: hwmontempsensor and adcsensor on romed8hm3 continue to behave as they did previously.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I9d80475ca4160c8d2ff0afab942709496d51238d
show more ...
|
79d8aef4 | 17-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Utils: simplify control flow in getSensorConfiguration()
The bool flag variables were only used for control flow that can be expressed much more directly; let's do that instead. (Also removing a re
Utils: simplify control flow in getSensorConfiguration()
The bool flag variables were only used for control flow that can be expressed much more directly; let's do that instead. (Also removing a redundant log message in the GetManagedObjects failure case.)
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Idb05b37dc7c7fe937f787507392554253d6b625c
show more ...
|
6c106d66 | 17-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Replace boost string predicate functions with stdlib ones
Now that we're on C++20 we no longer need boost for starts_with() and ends_with() tests.
Also remove the predicate.hpp #include from files
Replace boost string predicate functions with stdlib ones
Now that we're on C++20 we no longer need boost for starts_with() and ends_with() tests.
Also remove the predicate.hpp #include from files that weren't actually using anything from it.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Id68a019d5108a4646eb9b5fd18af33d60617e048
show more ...
|
34d7b97f | 17-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Fix copy/paste errors in sensor type interfaces
CFMSensor, IpmbSensor, and MCUTempSensor had been identifying themselves as ExitAirTemp sensors, presumably due to having been copy/pasted and incompl
Fix copy/paste errors in sensor type interfaces
CFMSensor, IpmbSensor, and MCUTempSensor had been identifying themselves as ExitAirTemp sensors, presumably due to having been copy/pasted and incompletely modified when they were first added.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Id725d2fd3d1290b60399b1832e7912cf8a690e39
show more ...
|
efae44c1 | 16-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
NVMeSensorMain: Invert condition to reduce indentation
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Ic2055203c40c09c65d1f89461ff17cb6380ed4c6 |
26fb149c | 17-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
IntelCPUSensor: Fix PropertiesChanged callback setup
Commit 214d9717c01a ("Refactor PropertiesChanged handler setup") broke IntelCPUSensor, because that commit assumed that the sensorTypes array inc
IntelCPUSensor: Fix PropertiesChanged callback setup
Commit 214d9717c01a ("Refactor PropertiesChanged handler setup") broke IntelCPUSensor, because that commit assumed that the sensorTypes array included the "xyz.openbmc_project.Configuration." prefix (as is the case in all the other daemons). Bring IntelCPUSensor into consistency with its peers by adding the prefix to sensorTypes (every place that used it was manually adding the prefix at runtime anyway).
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I4ada9b9ac94d95de8d0a3dd98ec2621049688f1f
show more ...
|
fd3d5f7e | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Utils: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Idc780ccf9ce1404aa5fde14b8ebe5e7f089f0f36 |
f783c69e | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
Thresholds: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Ie6d1aca77258595d8119db3e831c192daa49f61e |
0521a065 | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
TachSensor: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: Id86eba1da82f6522f372ac0646a8e4c07a94c899 |
741f26e8 | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
PSUSensorMain: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I55575be02660e43e98b3649c0cd00819bcb511de |
b85145cf | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
PSUEvent: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I115f48afb649d93af64725eba711e8b57a8c6dc4 |
d7c1f768 | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
MCUTempSensor: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I82be6eff9fee205a8e29c81a18eb95f356e3d52b |
8ba551bf | 12-Aug-2022 |
Zev Weiss <zev@bewilderbeest.net> |
IpmbSensor: Replace iterator pairs with structured bindings
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I240cb6736c4325428d980a2ee13d7fe5dab03338 |