History log of /openbmc/phosphor-host-ipmid/sensorhandler.cpp (Results 1 – 25 of 137)
Revision Date Author Comments
# a6fb32d8 15-Dec-2024 Jayanth Othayoth <ojayanth@gmail.com>

clang-tidy: Replace NULL with nullptr

Replaced all instances of NULL with nullptr to improve type safety
and clarity, as nullptr is the modern C++ standard for null pointers.

Tested: Build verified

clang-tidy: Replace NULL with nullptr

Replaced all instances of NULL with nullptr to improve type safety
and clarity, as nullptr is the modern C++ standard for null pointers.

Tested: Build verified

Change-Id: Ia40d9435ab57651ec6d13d5408cf69130043fa79
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>

show more ...


# 69b4c281 03-Mar-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: Ic23653be3ed404980fd0e723d9ed8354e2b32579
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: Ic23653be3ed404980fd0e723d9ed8354e2b32579
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 5087b075 11-Mar-2025 George Liu <liuxiwei@ieisystem.com>

Update the registered IPMI method name

Update registered IPMI method names to use `Lower Camel Case`.

Change-Id: I5539771c4ba8567f6cdb22aa3c8df58db5e883f2
Signed-off-by: George Liu <liuxiwei@ieisys

Update the registered IPMI method name

Update registered IPMI method names to use `Lower Camel Case`.

Change-Id: I5539771c4ba8567f6cdb22aa3c8df58db5e883f2
Signed-off-by: George Liu <liuxiwei@ieisystem.com>

show more ...


# f7452cb6 05-Dec-2024 George Liu <liuxiwei@ieisystem.com>

sensorhandler: remove IPMI_CMD command

The IPMI_CMD declared in sensorhandler.hpp is redundant because these
commands are already declared in api-types.hpp, so this commit
removes all IPMI_CMD in se

sensorhandler: remove IPMI_CMD command

The IPMI_CMD declared in sensorhandler.hpp is redundant because these
commands are already declared in api-types.hpp, so this commit
removes all IPMI_CMD in sensorhandler.hpp.

Change-Id: Idc3586d82f3d9905c5ae214e652724ca6425aae7
Signed-off-by: George Liu <liuxiwei@ieisystem.com>

show more ...


# 402024a8 16-Jul-2024 George Liu <liuxiwei@ieisystem.com>

sensorhandler: Support NonRecoverable in getSensorThresholds method

There are actually three types of threshold interfaces (Warning,
Critical, and NonRecoverable). This patch supports the NonRecover

sensorhandler: Support NonRecoverable in getSensorThresholds method

There are actually three types of threshold interfaces (Warning,
Critical, and NonRecoverable). This patch supports the NonRecoverable
interface in the getSensorThresholds method.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Ie9a7ff44b4e58702c5522a308d8128fcfb1161ef

show more ...


# 7a34a6ca 12-Sep-2024 George Liu <liuxiwei@ieisystem.com>

sensorhandler: Fix failed to obtain sensor threshold

If the getSensorThresholds method is called and the threshold fails
to be obtained, resp should not be updated to sensorThresholdMap,
otherwise t

sensorhandler: Fix failed to obtain sensor threshold

If the getSensorThresholds method is called and the threshold fails
to be obtained, resp should not be updated to sensorThresholdMap,
otherwise this sensor will never be able to obtain the threshold.

This commit intends to update resp to sensorThresholdMap only when
the getSensorThresholds method is successfully called.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Ia944879f0c19f744ae9b2be3aa7f4c7f73c3e5bb

show more ...


# 1318a5ed 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I01547e98d27910919e09ebf7907c86292a6c825d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 3b1071ad 17-Jul-2024 George Liu <liuxiwei@ieisystem.com>

convert sensorhandler.cpp to use lg2

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I874e162180d4deb56c710ae7a95ed5bb057a7485


# a008871d 29-Jan-2024 George Liu <liuxiwei@ieisystem.com>

Remove the mapper_get_service method

Since `mapper_get_service` is a tool and may need to be refactored
in the future [1], this patch is to delete the use of
`mapper_get_service` and use the GetObje

Remove the mapper_get_service method

Since `mapper_get_service` is a tool and may need to be refactored
in the future [1], this patch is to delete the use of
`mapper_get_service` and use the GetObject method on the server side
instead.

