History log of /openbmc/phosphor-power/phosphor-regulators/src/manager.cpp (Results 1 – 25 of 26)
Revision Date Author Comments
# 48781aef 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: If66f68c96df4baf8dc07abf8729a3cb7657e932d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 7354ce62 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: Ief05bd757cffb1453e058a719ee4b060861752e7

show more ...


# d1307294 19-Apr-2022 Zev Weiss <zev@bewilderbeest.net>

regulators: Add phosphor-regulators service dependencies

'regsctl' can't do anything useful until phosphor-regulators is running,
so add systemd unit dependencies to ensure it's started before
regul

regulators: Add phosphor-regulators service dependencies

'regsctl' can't do anything useful until phosphor-regulators is running,
so add systemd unit dependencies to ensure it's started before
regulators-config and regulators-monitor-{enable,disable}.

While we're at it, change phosphor-regulators.service to be of type dbus
so we get a more meaningful check that it's really up and running, and
tweak the instantiation of ManagerObject so that it emits the necessary
signals.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I724e4f335c4347ad6789e2d68cfb58c6387e6073

show more ...


# 3fa31a7c 05-Apr-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: object: don't use 'bool' argument constructor

`sdbusplus::server::object_t` has long had an enum-based parameter for
signal action, but maintained a backwards compatible boolean mapping.

sdbusplus: object: don't use 'bool' argument constructor

`sdbusplus::server::object_t` has long had an enum-based parameter for
signal action, but maintained a backwards compatible boolean mapping.
It is time to remove this boolean to make it more observable which
actions are being used in applications. Map all `true` occurrences to
`action::defer_emit`.

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

show more ...


# a61c1aa0 19-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: remove usage of deprecated alias

The alias `server::match` has been deprecated since 2016. Use the new
alias under bus.

Signed-off-by: Patrick Williams <patrick@stwc

sdbusplus: remove usage of deprecated alias

The alias `server::match` has been deprecated since 2016. Use the new
alias under bus.

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

show more ...


# c8cbeac2 10-Sep-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Enable phase fault detection

Modify the top level Manager class to perform phase fault detection
every 15 seconds.

If the chassis is powered on, phase faults will be

regulators: Enable phase fault detection

Modify the top level Manager class to perform phase fault detection
every 15 seconds.

If the chassis is powered on, phase faults will be detected in every
regulator device in the system.

Tested:
* Tested where no phase fault found for a regulator.
* Tested where an N phase fault found for a regulator.
* Tested where an N+1 phase fault found for a regulator.
* Tested where additional data was captured in phase fault error log.
* Verified detection occurs every 15 seconds
* Verified detection starts during power on after regulators are
enabled.
* Verified detection stops during power off before regulators are
disabled.
* Tested where no JSON configuration file was loaded.
* Tested when application was restarted while system was powered on.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I12ac16dfcf4f754e168ce1ff76795520f823349f

show more ...


# d9c8be57 18-May-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Enable sensor monitoring

Enable sensor monitoring in the phosphor-regulators application.

Previous commits implemented the majority of the sensor monitoring
support.

regulators: Enable sensor monitoring

Enable sensor monitoring in the phosphor-regulators application.

Previous commits implemented the majority of the sensor monitoring
support. This commit contains the last set of changes needed to enable
monitoring for the entire application.

Modify the top level Manager class to enable or disable monitoring based
on the D-Bus 'monitor' method. This method is called by the regsctl
command line tool. Service files use regsctl to enable monitoring
during power on and disable monitoring during power off.

When monitoring is enabled, set a repeating, one-second timer. When the
timer expires, execute one sensor monitoring cycle for all voltage
regulator sensors.

When monitoring is disabled, turn off the timer. Put all the sensors in
an inactive state, indicating they are no longer being updated. They
will remain in this state until the system is powered on again.

Tested:
* Verified sensor monitoring is enabled when chassis is powered on.
* Verified sensor monitoring is disabled when chassis is powered off.
* Verified voltage regulator sensors are read once per second while
monitoring is enabled.
* Verified sensors are published on D-Bus when monitoring is enabled.
* Verified sensors remain on D-Bus but are put in an inactive state when
monitoring is disabled.
* Verified sensors are not read when monitoring is disabled.
* Tested where D-Bus queries to obtain current power state fail with a
D-Bus exception.
* Verified sensor monitoring is enabled if BMC is reset while chassis is
powered on.
* Verified sensor monitoring is enabled if regulators application is
stopped and re-started while chassis is powered on.
* For complete test plan, see
https://gist.github.com/smccarney/0afa4a50afcf9f0d47e1a21ebe33dbfc

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ic85d4baa0a53e57bd2a494611d70a76ae7b135f7

show more ...


