| f9090f37 | 15-Jul-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
pldm: Use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. With this change, errors are no lon
pldm: Use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. With this change, errors are no longer thrown by default. Instead, the caller can inspect allocation errors as values, extract the error message or code as needed, or explicitly throw the error further up the stack if appropriate. This approach allows for more flexible and explicit error handling, and reduces reliance on exception-based control flow.
Motivation: This change aims to improve robustness by enabling explicit error handling and reducing the risk of uncaught exceptions that could lead to a pldmd core dump if an instance ID allocation fails for a single EID. Such a core dump could disrupt ongoing operations such as sensor polling or firmware updates for other EIDs
Note: Currently, some call sites are still void-returning functions and cannot propagate errors via return values. As a result, errors from InstanceIdDb::next() are thrown as InstanceIdError at these locations to avoid silent failures. Ideally, it would be preferable for these functions to propagate errors by value (for example, using std::expected), so that errors can always be handled explicitly without relying on exceptions.
Change-Id: I7189e97f206bae1eed5c8db44ebbbcd4393c8f8d Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| 24c04d57 | 11-Nov-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
State.Host: use PDI constants
Pull string literals from PDI for xyz.openbmc_project.State.Host interface.
Tested: Inspection only.
Change-Id: Ia5ea6e67fc6c6925c3febcc28503408d5c028075 Signed-off-b
State.Host: use PDI constants
Pull string literals from PDI for xyz.openbmc_project.State.Host interface.
Tested: Inspection only.
Change-Id: Ia5ea6e67fc6c6925c3febcc28503408d5c028075 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| 50554258 | 17-Mar-2025 |
Archana Kakani <archana.kakani@ibm.com> |
oem-ibm: Support bios attributes for boot types
This commit adds support to two bios attributes, boot initiator and boot type, which lets the host know who initiated the boot through boot initiator,
oem-ibm: Support bios attributes for boot types
This commit adds support to two bios attributes, boot initiator and boot type, which lets the host know who initiated the boot through boot initiator, and what type of boot(boot or reboot) through the boot type attribute
Change-Id: Iec4bc4ceec3a48ffd3f59b4d31f419c8806187ac Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
show more ...
|
| 22bcb07d | 11-Jul-2025 |
ManojKiran Eda <manojkiran.eda@gmail.com> |
Revert "pldm: use std::expected for instance ID allocation"
This reverts commit 70262ed7bf854b25d4b65628bc3c892ddfe9380f.
Change-Id: I1f54d6b60bf3cfa9f00764140eec6167e1e182d6 Signed-off-by: Manojki
Revert "pldm: use std::expected for instance ID allocation"
This reverts commit 70262ed7bf854b25d4b65628bc3c892ddfe9380f.
Change-Id: I1f54d6b60bf3cfa9f00764140eec6167e1e182d6 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| 70262ed7 | 02-Jul-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
pldm: use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. This change enables callers to expl
pldm: use std::expected for instance ID allocation
Refactor InstanceIdDb::next() to return std::expected<uint8_t, InstanceIdError> instead of throwing exceptions. This change enables callers to explicitly handle allocation errors via value inspection, rather than relying on exception handling.
This approach prevents core dumps from uncaught exceptions and eliminates the need for pervasive try-catch blocks. Callers can now access the error code and message directly, improving clarity and control of error propagation.
Note: Errors from InstanceIdDb::next() are currently handled via early return, which may silently discard failures. This is a temporary solution; APIs and callers will need to be updated in the future to propagate and handle errors explicitly.
Change-Id: Ibf2e0034b0ee725cb59adfd93b74e48db8c42cba Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| 70eca96b | 10-May-2025 |
Eric Yang <eric.yang.wiwynn@gmail.com> |
Fix build issues after migrating to Clang 20
With the recent migration to Clang 20 in openbmc-build-scripts, the current PLDM codebase fails to compile due to stricter type checking and unused field
Fix build issues after migrating to Clang 20
With the recent migration to Clang 20 in openbmc-build-scripts, the current PLDM codebase fails to compile due to stricter type checking and unused field warnings introduced by the updated compiler.
This commit addresses the following issues to restore build stability:
1. Callback compatibility: Replaced std::bind_front with lambda expressions that explicitly capture this, resolving type mismatch errors when assigning member function callbacks to std::function. 2. Unused field warning: Removed the unused `bus` member variable from the `SoftPowerOff` class and updated its constructor accordingly to eliminate `-Wunused-private-field` warnings.
These changes are required to allow successful CI builds under the Clang 20 toolchain.
Change-Id: I8eb909c2b1263bf7b2dbf53cdfc0424d425d352b Signed-off-by: Eric Yang <eric.yang.wiwynn@gmail.com>
show more ...
|
| 3c8b3e35 | 29-Jan-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
softoff : Migrate to placement_new from reinterpret casting
reinterpret_cast is prohibited by the C++ core guidelines because it takes the behavior outside the language definition and gives problems
softoff : Migrate to placement_new from reinterpret casting
reinterpret_cast is prohibited by the C++ core guidelines because it takes the behavior outside the language definition and gives problems with type safety. Placement-new on the other-hand allows to control the object storage while still properly instantiating an object,keeping the behavior inside the C++ language specification.
Change-Id: I75dd9e2372b32bf4258c497152f61cd0ca6ad9bd Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
| 3012b632 | 22-Aug-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Format meson files with meson.format
Meson 1.5.0 introduced a new feature to format all the meson files. Formatting all the meson files is now as simple as running `meson format -i -r` command in th
Format meson files with meson.format
Meson 1.5.0 introduced a new feature to format all the meson files. Formatting all the meson files is now as simple as running `meson format -i -r` command in the repository root folder.
more details : https://mesonbuild.com/Commands.html#format
Change-Id: I9c5468cc502ae78b7a055e2de2a10296930cb9ec Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| 16c2a0a0 | 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: I8c84201cb2343a8c8a5507a49de0721a1bee7063 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 99991367 | 05-Aug-2024 |
Sagar Srinivas <sagar.srinivas@ibm.com> |
softpoweroff: Correcting PEL log creation
Correct the PEL log creation as per the PEL message registry when we hit the timeout waiting for host to respond.
Signed-off-by: Sagar Srinivas <sagar.srin
softpoweroff: Correcting PEL log creation
Correct the PEL log creation as per the PEL message registry when we hit the timeout waiting for host to respond.
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com> Change-Id: I51909309f6a107078455f6e6993278c7fbcaafcd
show more ...
|
| 1e5c81e0 | 03-May-2024 |
Riya Dixit <riyadixitagra@gmail.com> |
pldm: Remove unnecessary type casting in logs
This commit removes the unnecessary type casting of values of the journal logs based on supported types mentioned in LG2 documentation [1].
Testing: Ve
pldm: Remove unnecessary type casting in logs
This commit removes the unnecessary type casting of values of the journal logs based on supported types mentioned in LG2 documentation [1].
Testing: Verified the debug traces to correct.
''' For Instance: Earlier - error(”TYPE = {TYPE} “, “TYPE”, static_cast<unsigned>(PLDM_STATE_EFFECTER_PDR)); Journal trace - May 27 08:16:51 p10bmc pldmd[931]: TYPE = 11
After Correction - error(”TYPE = {TYPE}“, “TYPE”, PLDM_STATE_EFFECTER_PDR); Journal trace - May 27 08:16:51 p10bmc pldmd[931]: TYPE = Enum(11) '''
[1]: https://github.com/openbmc/phosphor-logging/blob/master/docs/structured-logging.md#lg2
Change-Id: Ia649ecd4ecbb73c421f7844885f58a6835805719 Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
show more ...
|
| 087a751f | 06-Apr-2024 |
Riya Dixit <riyadixitagra@gmail.com> |
pldmd, requester, softoff & utilities: Improving logs (lg2)
This commit corrects the severity level of logs and also formats the message string, fixing the ill-defined message string of the logs as
pldmd, requester, softoff & utilities: Improving logs (lg2)
This commit corrects the severity level of logs and also formats the message string, fixing the ill-defined message string of the logs as mentioned in the anti-pattern document [1]. Additionally, based on the requirement this commit adds more debug information to logs.
[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#ill-defined-data-structuring-in-lg2-message-strings
Change-Id: I230e9e1404db8c92c81e2f872183d691c91ff16c Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
show more ...
|
| 92fb0b55 | 17-Apr-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Revert "Adding severity when reporting an error"
This reverts commit d28f08cf0238435ac92184fabaafd9c76bff62cf.
Reason for revert : Pel severity is completely openpower-specific , we should not poll
Revert "Adding severity when reporting an error"
This reverts commit d28f08cf0238435ac92184fabaafd9c76bff62cf.
Reason for revert : Pel severity is completely openpower-specific , we should not polluting common code with IBM specific things, hence reverting this change for now.
Change-Id: If11721b1522097460ba07d51335b7ebbe821311a Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| e98c51b1 | 08-Jun-2021 |
Zach Clark <zach@ibm.com> |
Update pldm-softpoweroff application with working values
This commit updates the pldm-softpoweroff application so that it can properly locate the PLDM effecter and sensor PDRs for the graceful power
Update pldm-softpoweroff application with working values
This commit updates the pldm-softpoweroff application so that it can properly locate the PLDM effecter and sensor PDRs for the graceful poweroff request. It also updates the host terminus ID to the correct value.
Tested by:
Running the application when Hostboot was IPLing, and also when PHYP was at standby.
root@ever39bmc:~# /tmp/pldm-softpoweroff Getting the response. PLDM RC = 0 Timer started waiting for host soft off, TIMEOUT_IN_SEC = 0x1c20 root@ever39bmc:~# echo $? 0
Signed-off-by: Zach Clark <zach@ibm.com> Change-Id: I7408611881abecfb5169816af032e2fb9d3a8a09
show more ...
|
| 4d99c311 | 28-Mar-2024 |
Sagar Srinivas <sagar.srinivas@ibm.com> |
Softoff: Add config support for PDR entities
This commit introduces a config file for the soft power off app. The config file specifies the order of remote PDRs to be checked during the soft power o
Softoff: Add config support for PDR entities
This commit introduces a config file for the soft power off app. The config file specifies the order of remote PDRs to be checked during the soft power off process.
Previously, the entity type was hardcoded in the codebase, limiting scalability. With this change, the softoff app gains flexibility for future expansions.
TESTED: By running 'obmcutil poweroff' with various remote entities during boot-up.
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com> Change-Id: Ib8d2aba6a05fc4e9da4b042fd67890e6282ed784
show more ...
|
| d28f08cf | 15-Dec-2021 |
Pavithra Barithaya <pavithra.b@ibm.com> |
Adding severity when reporting an error
Severity is part of the PEL User Header section, and is used to specify the PEL severity. This commit adds an option to pass severity parameter while logging
Adding severity when reporting an error
Severity is part of the PEL User Header section, and is used to specify the PEL severity. This commit adds an option to pass severity parameter while logging PEL. This will help to classify PELs based on their severity. The commit also maintains uniformity in the PEL Error logged.
Tested: By creating the error logs(pel) in error scenarios.
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com> Change-Id: Ic084d49b8ffe9aaea2c36c9fefa95a10a9c1c3ec
show more ...
|
| 3fcfaa12 | 26-Feb-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix softoff crash due to double free corruption
In its present condition, the instance database gets initialized within the hostSoftOff function. Consequently, once the function execution is complet
Fix softoff crash due to double free corruption
In its present condition, the instance database gets initialized within the hostSoftOff function. Consequently, once the function execution is complete, the database goes out of scope, triggering the invocation of the instanceDb destructor. This, in turn, prematurely destroys the instance database in the middle of the softpoweroff flow, resulting in a double free corruption.
Tested: After implementing the fix, softoff was tested to ensure it does not crash.
Change-Id: I251201b06864a8a5273bfaa23468a06ad678763a Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
| cbe68b2d | 23-Feb-2024 |
Sagar Srinivas <sagar.srinivas@ibm.com> |
Remove iostream references
With the adoption of LG2 we do not need iostream prints to the journal. The library was referred but never used in these cases.
Signed-off-by: Sagar Srinivas <sagar.srini
Remove iostream references
With the adoption of LG2 we do not need iostream prints to the journal. The library was referred but never used in these cases.
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com> Change-Id: I11d3f00284e4f16b63cddb8da2fed14d59672ba1
show more ...
|
| 58cbcaf2 | 06-Oct-2023 |
Kamalkumar Patel <kamalkumar.patel@ibm.com> |
PLDM:Catching exception precisely and printing it
Correcting catch block in PLDM repo to print all exception precisely so pldm trace can be more useful to identify defect easily.
Change-Id: If2e86d
PLDM:Catching exception precisely and printing it
Correcting catch block in PLDM repo to print all exception precisely so pldm trace can be more useful to identify defect easily.
Change-Id: If2e86dcb031ddc2e927e7836d7f4359f5b44cdec Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
show more ...
|
| cf772846 | 07-Dec-2023 |
Patrick Williams <patrick@stwcx.xyz> |
meson: adjust nlohmann-json dependency
Simplify the meson dependency for nlohmann-json, use the consistent dependency name, and align the wrap file name with other repositories.
Signed-off-by: Patr
meson: adjust nlohmann-json dependency
Simplify the meson dependency for nlohmann-json, use the consistent dependency name, and align the wrap file name with other repositories.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I3a682a3e07e38d0a1bfe35858e24f1bb74b4ec34
show more ...
|
| 35535cf2 | 05-Dec-2023 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: avoid deprecated phosphor::Timer
sdbusplus had an older type named `phosphor::Timer` which was recently renamed to `sdbusplus::Timer`. Update the code to use the new type alias.
Change-
sdbusplus: avoid deprecated phosphor::Timer
sdbusplus had an older type named `phosphor::Timer` which was recently renamed to `sdbusplus::Timer`. Update the code to use the new type alias.
Change-Id: I68d3968bcb359bee5ea0c9e695572b68fcf34136 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 87bfacd2 | 29-Nov-2023 |
Patrick Williams <patrick@stwcx.xyz> |
build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled, or auto. The enabled and disabled functions on an option (from `get_option`) no longer retur
build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled, or auto. The enabled and disabled functions on an option (from `get_option`) no longer return true for auto features. Instead, the expectation is to use `allowed()` which is true for both enabled and auto.
Switch all uses of `enabled` to `allowed`.
Change-Id: I794c658531483266bfce6f9b28127a166ed01490 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| a675662c | 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: Ib8dfa202f1d59add43fc0d55ab2bf388c8e7c877 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 1ed5f7a6 | 21-May-2023 |
Rashmica Gupta <rashmica@linux.ibm.com> |
pldm: Convert to using libpldm transport APIs
A significant amount of logic can be removed by exploiting the new transport APIs provided by libpldm. Switch the pldm repository over to use these by i
pldm: Convert to using libpldm transport APIs
A significant amount of logic can be removed by exploiting the new transport APIs provided by libpldm. Switch the pldm repository over to use these by introducing an RAII wrapper for the APIs. The current stance is to continue using the legacy mctp-demux transport implementation, but we also provide a build option to switch to the AF_MCTP transport.
We don't currently have the infrastructure in place to get the correct TIDs, so to keep everything working as before use the EID as the TID in the EID-to-TID mapping.
Change-Id: I366f079082b102cfc0e90db0f62208581eb8693e Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com> Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
show more ...
|
| 3d03f3fa | 07-Sep-2023 |
Dung Cao <dung@os.amperecomputing.com> |
pldmtool/softoff: Use InstanceId APIs from libpldm
The af-mctp transport does not broadcast the PLDM messages between the MCTP socket instances. Pldmtool/softoff have to handle get/free instanceId i
pldmtool/softoff: Use InstanceId APIs from libpldm
The af-mctp transport does not broadcast the PLDM messages between the MCTP socket instances. Pldmtool/softoff have to handle get/free instanceId instead of depending on the pldmd. Update pldmtool/softoff to use get/free instanceId APIs in libpldm.
Tested. 1. Call more than 32 pldmtool commands to make sure the allocated InstanceId are free correctly. 2. Repeat calling softoff more than 32 times. Make sure the functional should work normally.
Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au> Change-Id: I7cda124694d95d00c37f4993e22cfe33a980d364
show more ...
|