[1] https://gerrit.openbmc.org/c/openbmc/phosphor-objmgr/+/68965

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Ia365ab4aa359ab5f9a2850ed305b9088d4f485fb

show more ...


# 68d9d405 09-Nov-2023 Matt Simmering <matthew.simmering@intel.com>

Update terminology used within repo

Update the terms to more inclusive language. This change if only for
variables used in the repo.

Change-Id: I5151c9c2efab707b5dbc707e55333a3cb8c4e32b
Signed-off-

Update terminology used within repo

Update the terms to more inclusive language. This change if only for
variables used in the repo.

Change-Id: I5151c9c2efab707b5dbc707e55333a3cb8c4e32b
Signed-off-by: Matt Simmering <matthew.simmering@intel.com>

show more ...


# 369824e7 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Ic5fd073faa7391d3f0b37787d6a9c7688c9a3253
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 523e2d1b 05-Sep-2023 Willy Tu <wltu@google.com>

ipmid: Update sdbuspp namespaces

Fixed all errors when we remove
`SDBUSPP_REMOVE_DEPRECATED_NAMESPACE` in sdbusplus.

Change-Id: I5607585b2709faa7aee347d26e458ef769ca1626
Signed-off-by: Willy Tu <wl

ipmid: Update sdbuspp namespaces

Fixed all errors when we remove
`SDBUSPP_REMOVE_DEPRECATED_NAMESPACE` in sdbusplus.

Change-Id: I5607585b2709faa7aee347d26e458ef769ca1626
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# 64b7621c 11-Aug-2022 Wang Xiaohua <wangxiaohua.1217@bytedance.com>

sensorhandler: Get sensor type and event type from yaml-generated

Get the sensor type and event type from the yaml-generated cpp

Tested:
```
<1>. Verify the voltage sensor, the return value should

sensorhandler: Get sensor type and event type from yaml-generated

Get the sensor type and event type from the yaml-generated cpp

Tested:
```
<1>. Verify the voltage sensor, the return value should
be "02 01"
ipmitool raw 0x04 0x2f 0xa0
02 01

<2>. Verfity the temp sensor, the return value should
be "01 01"
ipmitool raw 0x04 0x2f 0x01
01 01

<3>. Verify the power sensor, the return value should
be "0b 01"
ipmitool raw 0x04 0x2f 0xe6
0b 01

<4>. verify the SYS_FAN_Status sensor, the return value
should be "04 07"
ipmitool raw 0x04 0x2f 0xda
04 07