# ce540f3c 14-May-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Clear error history when powering on

Enhance the Manager class to clear error history when powering on the
system. Clear all data on previously logged errors. If the error

regulators: Clear error history when powering on

Enhance the Manager class to clear error history when powering on the
system. Clear all data on previously logged errors. If the error
occurs again in the future, it will be logged again.

When the system is powered off, hardware may be replaced that fixes the
problem. Thus, errors are cleared during power on.

Tested:
* Verified that error history is cleared when system is powered on.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Id174458ec3649819f8e7127c16039d535c42dd1e

show more ...


# 8acaf547 30-Mar-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Wait for compatible system types

There are two options for naming the JSON configuration file:
1. Default name
2. Name based on compatible system types provided by Entity

regulators: Wait for compatible system types

There are two options for naming the JSON configuration file:
1. Default name
2. Name based on compatible system types provided by EntityManager

If option #2 is used, there is no guarantee that EntityManager will have
published the compatible systems types on D-Bus before a boot is
attempted. This is not common, but the problem has occurred.

When the boot begins, the regulators application configures the voltage
regulators. If the config file has not been found and loaded, this
configuration cannot occur.

This commit enhances the regulators application to wait for
EntityManager to publish the compatible systems information during the
boot so that the regulators can be configured.

A maximum wait time is enforced to prevent the boot from being blocked
indefinitely. If this maximum wait time is reached, a critical error is
logged indicating that the voltage regulators could not be configured.

Tested:
* System types available before boot
* Have to wait for system types during boot
* System types found within 5 minutes
* System types not found within 5 minutes
* For complete test plan details, see
https://gist.github.com/smccarney/b059a5f4da1a9138af770217cbafaea3

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I700a376b94603f36defd1fe266c0a2d7e2a9d30b

show more ...


# 0635df21 02-Mar-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Temporarily allow boot w/missing cfg

Temporarily allow the boot to continue if the regulators JSON
configuration file is missing or invalid.

The EntityManager applic

regulators: Temporarily allow boot w/missing cfg

Temporarily allow the boot to continue if the regulators JSON
configuration file is missing or invalid.

The EntityManager application publishes the system type information on
D-Bus using a "compatible" interface. This information is used to find
the correct regulator config file.

A problem was discovered where a boot can be attempted before
EntityManager has published the system type information. This was
resulting in the regulators application stopping the boot since it
didn't have a valid configuration file yet.

The long-term direction is to enhance the regulators application to wait
for the EntityManager information during the boot if necessary.

However, a short-term fix is required right now. The current behavior
of logging a critical error and stopping the boot is being temporarily
commented out.

Tested:
* Verified that boot is not longer stopped if config file is
missing/invalid.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I2e60f9892d3f72143a0e3c28bce19c55b4659f47

show more ...


# 415094c1 15-Feb-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Stop boot if cfg file not found/valid

Stop the boot during a BMC chassison/poweron if the regulators JSON
configuration file cannot be found or is invalid.

During th

regulators: Stop boot if cfg file not found/valid

Stop the boot during a BMC chassison/poweron if the regulators JSON
configuration file cannot be found or is invalid.

During the boot, the regulators application configures the voltage
regulators in the system. One of the most important voltage regulator
settings that can be changed is the output voltage.

The rules on how to configure the voltage regulators are defined in the
JSON config file. If this file cannot be found or is invalid, the
voltage regulators cannot be configured.

That would mean that the voltage regulators would be turned on during
the boot using their hardware default settings. It is common for some
of the hardware defaults to be incorrect, occasionally by a significant
amount.

If the hardware defaults are significantly off, it is possible that
hardware damage could occur. For example, if the output voltage is too
high, downstream hardware components could be damaged.

For this reason, the boot needs to be stopped. A critical error is
logged, and the executable run by the systemd service file exits with a
non-zero return code indicating failure.

Note that this behavior will only occur if the phosphor-regulators
application is being used. The application must be explicitly enabled
using a meson build option.

Tested:
* Verified that boot is stopped if JSON config file not found/valid
* Verified critical error logged
* Verified regsctl exits with non-zero value causing config service to
fail
* Verified that boot continues if JSON config file valid
* Tested with both 'obmcutil chassison' and 'obmcutil poweron'
* For complete test plan see
https://gist.github.com/smccarney/8801cad1fe1c4ae8913e57d9474bfaac

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I211f19cd9b98daea86645611633f8943c44b0f75

show more ...


# 4e0402cb 05-Feb-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Add VPD service

The regulators application needs to obtain VPD (Vital Product Data)
keyword values.

Sometimes regulator configuration and monitoring varies depending

regulators: Add VPD service

The regulators application needs to obtain VPD (Vital Product Data)
keyword values.

