commit | 495aba1f384458dd91e3abf64137e6a1dd0c7d7b | [log] [tgz] |
---|---|---|
author | Patrick Williams <patrick@stwcx.xyz> | Wed Feb 07 07:23:58 2024 -0600 |
committer | Patrick Williams <patrick@stwcx.xyz> | Thu Feb 08 11:53:33 2024 -0600 |
tree | 3cbf41b35e6648ae6387895102656f97e67febe8 | |
parent | ea14f14aa4e221cc8b8e0e587351efff2ab0402c [diff] |
meson: remove Boost TS executors BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT enables the older Networking TS executors instead of the newer "Standard Executors" and is not necessary for io_uring. Remove this option to use the newer execution model. Tested: Confirmed the io_uring interfaces are still being used. ``` (gdb) bt #0 0x00007ffff7dfba47 in ?? () from /usr/lib64/liburing.so.2 #1 0x00007ffff7dfbca2 in __io_uring_get_cqe () from /usr/lib64/liburing.so.2 #2 0x000055555556dd72 in io_uring_wait_cqe_nr (ring=0x555555807c30, cqe_ptr=0x7fffffffd9f0, wait_nr=1) at /usr/include/liburing.h:1175 #3 0x000055555556df08 in io_uring_wait_cqe (ring=0x555555807c30, cqe_ptr=0x7fffffffd9f0) at /usr/include/liburing.h:1248 #4 0x000055555557ff4f in boost::asio::detail::io_uring_service::run (this=0x555555807bf0, usec=-1, ops=...) at ../subprojects/boost_1_83_0/boost/asio/detail/impl/io_uring_service.ipp:437 #5 0x000055555557e7a4 in boost::asio::detail::scheduler::do_run_one (this=0x555555806020, lock=..., this_thread=..., ec=...) at ../subprojects/boost_1_83_0/boost/asio/detail/impl/scheduler.ipp:477 #6 0x000055555557e27a in boost::asio::detail::scheduler::run (this=0x555555806020, ec=...) at ../subprojects/boost_1_83_0/boost/asio/detail/impl/scheduler.ipp:210 #7 0x0000555555581725 in boost::asio::io_context::run (this=0x7fffffffdc90) at ../subprojects/boost_1_83_0/boost/asio/impl/io_context.ipp:64 #8 0x0000555555573af0 in main () at ../src/HwmonTempMain.cpp:643 ``` Ran QEMU for Bletchley and observed HwmonTempSensor still works: ``` root@bletchley:~# busctl introspect xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/SLED1_THERM_LOCAL xyz.openbmc_project.Sensor.Value NAME TYPE SIGNATURE RESULT/VALUE FLAGS .MaxValue property d 127 emits-change .MinValue property d -128 emits-change .Unit property s "xyz.openbmc_project.Sensor.Value.Uni... emits-change .Value property d 0 emits-change writable ``` Checking strace yields lots of io_uring related calls: ``` root@bletchley:~# strace -p 960 strace: Process 960 attached io_uring_enter(4, 0, 1, IORING_ENTER_GETEVENTS, NULL, 8) = 0 clock_gettime64(CLOCK_MONOTONIC, {tv_sec=240, tv_nsec=810659232}) = 0 clock_gettime64(CLOCK_MONOTONIC, {tv_sec=240, tv_nsec=813407042}) = 0 io_uring_enter(4, 2, 0, 0, NULL, 8) = 2 clock_gettime64(CLOCK_MONOTONIC, {tv_sec=240, tv_nsec=816897328}) = 0 io_uring_enter(4, 0, 1, IORING_ENTER_GETEVENTS, NULL, 8) = 0 clock_gettime64(CLOCK_MONOTONIC, {tv_sec=240, tv_nsec=822788059}) = 0 clock_gettime64(CLOCK_MONOTONIC, {tv_sec=240, tv_nsec=824535222}) = 0 ``` Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0eb1d732a9bc3bb25e625b9f8fe3eeeaf8ae3143
dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.
runtime re-configurable from d-bus (entity-manager or the like)
isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible
async single-threaded: uses sdbusplus/asio bindings
multiple data inputs: hwmon, d-bus, direct driver access
A typical dbus-sensors object support the following dbus interfaces:
Path /xyz/openbmc_project/sensors/<type>/<sensor_name> Interfaces xyz.openbmc_project.Sensor.Value xyz.openbmc_project.Sensor.Threshold.Critical xyz.openbmc_project.Sensor.Threshold.Warning xyz.openbmc_project.State.Decorator.Availability xyz.openbmc_project.State.Decorator.OperationalStatus xyz.openbmc_project.Association.Definitions
Sensor interfaces collection are described here.
Consumer examples of these interfaces are Redfish, Phosphor-Pid-Control, IPMI SDR.
dbus-sensor daemons are reactors that dynamically create and update sensors configuration when system configuration gets updated.
Using asio timers and async calls, dbus-sensor daemons read sensor values and check thresholds periodically. PropertiesChanged signals will be broadcasted for other services to consume when value or threshold status change. OperationStatus is set to false if the sensor is determined to be faulty.
A simple sensor example can be found here.
Sensor devices are described using Exposes records in configuration file. Name and Type fields are required. Different sensor types have different fields. Refer to entity manager schema for complete list.
ADC sensors are sensors based on an Analog to Digital Converter. They are read via the Linux kernel Industrial I/O subsystem (IIO).
One of the more common use cases within OpenBMC is for reading these sensors from the ADC on the Aspeed ASTXX cards.
To utilize ADC sensors feature within OpenBMC you must first define and enable it within the kernel device tree.
When using a common OpenBMC device like the AST2600 you will find a "adc0" and "adc1" section in the aspeed-g6.dtsi file. These are disabled by default so in your system-specific dts you would enable and configure what you want with something like this:
iio-hwmon { compatible = "iio-hwmon"; io-channels = <&adc0 0>; ... } &adc0 { status = "okay"; ... }; &adc1 { status = "okay"; ... };
Note that this is not meant to be an exhaustive list on the nuances of configuring a device tree but really to point users in the general direction.
You will then create an entity-manager configuration file that is of type "ADC" A very simple example would like look this:
"Index": 0, "Name": "P12V", "PowerState": "Always", "ScaleFactor": 1.0, "Type": "ADC"
When your system is booted, a "in0_input" file will be created within the hwmon subsystem (/sys/class/hwmon/hwmonX). The adcsensor application will scan d-bus for any ADC entity-manager objects, look up their "Index" value, and try to match that with the hwmon inY_input files. When it finds a match it will create a d-bus sensor under the xyz.openbmc_project.ADCSensor service. The sensor will be periodically updated based on readings from the hwmon file.