History log of /openbmc/phosphor-fan-presence/presence/json_parser.cpp (Results 1 – 18 of 18)
Revision Date Author Comments
# 9d533806 09-Apr-2025 Anwaar Hadi <anwaar.hadi@ibm.com>

Cleanup old headers and namespace declarations

Remove the header includes for the old phosphor::logging::log API
as well as unnecessary phosphor::logging namespace declarations.
Fully qualify phosph

Cleanup old headers and namespace declarations

Remove the header includes for the old phosphor::logging::log API
as well as unnecessary phosphor::logging namespace declarations.
Fully qualify phosphor::logging namespace where applicable and/or
needed.

Tested:
* Verified commit passed CI unit tests.
* Verified commit built using bitbake.

Change-Id: I2e490e1aa3fd3423f8c52694c2b97bc58b95525a
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>

show more ...


# ebead9a8 19-Mar-2025 Anwaar Hadi <anwaar.hadi@ibm.com>

Move the presence application to lg2

Update the logging API used for files in phosphor-fan-presence/presence
from the older phosphor::logging::log to the more recent lg2::log.

Tested:
* Verified in

Move the presence application to lg2

Update the logging API used for files in phosphor-fan-presence/presence
from the older phosphor::logging::log to the more recent lg2::log.

Tested:
* Verified info and error messages worked correctly in simulation.
* Modified json file to force various property errors and verified
key/value pairs were correct in the journalctl output.

Change-Id: Id4eb226d299fb971aacf3fffcf5036753d274cf8
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>

show more ...


# 4fa67aa1 03-Feb-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: If152304b21dd2daaa2f79255a4f98218615efb05
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: If152304b21dd2daaa2f79255a4f98218615efb05
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# dfddd648 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: Ica590f8613f1fb89ab1ca676ac51c1cc7e38d67f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 5e15c3ba 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: I3e9e6350864ac267819a4b8d670bef7d3746976e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# fbf4703f 17-Jul-2023 Patrick Williams <patrick@stwcx.xyz>

use std::format instead of fmt::format

The std::format is sufficient for the uses in this repository except
for in one file (override_fan_target.cpp, since P2286 isn't supported
by GCC yet). Switch

use std::format instead of fmt::format

The std::format is sufficient for the uses in this repository except
for in one file (override_fan_target.cpp, since P2286 isn't supported
by GCC yet). Switch to std::format whenever possible.

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

show more ...


# 61b73296 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: I152f141a5e8343b92b5ce81d3ca16eec77b5606b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# bc4179e9 04-Oct-2022 Matt Spinler <spinler@us.ibm.com>

pres: Add way to bind fan eeprom driver after plug

Some fans have EEPROMs on them that are read by other BMC code so the
contents can be added to the BMC inventory. Since fans can usually be
hotplu

pres: Add way to bind fan eeprom driver after plug

Some fans have EEPROMs on them that are read by other BMC code so the
contents can be added to the BMC inventory. Since fans can usually be
hotplugged, this means those EEPROMs need to be read after a fan is
plugged, and there was previously no method to trigger that.

This commit adds functionality to phosphor-fan-presence-tach to bind the
EEPROM driver to the new device after a fan with an EEPROM is plugged.
This triggers a udev event which triggers EEPROM reads if the platform
is configured to do so.

This is done with a new optional JSON section in the config.json, which
looks like:
"eeprom": {
"bus_address": "31-0050",
"driver_name": "at24",
"bind_delay_ms": 1000
}

The 'bus_address' field is the device's I2C bus and address string as it
is represented in the I2C subsystem in sysfs. The 'driver_name' field
is the name of the device driver that manages that device. The
'bind_delay_ms' field allows there to be a defined amount of time
between when the device is plugged and when the driver is bound, in case
a certain amount of time is required for the device to come online after
it receives power.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I10d36efab954393239e6face96244ecd34035596

show more ...


# cb356d48 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: I9029cc722e7712633c15436bd3868d8c3209f567

show more ...


# 808d7fe8 13-Jun-2022 Mike Capps <mikepcapps@gmail.com>

meson support: remove code warnings 1

This commit contains code changes necessary to support the increased
warning level from Meson builds. Most changes are for unused variables.

To keep the review

meson support: remove code warnings 1

This commit contains code changes necessary to support the increased
warning level from Meson builds. Most changes are for unused variables.

To keep the review size manageable, this commit contains only monitor
and presence changes (and top-level json_config.hpp).

Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: I7280b512c54e8d5aeba3300764a239f3dcbab14d

show more ...


# dfc8c4d0 22-Jun-2022 Matt Spinler <spinler@us.ibm.com>

presence: Only allow loading once

If entity manager were to get restarted, the JsonConfig::start()
function would be called again which would attempt to load a config on
top of an existing one.

