From e107bdc375aa23a4c0a3d23978cfe8b378bce09a Mon Sep 17 00:00:00 2001 From: Jayaprakash Mutyala Date: Mon, 20 Sep 2021 14:06:05 +0000 Subject: [PATCH] Fix for clearing outstanding requests IPMB requests were made valid even if there was an error in opening the mux bus. This fix makes the IPMB requests valid only we were able to successfully open the Mux fd. Tested: Verified using busctl command. Command: busctl call xyz.openbmc_project.Ipmi.Channel.Ipmb /xyz/openbmc_project/Ipmi/Channel/Ipmb org.openbmc.Ipmb sendRequest yyyyay 0 0x30 0 0x70 2 0 32 Response: (iyyyyay) 0 49 0 112 193 0 Signed-off-by: Jayaprakash Mutyala --- ipmbbridged.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ipmbbridged.cpp b/ipmbbridged.cpp index 3ffc1f7..0508fcc 100644 --- a/ipmbbridged.cpp +++ b/ipmbbridged.cpp @@ -801,7 +801,6 @@ std::tuple> std::shared_ptr request, const uint8_t pcieSlot) { - makeRequestValid(request); std::filesystem::path p = "/dev/i2c-mux/PCIE_Mux/Pcie_Slot_" + std::to_string(pcieSlot); @@ -825,6 +824,7 @@ std::tuple> return returnStatus(ipmbResponseStatus::error); } + makeRequestValid(request); uint8_t size = buffer.size(); const uint8_t slaveAddrIndex = 1; @@ -894,6 +894,7 @@ std::tuple> std::vector buffer(0); if (request->ipmbToi2cConstruct(buffer) != 0) { + makeRequestInvalid(*request); return returnStatus(ipmbResponseStatus::error); } @@ -929,7 +930,8 @@ std::tuple> " To avoid log storm, not all the logs for the " "issue will be shown: "; } - if (!(requestAddLogCount % ipmbRequestAddLogInterval) && (requestAddLogCount != 0)) + if (!(requestAddLogCount % ipmbRequestAddLogInterval) && + (requestAddLogCount != 0)) { msgToLog = "requestAdd: There are " + std::to_string(requestAddLogCount) + -- 2.17.1