```

Signed-off-by: Wang Xiaohua <wangxiaohua.1217@bytedance.com>
Change-Id: I24771d0f7ff2b6cd0f3d91521a640125d5d0ff0a

show more ...


# 9cf0838a 28-Apr-2023 Vernon Mauery <vernon.mauery@linux.intel.com>

move entity_map_json to libipmid

entity_map_json is used by dbus-sdr sensor handling so it needs to be in
a common location or loading order matters. This change moves the file
from the ipmi20 provi

move entity_map_json to libipmid

entity_map_json is used by dbus-sdr sensor handling so it needs to be in
a common location or loading order matters. This change moves the file
from the ipmi20 provider library to libipmi, a common library.

Tested: Found that even though the dbus-sdr provider loads before
ipmi20, it loads properly without missing symbols.

Change-Id: I9ab6833c78e6f3c89c02cf998ce0a36353059c3d
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# fbc6c9d7 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I44441096113929ce96eb1439e2932e6ff3c87f27
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 51136984 18-Aug-2022 Paul Fertser <fercerpav@gmail.com>

Specify "8-bit ASCII + Latin 1" SDR encoding

Applications using OpenSolaris libipmi can't handle "Unicode" (type 0)
encoding for the sensor names [0].

This results in issues with VMWare ESXi which

Specify "8-bit ASCII + Latin 1" SDR encoding

Applications using OpenSolaris libipmi can't handle "Unicode" (type 0)
encoding for the sensor names [0].

This results in issues with VMWare ESXi which uses IPMI to fetch sensor
data from the BMC, all the names are shown as "Unspecified 1" (if
default EntityId is used), so status page, SEL entries and the logs
become very confusing.

Fix this by telling it to process all bytes as is by using "8-bit ASCII
+ Latin 1" type.

The patch is untested however similar changes to intel-ipmi-oem were
tried with VMWare ESXi 7.0 Update 2 and regular ipmitool (using GNU
FreeIPMI), both show names correctly.

[0] https://github.com/kofemann/opensolaris/blob/master/usr/src/lib/libipmi/common/ipmi_util.c#L258

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Idf19833e4877af1acb32f016e85e93c6f58df27e

show more ...


# 9154caab 02-Dec-2021 Willy Tu <wltu@google.com>

sensordatahandler: clamp the values instead of removing the sensor

Clamping the sensor values to prevent sensors from going missing.

Based on
https://github.com/openbmc/phosphor-host-ipmid/blob/5aa

sensordatahandler: clamp the values instead of removing the sensor

Clamping the sensor values to prevent sensors from going missing.

Based on
https://github.com/openbmc/phosphor-host-ipmid/blob/5aae092cab08279d45c7914c466314b356164b7c/dbus-sdr/sensorutils.cpp#L258-L304

Clamping the threshold value to correct the result of negative threshold
value.

Tested:
Set 'sensorUnits1: 0x80' in config for sensor cpu0_abcd_cur which has
low threshold -1 and high threshold 7.6.
Before:
~# ipmitool sensor | grep cpu0_abcd_cur
cpu0_abcd_cur | 0.022 | Amps | ok | na | 4.020 | 4.020 | 7.587 | 7.587 | na
After:
~# ipmitool sensor | grep cpu0_abcd_cur
cpu0_abcd_cur | -0.135 | Amps | ok | na | -0.998 | -0.998 | 7.587 | 7.587 | na

Change-Id: Ie5af79ccbe8ab9660755f1c9d281e49a08d01309
Signed-off-by: Willy Tu <wltu@google.com>
Signed-off-by: JeffLin <JeffLin2@quantatw.com>
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# 92079a24 07-Oct-2022 Hieu Huynh <hieuh@os.amperecomputing.com>

Fix wrong threshold report

For the sensor that does not support the threshold values such as
WarningLow, WarningHigh, CriticalLow, CriticalHigh.
These value should be 'na'.

Tested:
1. Get sensor in

Fix wrong threshold report

For the sensor that does not support the threshold values such as
WarningLow, WarningHigh, CriticalLow, CriticalHigh.
These value should be 'na'.

Tested:
1. Get sensor info via ipmi command
ipmitool sensor get S1_SOC_Temp
...
Lower Non-Recoverable : na
Lower Critical : na
Lower Non-Critical : na
Upper Non-Critical : na
Upper Critical : 105.000
....

Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: Ia366a906300c289ea94110b87fff92bca7e2b865

show more ...


# fefb5855 22-Sep-2022 Thang Tran <thuutran@amperecomputing.com>

replace static converting with rounding

Issue: When the users request to get the sensor thresholds via "ipmitool
sensor get <sensor_name>" command, sometimes the value is not correct.
E.g: The real

replace static converting with rounding

Issue: When the users request to get the sensor thresholds via "ipmitool
sensor get <sensor_name>" command, sometimes the value is not correct.
E.g: The real sensor threshold is 2.01, the "scale" = 0, "exponentR"=-3,
"coefficientM" = 10. After calculating, the ipmid should return 201 to
ipmitool, but the actual return value is 200. Ipmitool displays the
value of the threshold is 2.00.

Root cause: The "float point" can not present exactly the "double" value
in somecase. Therefore, after calculating, the value of sensor
thresholds is incorrect when convert from double to uint8_t.

Solution: Replace static converting with rounding.

Tested:
1. Check the result of the threshold whose value is 2.01
ipmitool sensor get <2.01_Sensor_name>
2. The threshold value is 2.01

Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
Change-Id: I7f3e72640beb76eda9370f60e32f42d2b2c1fbda

show more ...


# 4a105cd6 05-Aug-2022 Jian Zhang <zhangjian.3032@bytedance.com>

Optimize sensorsOwnerMatch init

`sensorsOwnerMatch` should init once, not every time a sensor is added.

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Change-Id: I3a610d73bd732e7a019a4f53

Optimize sensorsOwnerMatch init

`sensorsOwnerMatch` should init once, not every time a sensor is added.

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Change-Id: I3a610d73bd732e7a019a4f53b40eac7df4fb256b

show more ...


# 5d82f474 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibd2a0b512bfb7caf65bfab64b271d194da520aac

show more ...


# 11d68897 20-Jan-2022 Willy Tu <wltu@google.com>

cleanup: Remove all warning errors for the Meson build support

Remove all the build warning to prepare for the meson build.
Meson build will be in
https://gerrit.openbmc-project.xyz/c/openbmc/phosph

cleanup: Remove all warning errors for the Meson build support

Remove all the build warning to prepare for the meson build.
Meson build will be in
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/47748

Tested:
Ipmi command works fine the cleanup.
```
$ systemctl status phosphor-ipmi-host
● phosphor-ipmi-host.service - Phosphor Inband IPMI
Loaded: loaded (/lib/systemd/system/phosphor-ipmi-host.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 1970-01-08 21:20:56 UTC; 21s ago
Main PID: 24987 (ipmid)
CGroup: /system.slice/phosphor-ipmi-host.service
└─24987 /tmp/ipmid

Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X30] for Ethstats Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X30] for Ethstats Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X32] for Sys Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X02] for I2C
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X02] for I2C
Jan 08 21:20:56 $HOST ipmid[24987]: I2C_WHITELIST_CHECK is disabled, do not populate whitelist
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X04] for Manual Zone Control
Jan 08 21:20:56 $HOST systemd[1]: Started Phosphor Inband IPMI.
Jan 08 21:20:56 $HOST ipmid[24987]: Loading whitelist filter
Jan 08 21:20:56 $HOST ipmid[24987]: Set restrictedMode = true
(reverse-i-search)`ipmi': systemctl status phosphor-^Cmi-host

$ ipmitool mc info
Device ID : 32
Device Revision : 1
Firmware Revision : 0.00
IPMI Version : 2.0
Manufacturer ID : 7244
Manufacturer Name : Quanta Computer Inc.
Product ID : 14426 (0x385a)
Product Name : Unknown (0x385A)
Device Available : yes
Provides Device SDRs : yes
Additional Device Support :
Sensor Device
SEL Device
FRU Inventory Device
Chassis Device
Aux Firmware Rev Info :
0x00
0x00
0x00
0x00
```