Sometimes regulator configuration and monitoring varies depending on
hardware type or version. VPD keyword values can provide this
information about the hardware.

Add a new class to obtain hardware VPD from the D-Bus
xyz.openbmc_project.Inventory.Decorator.Asset interface.

Also define an abstract base class and a mock implementation to
enable use of gmock in test cases related to VPD.

Tested:
* Verified VPD values were successfully obtained from D-Bus.
* Verified VPD values were cached.
* Tested where object path was invalid.
* Tested where keyword was invalid.
* Verified cached VPD values were cleared when machine powered on.
* For the complete test plan, see
https://gist.github.com/smccarney/519a54353361e28b1d25f5783c15f471

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Id08e8bca8db6421d46669c495e8a9432e45a1fd6

show more ...


# 9bd94d36 25-Jan-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Clear cached hardware data during boot

Clear cached data about hardware devices when the system is powering on
(booting).

While the system was powered off, hardware

regulators: Clear cached hardware data during boot

Clear cached data about hardware devices when the system is powering on
(booting).

While the system was powered off, hardware devices containing voltage
regulators could have been added, removed, or replaced. Cached hardware
data might now be invalid.

Tested:
* Ran automated test cases
* Verified that cached data is cleared without errors during boot
* When config file was found and loaded
* When no config file was found

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ief45fe32ddcb122847d201e89ca1267526a87e3c

show more ...


# 589c181a 14-Jan-2021 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Obtain config file name from D-Bus

Determine the correct JSON configuration file name based on the values
in the D-Bus compatible systems interface.

Also support a d

regulators: Obtain config file name from D-Bus

Determine the correct JSON configuration file name based on the values
in the D-Bus compatible systems interface.

Also support a default configuration file name for systems that do not
use the compatible systems interface.

Tested:
* Verified correct config file name found on Rainier system
* When phosphor-regulators starts before entity-manager
* When phosphor-regulators starts after entity-manager
* Verified correct config file name found on Everest system
* When phosphor-regulators starts before entity-manager
* When phosphor-regulators starts after entity-manager
* Error cases
* For full test plan see
https://gist.github.com/smccarney/2dbc81aa55e3fa6250f0827eab62fff7

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I98902116b55297085ca3c40ce48f40972c3a3827

show more ...


# d692d6df 14-Sep-2020 Bob King <Bob_King@wistron.com>

regulators: Modify close() to use services

Modify the Device::close() method in the Device class to have a new
first parameter: Services& services.

Modify Device::close() to log

regulators: Modify close() to use services

Modify the Device::close() method in the Device class to have a new
first parameter: Services& services.

Modify Device::close() to log messages using the new Journal
interface.

Modify the Chassis::closeDevices() method in the Chassis class to
have a new first parameter: Services& services.

Modify Chassis::closeDevices() to log messages using the new
Journal interface.

Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I2a07417d6f7470685f2c27c878ef7936e9f1aa8a

show more ...


# 23243f84 28-Jul-2020 Bob King <Bob_King@wistron.com>

regulators: Add Services& services to classes

Modify the configure() method in the System, Chassis, Device, and Rail
classes to have a new first parameter: Services& services.

F

regulators: Add Services& services to classes

Modify the configure() method in the System, Chassis, Device, and Rail
classes to have a new first parameter: Services& services.

Fix mock_services.hpp bug.

Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I6ef41de65d2c5b68c55edb42189ba9c0f2e436ed

show more ...


# b464c8bd 16-Jul-2020 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Modify Manager to use Services

Modify the Manager class to use the new Services interface.

Tested:
* Verified all journal messages logged by Manager still work.

regulators: Modify Manager to use Services

Modify the Manager class to use the new Services interface.

Tested:
* Verified all journal messages logged by Manager still work.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ifaa1dfe67e4ab33ea42e9ee1daf65a5663087a0d

show more ...


# 5b19ea51 02-Jun-2020 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Close devices when system powering off

Modify the Manager class to close all regulator devices when monitoring
is disabled. Monitoring is normally disabled because the syste

regulators: Close devices when system powering off

Modify the Manager class to close all regulator devices when monitoring
is disabled. Monitoring is normally disabled because the system is
being powered off.

Also add a closeDevices() method to the System class that closes all
devices in the system.

Tested:
* Tested when monitoring was disabled. Verified debug journal message
stating devices were closed.
* Tested multiple consecutive power on/off cycles to ensure device
access remained functional.
* Performed regression test on existing function.
* Created and executed automated tests for System::closeDevices()

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I074190454c505116cccf1bc130a70205f34d0e26

show more ...


# 6345c6c5 04-May-2020 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Implement D-Bus configure method

The phosphor-regulators D-Bus configure method is called from a service
file when booting the BMC system. The method is called shortly befor

