From aa2030c2fb261ec9c3e43a04afdf8b7602d20258 Mon Sep 17 00:00:00 2001 From: Anthony Wilson Date: Tue, 26 Mar 2019 17:05:50 -0500 Subject: cleanupPCIE: Catch file_error::Open exception The bus that is read may only show up at certain times, such as during poweron. It is not a fatal error condition if the bus is not available. So we will let it get logged to the journal, but not let it get committed in this case. Tested: It was an intermittent failure, but ran poweron/poweroff a few times and didn't see the error pop up again. Resolves: openbmc/openbmc#3510 Change-Id: I47629e5f27fb847aa0094f0757b1988f8e645ebc Signed-off-by: Anthony Wilson --- procedures/p9/cleanup_pcie.cpp | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/procedures/p9/cleanup_pcie.cpp b/procedures/p9/cleanup_pcie.cpp index 8d1145a..68b6649 100644 --- a/procedures/p9/cleanup_pcie.cpp +++ b/procedures/p9/cleanup_pcie.cpp @@ -19,6 +19,7 @@ #include "targeting.hpp" #include +#include namespace openpower { @@ -29,6 +30,7 @@ using namespace phosphor::logging; using namespace openpower::cfam::access; using namespace openpower::cfam::p9; using namespace openpower::targeting; +namespace file_error = sdbusplus::xyz::openbmc_project::Common::File::Error; /** * @brief Disables PCIE drivers and receiver in the PCIE root ctrl 1 register @@ -36,24 +38,31 @@ using namespace openpower::targeting; */ void cleanupPcie() { - Targeting targets; + try + { + Targeting targets; - log("Running P9 procedure cleanupPcie"); + log("Running P9 procedure cleanupPcie"); - // Disable the PCIE drivers and receiver on all CPUs - for (const auto& target : targets) - { - try - { - writeReg(target, P9_ROOT_CTRL1_CLEAR, 0x00001C00); - } - catch (std::exception& e) + // Disable the PCIE drivers and receiver on all CPUs + for (const auto& target : targets) { - // Don't need an error log coming from the power off - // path, just keep trying on the other processors. - continue; + try + { + writeReg(target, P9_ROOT_CTRL1_CLEAR, 0x00001C00); + } + catch (std::exception& e) + { + // Don't need an error log coming from the power off + // path, just keep trying on the other processors. + continue; + } } } + catch (file_error::Open& e) + { + // For this procedure we can ignore the ::Open error + } } REGISTER_PROCEDURE("cleanupPcie", cleanupPcie); -- cgit v1.2.1