Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 3 | #include "power_supply.hpp" |
| 4 | |
| 5 | #include "types.hpp" |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 6 | #include "util.hpp" |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 7 | |
Brandon Wyman | df13c3a | 2020-12-15 14:25:22 -0600 | [diff] [blame] | 8 | #include <fmt/format.h> |
| 9 | |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 10 | #include <xyz/openbmc_project/Common/Device/error.hpp> |
| 11 | |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 12 | #include <chrono> // sleep_for() |
| 13 | #include <cstdint> // uint8_t... |
| 14 | #include <thread> // sleep_for() |
| 15 | |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 16 | namespace phosphor::power::psu |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 17 | { |
| 18 | |
| 19 | using namespace phosphor::logging; |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 20 | using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error; |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 21 | |
Brandon Wyman | 510acaa | 2020-11-05 18:32:04 -0600 | [diff] [blame] | 22 | PowerSupply::PowerSupply(sdbusplus::bus::bus& bus, const std::string& invpath, |
| 23 | std::uint8_t i2cbus, std::uint16_t i2caddr) : |
| 24 | bus(bus), |
| 25 | inventoryPath(invpath) |
| 26 | { |
| 27 | if (inventoryPath.empty()) |
| 28 | { |
| 29 | throw std::invalid_argument{"Invalid empty inventoryPath"}; |
| 30 | } |
| 31 | |
| 32 | // Setup the functions to call when the D-Bus inventory path for the |
| 33 | // Present property changes. |
| 34 | presentMatch = std::make_unique<sdbusplus::bus::match_t>( |
| 35 | bus, |
| 36 | sdbusplus::bus::match::rules::propertiesChanged(inventoryPath, |
| 37 | INVENTORY_IFACE), |
| 38 | [this](auto& msg) { this->inventoryChanged(msg); }); |
| 39 | |
| 40 | presentAddedMatch = std::make_unique<sdbusplus::bus::match_t>( |
| 41 | bus, |
| 42 | sdbusplus::bus::match::rules::interfacesAdded() + |
| 43 | sdbusplus::bus::match::rules::argNpath(0, inventoryPath), |
| 44 | [this](auto& msg) { this->inventoryAdded(msg); }); |
| 45 | |
| 46 | std::ostringstream ss; |
| 47 | ss << std::hex << std::setw(4) << std::setfill('0') << i2caddr; |
| 48 | std::string addrStr = ss.str(); |
| 49 | pmbusIntf = phosphor::pmbus::createPMBus(i2cbus, addrStr); |
| 50 | |
| 51 | // Get the current state of the Present property. |
| 52 | updatePresence(); |
Brandon Wyman | cb09180 | 2021-04-26 15:26:27 -0500 | [diff] [blame] | 53 | updateInventory(); |
Brandon Wyman | 510acaa | 2020-11-05 18:32:04 -0600 | [diff] [blame] | 54 | } |
| 55 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 56 | void PowerSupply::updatePresence() |
| 57 | { |
| 58 | try |
| 59 | { |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 60 | present = getPresence(bus, inventoryPath); |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 61 | } |
| 62 | catch (const sdbusplus::exception::SdBusError& e) |
| 63 | { |
| 64 | // Relying on property change or interface added to retry. |
| 65 | // Log an informational trace to the journal. |
Brandon Wyman | df13c3a | 2020-12-15 14:25:22 -0600 | [diff] [blame] | 66 | log<level::INFO>( |
| 67 | fmt::format("D-Bus property {} access failure exception", |
| 68 | inventoryPath) |
| 69 | .c_str()); |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 70 | } |
| 71 | } |
| 72 | |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 73 | void PowerSupply::analyze() |
| 74 | { |
| 75 | using namespace phosphor::pmbus; |
| 76 | |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 77 | if ((present) && (readFail < LOG_LIMIT)) |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 78 | { |
| 79 | try |
| 80 | { |
Brandon Wyman | fed0ba2 | 2020-09-26 20:02:51 -0500 | [diff] [blame] | 81 | statusWord = pmbusIntf->read(STATUS_WORD, Type::Debug); |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 82 | // Read worked, reset the fail count. |
| 83 | readFail = 0; |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 84 | |
| 85 | if (statusWord) |
| 86 | { |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 87 | statusMFR = pmbusIntf->read(STATUS_MFR, Type::Debug); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 88 | if (statusWord & status_word::INPUT_FAULT_WARN) |
| 89 | { |
| 90 | if (!inputFault) |
| 91 | { |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 92 | log<level::INFO>(fmt::format("INPUT fault: " |
| 93 | "status word = {:#04x}, " |
| 94 | "MFR fault = {:#02x}", |
| 95 | statusWord, statusMFR) |
| 96 | .c_str()); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | faultFound = true; |
| 100 | inputFault = true; |
| 101 | } |
| 102 | |
| 103 | if (statusWord & status_word::MFR_SPECIFIC_FAULT) |
| 104 | { |
| 105 | if (!mfrFault) |
| 106 | { |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 107 | log<level::ERR>(fmt::format("MFR fault: " |
| 108 | "status word = {:#04x} " |
| 109 | "MFR fault = {:#02x}", |
| 110 | statusWord, statusMFR) |
| 111 | .c_str()); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 112 | } |
| 113 | faultFound = true; |
| 114 | mfrFault = true; |
| 115 | } |
| 116 | |
| 117 | if (statusWord & status_word::VIN_UV_FAULT) |
| 118 | { |
| 119 | if (!vinUVFault) |
| 120 | { |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 121 | log<level::INFO>(fmt::format("VIN_UV fault: " |
| 122 | "status word = {:#04x}, " |
| 123 | "MFR fault = {:#02x}", |
| 124 | statusWord, statusMFR) |
| 125 | .c_str()); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | faultFound = true; |
| 129 | vinUVFault = true; |
| 130 | } |
| 131 | } |
| 132 | else |
| 133 | { |
| 134 | faultFound = false; |
| 135 | inputFault = false; |
| 136 | mfrFault = false; |
| 137 | vinUVFault = false; |
| 138 | } |
| 139 | } |
| 140 | catch (ReadFailure& e) |
| 141 | { |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 142 | readFail++; |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 143 | phosphor::logging::commit<ReadFailure>(); |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
Brandon Wyman | 59a3579 | 2020-06-04 12:37:40 -0500 | [diff] [blame] | 148 | void PowerSupply::onOffConfig(uint8_t data) |
| 149 | { |
| 150 | using namespace phosphor::pmbus; |
| 151 | |
| 152 | if (present) |
| 153 | { |
| 154 | log<level::INFO>("ON_OFF_CONFIG write", entry("DATA=0x%02X", data)); |
| 155 | try |
| 156 | { |
| 157 | std::vector<uint8_t> configData{data}; |
| 158 | pmbusIntf->writeBinary(ON_OFF_CONFIG, configData, |
| 159 | Type::HwmonDeviceDebug); |
| 160 | } |
| 161 | catch (...) |
| 162 | { |
| 163 | // The underlying code in writeBinary will log a message to the |
| 164 | // journal if the write fails. If the ON_OFF_CONFIG is not setup as |
| 165 | // desired, later fault detection and analysis code should catch any |
| 166 | // of the fall out. We should not need to terminate the application |
| 167 | // if this write fails. |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
Brandon Wyman | 3c20846 | 2020-05-13 16:25:58 -0500 | [diff] [blame] | 172 | void PowerSupply::clearFaults() |
| 173 | { |
Brandon Wyman | 5474c91 | 2021-02-23 14:39:43 -0600 | [diff] [blame] | 174 | faultLogged = false; |
Brandon Wyman | 3c20846 | 2020-05-13 16:25:58 -0500 | [diff] [blame] | 175 | // The PMBus device driver does not allow for writing CLEAR_FAULTS |
| 176 | // directly. However, the pmbus hwmon device driver code will send a |
| 177 | // CLEAR_FAULTS after reading from any of the hwmon "files" in sysfs, so |
| 178 | // reading in1_input should result in clearing the fault bits in |
| 179 | // STATUS_BYTE/STATUS_WORD. |
| 180 | // I do not care what the return value is. |
Brandon Wyman | 1115153 | 2020-11-10 13:45:57 -0600 | [diff] [blame] | 181 | if (present) |
Brandon Wyman | 3c20846 | 2020-05-13 16:25:58 -0500 | [diff] [blame] | 182 | { |
Brandon Wyman | 9564e94 | 2020-11-10 14:01:42 -0600 | [diff] [blame] | 183 | faultFound = false; |
| 184 | inputFault = false; |
| 185 | mfrFault = false; |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 186 | statusMFR = 0; |
Brandon Wyman | 9564e94 | 2020-11-10 14:01:42 -0600 | [diff] [blame] | 187 | vinUVFault = false; |
| 188 | readFail = 0; |
Brandon Wyman | 9564e94 | 2020-11-10 14:01:42 -0600 | [diff] [blame] | 189 | |
Brandon Wyman | 1115153 | 2020-11-10 13:45:57 -0600 | [diff] [blame] | 190 | try |
| 191 | { |
| 192 | static_cast<void>( |
| 193 | pmbusIntf->read("in1_input", phosphor::pmbus::Type::Hwmon)); |
| 194 | } |
| 195 | catch (ReadFailure& e) |
| 196 | { |
| 197 | // Since I do not care what the return value is, I really do not |
| 198 | // care much if it gets a ReadFailure either. However, this should |
| 199 | // not prevent the application from continuing to run, so catching |
| 200 | // the read failure. |
| 201 | } |
Brandon Wyman | 3c20846 | 2020-05-13 16:25:58 -0500 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 205 | void PowerSupply::inventoryChanged(sdbusplus::message::message& msg) |
| 206 | { |
| 207 | std::string msgSensor; |
Patrick Williams | abe4941 | 2020-05-13 17:59:47 -0500 | [diff] [blame] | 208 | std::map<std::string, std::variant<uint32_t, bool>> msgData; |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 209 | msg.read(msgSensor, msgData); |
| 210 | |
| 211 | // Check if it was the Present property that changed. |
| 212 | auto valPropMap = msgData.find(PRESENT_PROP); |
| 213 | if (valPropMap != msgData.end()) |
| 214 | { |
| 215 | if (std::get<bool>(valPropMap->second)) |
| 216 | { |
| 217 | present = true; |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 218 | // TODO: Immediately trying to read or write the "files" causes read |
| 219 | // or write failures. |
| 220 | using namespace std::chrono_literals; |
| 221 | std::this_thread::sleep_for(20ms); |
Brandon Wyman | 9564e94 | 2020-11-10 14:01:42 -0600 | [diff] [blame] | 222 | pmbusIntf->findHwmonDir(); |
Brandon Wyman | 59a3579 | 2020-06-04 12:37:40 -0500 | [diff] [blame] | 223 | onOffConfig(phosphor::pmbus::ON_OFF_CONFIG_CONTROL_PIN_ONLY); |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 224 | clearFaults(); |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 225 | updateInventory(); |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 226 | } |
| 227 | else |
| 228 | { |
| 229 | present = false; |
| 230 | |
| 231 | // Clear out the now outdated inventory properties |
| 232 | updateInventory(); |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | |
Brandon Wyman | 9a507db | 2021-02-25 16:15:22 -0600 | [diff] [blame] | 237 | void PowerSupply::inventoryAdded(sdbusplus::message::message& msg) |
| 238 | { |
| 239 | sdbusplus::message::object_path path; |
| 240 | msg.read(path); |
| 241 | // Make sure the signal is for the PSU inventory path |
| 242 | if (path == inventoryPath) |
| 243 | { |
| 244 | std::map<std::string, std::map<std::string, std::variant<bool>>> |
| 245 | interfaces; |
| 246 | // Get map of interfaces and their properties |
| 247 | msg.read(interfaces); |
| 248 | |
| 249 | auto properties = interfaces.find(INVENTORY_IFACE); |
| 250 | if (properties != interfaces.end()) |
| 251 | { |
| 252 | auto property = properties->second.find(PRESENT_PROP); |
| 253 | if (property != properties->second.end()) |
| 254 | { |
| 255 | present = std::get<bool>(property->second); |
| 256 | |
| 257 | log<level::INFO>(fmt::format("Power Supply {} Present {}", |
| 258 | inventoryPath, present) |
| 259 | .c_str()); |
| 260 | |
| 261 | updateInventory(); |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 267 | void PowerSupply::updateInventory() |
| 268 | { |
| 269 | using namespace phosphor::pmbus; |
| 270 | |
Chanh Nguyen | c12c53b | 2021-04-06 17:24:47 +0700 | [diff] [blame] | 271 | #if IBM_VPD |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 272 | std::string ccin; |
| 273 | std::string pn; |
| 274 | std::string fn; |
| 275 | std::string header; |
| 276 | std::string sn; |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 277 | using PropertyMap = |
George Liu | 070c1bc | 2020-10-12 11:28:01 +0800 | [diff] [blame] | 278 | std::map<std::string, |
| 279 | std::variant<std::string, std::vector<uint8_t>, bool>>; |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 280 | PropertyMap assetProps; |
George Liu | 070c1bc | 2020-10-12 11:28:01 +0800 | [diff] [blame] | 281 | PropertyMap operProps; |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 282 | PropertyMap versionProps; |
| 283 | PropertyMap ipzvpdDINFProps; |
| 284 | PropertyMap ipzvpdVINIProps; |
| 285 | using InterfaceMap = std::map<std::string, PropertyMap>; |
| 286 | InterfaceMap interfaces; |
| 287 | using ObjectMap = std::map<sdbusplus::message::object_path, InterfaceMap>; |
| 288 | ObjectMap object; |
| 289 | #endif |
| 290 | |
| 291 | if (present) |
| 292 | { |
| 293 | // TODO: non-IBM inventory updates? |
| 294 | |
Chanh Nguyen | c12c53b | 2021-04-06 17:24:47 +0700 | [diff] [blame] | 295 | #if IBM_VPD |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 296 | try |
| 297 | { |
| 298 | ccin = pmbusIntf->readString(CCIN, Type::HwmonDeviceDebug); |
| 299 | assetProps.emplace(MODEL_PROP, ccin); |
Adriana Kobylak | 572a905 | 2021-03-30 15:58:07 +0000 | [diff] [blame] | 300 | modelName = ccin; |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 301 | } |
| 302 | catch (ReadFailure& e) |
| 303 | { |
| 304 | // Ignore the read failure, let pmbus code indicate failure, path... |
| 305 | // TODO - ibm918 |
| 306 | // https://github.com/openbmc/docs/blob/master/designs/vpd-collection.md |
| 307 | // The BMC must log errors if any of the VPD cannot be properly |
| 308 | // parsed or fails ECC checks. |
| 309 | } |
| 310 | |
| 311 | try |
| 312 | { |
| 313 | pn = pmbusIntf->readString(PART_NUMBER, Type::HwmonDeviceDebug); |
| 314 | assetProps.emplace(PN_PROP, pn); |
| 315 | } |
| 316 | catch (ReadFailure& e) |
| 317 | { |
| 318 | // Ignore the read failure, let pmbus code indicate failure, path... |
| 319 | } |
| 320 | |
| 321 | try |
| 322 | { |
| 323 | fn = pmbusIntf->readString(FRU_NUMBER, Type::HwmonDeviceDebug); |
| 324 | } |
| 325 | catch (ReadFailure& e) |
| 326 | { |
| 327 | // Ignore the read failure, let pmbus code indicate failure, path... |
| 328 | } |
| 329 | |
| 330 | try |
| 331 | { |
| 332 | header = |
| 333 | pmbusIntf->readString(SERIAL_HEADER, Type::HwmonDeviceDebug); |
| 334 | sn = pmbusIntf->readString(SERIAL_NUMBER, Type::HwmonDeviceDebug); |
| 335 | assetProps.emplace(SN_PROP, sn); |
| 336 | } |
| 337 | catch (ReadFailure& e) |
| 338 | { |
| 339 | // Ignore the read failure, let pmbus code indicate failure, path... |
| 340 | } |
| 341 | |
| 342 | try |
| 343 | { |
Brandon Wyman | c9efe41 | 2020-10-09 15:42:50 -0500 | [diff] [blame] | 344 | fwVersion = |
| 345 | pmbusIntf->readString(FW_VERSION, Type::HwmonDeviceDebug); |
| 346 | versionProps.emplace(VERSION_PROP, fwVersion); |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 347 | } |
| 348 | catch (ReadFailure& e) |
| 349 | { |
| 350 | // Ignore the read failure, let pmbus code indicate failure, path... |
| 351 | } |
| 352 | |
| 353 | ipzvpdVINIProps.emplace("CC", |
| 354 | std::vector<uint8_t>(ccin.begin(), ccin.end())); |
| 355 | ipzvpdVINIProps.emplace("PN", |
| 356 | std::vector<uint8_t>(pn.begin(), pn.end())); |
| 357 | ipzvpdVINIProps.emplace("FN", |
| 358 | std::vector<uint8_t>(fn.begin(), fn.end())); |
| 359 | std::string header_sn = header + sn + '\0'; |
| 360 | ipzvpdVINIProps.emplace( |
| 361 | "SN", std::vector<uint8_t>(header_sn.begin(), header_sn.end())); |
| 362 | std::string description = "IBM PS"; |
| 363 | ipzvpdVINIProps.emplace( |
| 364 | "DR", std::vector<uint8_t>(description.begin(), description.end())); |
| 365 | |
| 366 | // Update the Resource Identifier (RI) keyword |
| 367 | // 2 byte FRC: 0x0003 |
| 368 | // 2 byte RID: 0x1000, 0x1001... |
| 369 | std::uint8_t num = std::stoul( |
| 370 | inventoryPath.substr(inventoryPath.size() - 1, 1), nullptr, 0); |
| 371 | std::vector<uint8_t> ri{0x00, 0x03, 0x10, num}; |
| 372 | ipzvpdDINFProps.emplace("RI", ri); |
| 373 | |
| 374 | // Fill in the FRU Label (FL) keyword. |
| 375 | std::string fl = "E"; |
| 376 | fl.push_back(inventoryPath.back()); |
| 377 | fl.resize(FL_KW_SIZE, ' '); |
| 378 | ipzvpdDINFProps.emplace("FL", |
| 379 | std::vector<uint8_t>(fl.begin(), fl.end())); |
| 380 | |
| 381 | interfaces.emplace(ASSET_IFACE, std::move(assetProps)); |
| 382 | interfaces.emplace(VERSION_IFACE, std::move(versionProps)); |
| 383 | interfaces.emplace(DINF_IFACE, std::move(ipzvpdDINFProps)); |
| 384 | interfaces.emplace(VINI_IFACE, std::move(ipzvpdVINIProps)); |
| 385 | |
George Liu | 070c1bc | 2020-10-12 11:28:01 +0800 | [diff] [blame] | 386 | // Update the Functional |
| 387 | operProps.emplace(FUNCTIONAL_PROP, present); |
| 388 | interfaces.emplace(OPERATIONAL_STATE_IFACE, std::move(operProps)); |
| 389 | |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 390 | auto path = inventoryPath.substr(strlen(INVENTORY_OBJ_PATH)); |
| 391 | object.emplace(path, std::move(interfaces)); |
| 392 | |
| 393 | try |
| 394 | { |
| 395 | auto service = |
| 396 | util::getService(INVENTORY_OBJ_PATH, INVENTORY_MGR_IFACE, bus); |
| 397 | |
| 398 | if (service.empty()) |
| 399 | { |
| 400 | log<level::ERR>("Unable to get inventory manager service"); |
| 401 | return; |
| 402 | } |
| 403 | |
| 404 | auto method = |
| 405 | bus.new_method_call(service.c_str(), INVENTORY_OBJ_PATH, |
| 406 | INVENTORY_MGR_IFACE, "Notify"); |
| 407 | |
| 408 | method.append(std::move(object)); |
| 409 | |
| 410 | auto reply = bus.call(method); |
| 411 | } |
| 412 | catch (std::exception& e) |
| 413 | { |
Jay Meyer | 6a3fd2c | 2020-08-25 16:37:16 -0500 | [diff] [blame] | 414 | log<level::ERR>( |
| 415 | std::string(e.what() + std::string(" PATH=") + inventoryPath) |
| 416 | .c_str()); |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 417 | } |
| 418 | #endif |
| 419 | } |
| 420 | } |
| 421 | |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 422 | } // namespace phosphor::power::psu |