summaryrefslogtreecommitdiff
path: root/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/0003-Fix-for-clearing-outstanding-requests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/0003-Fix-for-clearing-outstanding-requests.patch')
-rw-r--r--meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/0003-Fix-for-clearing-outstanding-requests.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/0003-Fix-for-clearing-outstanding-requests.patch b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/0003-Fix-for-clearing-outstanding-requests.patch
new file mode 100644
index 0000000000..1b7d47b01f
--- /dev/null
+++ b/meta-ibs/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/0003-Fix-for-clearing-outstanding-requests.patch
@@ -0,0 +1,63 @@
+From 3a528516ea20cac006c6a892b353faa25fe64e7f Mon Sep 17 00:00:00 2001
+From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Date: Mon, 20 Sep 2021 14:06:05 +0000
+Subject: [PATCH 3/3] 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 <mutyalax.jayaprakash@intel.com>
+Signed-off-by: Andrey V.Kosteltsev <AKosteltsev@IBS.RU>
+---
+ 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<int, uint8_t, uint8_t, uint8_t, uint8_t, std::vector<uint8_t>>
+ std::shared_ptr<IpmbRequest> 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<int, uint8_t, uint8_t, uint8_t, uint8_t, std::vector<uint8_t>>
+ return returnStatus(ipmbResponseStatus::error);
+ }
+
++ makeRequestValid(request);
+ uint8_t size = buffer.size();
+
+ const uint8_t slaveAddrIndex = 1;
+@@ -894,6 +894,7 @@ std::tuple<int, uint8_t, uint8_t, uint8_t, uint8_t, std::vector<uint8_t>>
+ std::vector<uint8_t> buffer(0);
+ if (request->ipmbToi2cConstruct(buffer) != 0)
+ {
++ makeRequestInvalid(*request);
+ return returnStatus(ipmbResponseStatus::error);
+ }
+
+@@ -929,7 +930,8 @@ std::tuple<int, uint8_t, uint8_t, uint8_t, uint8_t, std::vector<uint8_t>>
+ " 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.35.1
+