regulators: Implement D-Bus configure method

The phosphor-regulators D-Bus configure method is called from a service
file when booting the BMC system. The method is called shortly before
the regulators are enabled (turned on).

Previously the configure method did not do anything; it was a
placeholder.

This commit adds the implementation of the configure method. The method
now configures the regulator devices in the system using the rules and
actions in the JSON config file.

Also commented out the partial implementation of the D-Bus monitor
method. This method has not been fully implemented or tested yet.

Tested:
* Tested phosphor-regulators application through chassison/chassisoff
and poweron/poweroff.
* Verified systemd state and journal messages.
* Verified that all configuration specified in the config file was
applied to the regulators.
* Tested when an I2C failure occurs when configuring a regulator.
* Verified that monitoring can be safely enabled and disabled but it
performs no current function.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I722464a50f572c1a6e23aa13c46238d449312f31

show more ...


# e0c6a2d9 01-May-2020 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Load JSON config file

There are three basic steps to loading the JSON configuration file
for the phosphor-regulators application:
* Find the correct base name using a D-B

regulators: Load JSON config file

There are three basic steps to loading the JSON configuration file
for the phosphor-regulators application:
* Find the correct base name using a D-Bus query
* Find the absolute path to the file by searching two directories
* Parse the config file and store the resulting C++ objects

The base name is currently hard-coded while waiting for an EntityManager
enhancement to be completed. So the first step is partially done.

This commit implements the second and third steps.

Some minor changes were also made to conform these files to the coding
conventions used in the rest of the phosphor-regulators application.

Tested:
* See test plan:
https://gist.github.com/smccarney/5d164131a84717b3f2a8835ae0fc466b

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ie59d473d1fec5ce89c859621eb27579afdcde7aa

show more ...


# 84807b96 30-Apr-2020 Shawn McCarney <shawnmm@us.ibm.com>

regulators: Temporarily hard-code config file name

The JSON configuration file name for the current system will be obtained
from a D-Bus interface and property. That interface will be p

regulators: Temporarily hard-code config file name

The JSON configuration file name for the current system will be obtained
from a D-Bus interface and property. That interface will be provided by
the EntityManager application.

Unfortunately the interface is not yet completely defined or
implemented. While waiting for this interface to be completed, a
hard-coded JSON config file name will be used. This is expected to be a
very short-term solution (a few weeks).

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Id1d29ad704860f02e804877489915d16aac70b90

show more ...


# 250d0a98 28-Feb-2020 Matthew Barth <msbarth@us.ibm.com>

regs: Subscribe to InterfacesAdded signals

Subscribe to InterfacesAdded signals to handle not being able to read
the JSON configuration data filename from dbus due to the service
hos

regs: Subscribe to InterfacesAdded signals

Subscribe to InterfacesAdded signals to handle not being able to read
the JSON configuration data filename from dbus due to the service
hosting that property is not available yet. The InterfacesAdded signal
is used to get notified when that property becomes available on dbus and
is read upon receiving the signal.

Tested:
InterfacesAdded signals on an object path is received
A string is used as the filename when the path, interface, and
property match from the InterfacesAdded signals received

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

show more ...


# bbc7c583 03-Feb-2020 Matthew Barth <msbarth@us.ibm.com>

regs: Get JSON configuration data filename from dbus

Retrieve the JSON configuration data filename from the service on dbus
hosting the predefined path, interface and system identifier p

regs: Get JSON configuration data filename from dbus

Retrieve the JSON configuration data filename from the service on dbus
hosting the predefined path, interface and system identifier property.
The system identifier property's value is used as the direct JSON
configuration data filename with the `.json` extension added.

Tested:
A string representing the filename is retrieved from dbus

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

show more ...


# 7cbc5536 29-Jan-2020 Matthew Barth <msbarth@us.ibm.com>

regs: Handle HUP signals

Enable capturing and handling a HUP signal to reload configuration data.

Tested:
Handler function called upon receiving a SIGHUP

Signed-off

regs: Handle HUP signals

Enable capturing and handling a HUP signal to reload configuration data.

Tested:
Handler function called upon receiving a SIGHUP

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

show more ...


# f2bcf1f9 29-Jan-2020 Matthew Barth <msbarth@us.ibm.com>

regs: Add an event timer for monitoring

Create and enable a repeating 1 second timer when monitoring is enabled.
Delete the timer when monitoring is disabled.

Tested:
Ti

regs: Add an event timer for monitoring

Create and enable a repeating 1 second timer when monitoring is enabled.
Delete the timer when monitoring is disabled.

Tested:
Timer created when monitoring is enabled
Each timer expiration calls bound callback function
Timer stopped/deleted when monitoring is disabled

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

show more ...


12