diff options
author | Cheng C Yang <cheng.c.yang@intel.com> | 2020-01-22 05:58:39 +0300 |
---|---|---|
committer | Yang, Cheng C <cheng.c.yang@intel.com> | 2020-01-29 20:21:51 +0300 |
commit | de66bb8fdc5fcd0df7f75af71155852d0182d5c8 (patch) | |
tree | e72cd9b8486bc9b4166aa5af25d714ce51148209 | |
parent | 49e6d0678ef91938a8cc4125716b5189ccef6a88 (diff) | |
download | provingground-de66bb8fdc5fcd0df7f75af71155852d0182d5c8.tar.xz |
Only rescan FRU on pmbus when PSU changes
When a new PSU is inserted, only rescan the FRU on pmbus instead of rescan
all the FRU on the system.
Tested:
Insert a new PSU, Redfish can show correct FRU of this PSU.
Change-Id: I6868210868dda8f5f9f5fc5a52dad472cb129f88
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
-rw-r--r-- | psu-manager/src/cold_redundancy.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/psu-manager/src/cold_redundancy.cpp b/psu-manager/src/cold_redundancy.cpp index 8998771..d6bd241 100644 --- a/psu-manager/src/cold_redundancy.cpp +++ b/psu-manager/src/cold_redundancy.cpp @@ -44,6 +44,7 @@ static const constexpr char* rootPath = "/xyz/openbmc_project/CallbackManager"; static std::vector<std::unique_ptr<PowerSupply>> powerSupplies; static std::vector<uint64_t> addrTable = {0x50, 0x51}; +static uint8_t psuRescanBus = 7; static int pingFd = -1; ColdRedundancy::ColdRedundancy( @@ -338,11 +339,12 @@ int pingPSU(const uint8_t& addr) } void rescanPSUEntityManager( - std::shared_ptr<sdbusplus::asio::connection>& dbusConnection) + uint8_t bus, std::shared_ptr<sdbusplus::asio::connection>& dbusConnection) { sdbusplus::message::message method = dbusConnection->new_method_call( "xyz.openbmc_project.FruDevice", "/xyz/openbmc_project/FruDevice", - "xyz.openbmc_project.FruDeviceManager", "ReScan"); + "xyz.openbmc_project.FruDeviceManager", "ReScanBus"); + method.append(bus); try { @@ -392,7 +394,7 @@ void keepAlive(std::shared_ptr<sdbusplus::asio::connection>& dbusConnection) } if (newPSUFound) { - rescanPSUEntityManager(dbusConnection); + rescanPSUEntityManager(psuRescanBus, dbusConnection); } } @@ -503,6 +505,7 @@ void ColdRedundancy::createPSU( "entry in configuration\n"; return; } + psuRescanBus = *psuBus; addrTable = *psuAddress; if (setPingFd(pingFd, *psuBus)) { |