diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-07-31 20:43:37 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-08-01 18:19:38 +0300 |
commit | d0f63ef62c76c932a2003eaa42c0b250065ae06f (patch) | |
tree | 4c0e3cb32dc80f80460bdbf82ff6d401d4ff194f /meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch | |
parent | b4f66bacb1b8e661d794fa7a189e2f66f5092e2e (diff) | |
download | openbmc-d0f63ef62c76c932a2003eaa42c0b250065ae06f.tar.xz |
Update to internal 7-31-19
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch deleted file mode 100644 index 42bb682c4..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch +++ /dev/null @@ -1,76 +0,0 @@ -From f51bef8f7c5785405ee5c83a921efb1bc05e4947 Mon Sep 17 00:00:00 2001 -From: Yong Li <yong.b.li@linux.intel.com> -Date: Wed, 27 Mar 2019 16:11:25 +0800 -Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9CAC=20failed=E2=80=9D=20bit=20sup?= - =?UTF-8?q?port=20for=20get=20chassis=20status=20command?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -PFail property is provided by power control service, -ture means the booting is from AC loss. - -Tested: -Remove the AC cable and reconnect it -Ipmitool chassis status to check the status: -Last Power Event : ac-failed - -Signed-off-by: Yong Li <yong.b.li@linux.intel.com> ---- - chassishandler.cpp | 26 ++++++++++++++++++++++++++ - 1 file changed, 26 insertions(+) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 7a522ad..40d2018 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -844,6 +844,7 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - sd_bus_message* reply = NULL; - int r = 0; - int pgood = 0; -+ bool pFail = true; - char* busname = NULL; - ipmi_ret_t rc = IPMI_CC_OK; - ipmi_get_chassis_status_t chassis_status{}; -@@ -904,6 +905,26 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - goto finish; - } - -+ r = sd_bus_get_property(bus, busname, objname, intf, "PFail", NULL, &reply, -+ "b"); -+ if (r < 0) -+ { -+ log<level::ERR>("Failed to call sd_bus_get_property", -+ entry("PROPERTY=%s", "PFail"), entry("ERRNO=0x%X", -r), -+ entry("BUS=%s", busname), entry("PATH=%s", objname), -+ entry("INTERFACE=%s", intf)); -+ rc = IPMI_CC_UNSPECIFIED_ERROR; -+ goto finish; -+ } -+ -+ r = sd_bus_message_read(reply, "b", &pFail); -+ if (r < 0) -+ { -+ log<level::ERR>("Failed to read PFail:", entry("ERRNO=0x%X", -r)); -+ rc = IPMI_CC_UNSPECIFIED_ERROR; -+ goto finish; -+ } -+ - s = dbusToIpmi.at(powerRestore); - - // Current Power State -@@ -952,6 +973,11 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - - chassis_status.last_power_event = 0; - -+ if (pFail) -+ { -+ chassis_status.last_power_event |= 1; -+ } -+ - // Misc. Chassis State - // [7] – reserved - // [6] – 1b = Chassis Identify command and state info supported (Optional) --- -2.7.4 - |