Fix

presence: Only allow loading once

If entity manager were to get restarted, the JsonConfig::start()
function would be called again which would attempt to load a config on
top of an existing one.

Fix that by only allowing the config to load once. If someone wanted
the config to load again, they could either send the HUP signal or just
restart the service.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I1526db17500ffe88408c8bc1f0abba9c4952107b

show more ...


# ddb773b2 06-Oct-2021 Patrick Williams <patrick@stwcx.xyz>

catch exceptions as const

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


# a35a890b 10-Jun-2021 Mike Capps <mikepcapps@gmail.com>

presence: detect and report GPIO exceptions on startup

To address issue ibm2982, we will now catch exceptions when creating the
GPIO presence sensor and substitute it with a nullary sensor that alwa

presence: detect and report GPIO exceptions on startup

To address issue ibm2982, we will now catch exceptions when creating the
GPIO presence sensor and substitute it with a nullary sensor that always
reports non-present. This will give proper error logging for the basic
failure scenario of disconnected hardware. Currently this scenario
causes a core dump and subsequent investigation.

Additionally, an OpenBMC event log has been created using the label
xyz.openbmc_project.Fan.Presence.Error.GPIODeviceUnavailable

Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: Ib25fb27ed4a0a23aae667beb1e7708ada7ea7d65

show more ...


# 5b839919 21-Jun-2021 Matthew Barth <msbarth@us.ibm.com>

presence: Use new JsonConfig object

To simplify handling the loading of config files, use the updated
JsonConfig object that populates the available compatibility values used
when retrieving the JSO

presence: Use new JsonConfig object

To simplify handling the loading of config files, use the updated
JsonConfig object that populates the available compatibility values used
when retrieving the JSON file and loading it. The given load function is
called if compatibility values are found upon being constructed or after
an interfacesAdded signal is received, which then it can call
`getConfFile` to find the JSON config file to be loaded.

Change-Id: I7698f0abf91dc6414386a42b710bcde9c3f47612
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>

show more ...


# 0daedd18 25-Jan-2021 Matt Spinler <spinler@us.ibm.com>

presence: Don't start until JSON config is found

Make use of the JsonConfig class's callback functionality to not
actually start fan presence checking until the config file is available.

If the con

presence: Don't start until JSON config is found

Make use of the JsonConfig class's callback functionality to not
actually start fan presence checking until the config file is available.

If the config file name is known right away, then monitoring will start
right away, but if it has to wait for the IBMCompatible interface to
show up on D-bus first, it will wait for that.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ic00bbf56a092983f93968b08bcbcaa848e4d085a

show more ...


# 9e9f599c 30-Sep-2020 Matt Spinler <spinler@us.ibm.com>

presence: Make error time be per fan

Previously there was a global value for the amount of time a fan needed
to be missing before an event log was created. This commit changes it
so that instead th

presence: Make error time be per fan

Previously there was a global value for the amount of time a fan needed
to be missing before an event log was created. This commit changes it
so that instead the value is specified per fan in the JSON.

This way, the times can be different or left off completely on a fan to
fan basis. The ErrorReporter object will only be created if there is at
least one fan with a time value.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I53bb91c88ec1b0352df11b2e988064c2ec02af45

show more ...


# e8122390 24-Sep-2020 Matt Spinler <spinler@us.ibm.com>

presence: Create ErrorReporter class

This class will, eventually, create event logs for missing fans.

This first commit will just create a stubbed out class if there is a
'reporting' section in the

presence: Create ErrorReporter class

This class will, eventually, create event logs for missing fans.

This first commit will just create a stubbed out class if there is a
'reporting' section in the configuration JSON. From the JSON, the class
will pull out the value for the number of seconds to wait between first
detecting a fan is missing and creating the event log for it.

This requires a slight change to the existing JSON format, however the
JsonConfig class was updated to support both the old and new formats.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I991ea7cf0457448411e65f4c8e274bb2584d15f4

show more ...


# 1a568650 24-Aug-2020 Jolie Ku <jolie_ku@wistron.com>

presence: Use shared JSON config file finding & loading header

Use the shared JSON config determination header for loading its
JSON configuration file.

Tested:
run phosphor-fan-presence-tach ca

presence: Use shared JSON config file finding & loading header

Use the shared JSON config determination header for loading its
JSON configuration file.

Tested:
run phosphor-fan-presence-tach can find and load config.json from
/usr/share/phosphor-fan-presence/presence and
/etc/phosphor-fan-presence/presence/ in witherspoon qemu

Change-Id: I5c4fdf7d96de7c956ca24b4a5751911cc1bf1f03
Signed-off-by: Jolie Ku <jolie_ku@wistron.com>

show more ...