Change-Id: I372c9433a274bc633a24d213b7a1bc205531e33d
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# d3d2fe29 12-Nov-2021 Vivekanand Veeracholan <vveerach@google.com>

Prevent default cmdGetDeviceSdr handler registration in dynamic sensors

Signed-off-by: Vivekanand Veeracholan <vveerach@google.com>
Change-Id: Iedfa2e1983137afd032c05df07ab5d4a5f09fae9


# 7f3a70f0 07-Dec-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Invalidate cache when sensor disappears

When a sensor disappears from DBus, invalidate the cache.
Ideally it could be done by adding a match for interfacesRemoved
signal.
However, inte

sensor-cache: Invalidate cache when sensor disappears

When a sensor disappears from DBus, invalidate the cache.
Ideally it could be done by adding a match for interfacesRemoved
signal.
However, interfacesRemoved signal is not emitted if a service is
terminated or crashed, so we have to use nameOwnerChanged signal
as well. The `nameOwnerChanged` signal does not provide DBus object's
information, so the code needs to record the relationship between sensor
ids and the services, so that when the event occurs, it knows which
sensors should be invalidated.

Tested: Manually stop virtual-sensor, and verify the related sensors are
shown as `na` in ipmitool sensor list:

total_power | na | | na | na | na | na | na | na | na

Restart virtual-sensor, and verify the related sensors have
valid readings:

total_power | 510.000 | Watts | ok | na | na | na | na | na | na

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: If145a1cd163477c3aca3fd17f3dbde96263f6b75

show more ...


# 8e8152c5 06-Dec-2021 Lei YU <yulei.sh@bytedance.com>

sensor-cache: Use async calls in get sensor reading

Use the async calls in ipmiSensorGetSensorReading() for cached sensors.

Note that the code was using sdbusplus::message as the parameter for the

sensor-cache: Use async calls in get sensor reading

Use the async calls in ipmiSensorGetSensorReading() for cached sensors.

Note that the code was using sdbusplus::message as the parameter for the
getFunc(), now it could be simplified to ipmi::PropertyMap and unify the
two cases: property update callback and getting property.

Tested: Verify the ipmi sensor list works fine.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: If7afed410f794a5317b8d4b4965cac291a735d12

show more ...


123456