summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2017-06-08 11:18:35 -0500
committerAndrew Geissler <andrewg@us.ibm.com>2017-06-08 11:18:35 -0500
commit2b4e459867d6b6693676c483958ec899be140316 (patch)
tree4ad9b7e146712801716da5bb0e689473cd95f3af
parent5f4fe3c3165ae4266f8a50ecb7f8488cb6ca7035 (diff)
downloadphosphor-host-ipmid-2b4e459867d6b6693676c483958ec899be140316.tar.gz
phosphor-host-ipmid-2b4e459867d6b6693676c483958ec899be140316.zip
Call softoff dbus interface directly
The host response can be extremely fast when requesting a soft power off. So fast in fact, that it may respond before the obmc mapper has registered the softoff dbus object and interface. When this happens, ipmid does not see softoff running so it goes down a different (and incorrect) shutdown path. This code change has the host response go directly to the softoff dbus interface (instead of using mapper). Once mapper is refactored in openbmc/openbmc#1661, this software can go back to using it. Resolves openbmc/openbmc#1743 Change-Id: I08df84783adef80c4eb91277d8d7aa6dc264730d Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
-rw-r--r--chassishandler.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 5dc23b2..6c23350 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -825,22 +825,28 @@ int stop_soft_off_timer()
constexpr auto property = "ResponseReceived";
constexpr auto value = "xyz.openbmc_project.Ipmi.Internal."
"SoftPowerOff.HostResponse.HostShutdown";
- char *busname = nullptr;
// Get the system bus where most system services are provided.
auto bus = ipmid_get_sd_bus_connection();
// Get the service name
- auto r = mapper_get_service(bus, SOFTOFF_OBJPATH, &busname);
- if (r < 0)
- {
- fprintf(stderr, "Failed to get %s bus name: %s\n",
- SOFTOFF_OBJPATH, strerror(-r));
- return r;
- }
+ // TODO openbmc/openbmc#1661 - Mapper refactor
+ //
+ // See openbmc/openbmc#1743 for some details but high level summary is that
+ // for now the code will directly call the soft off interface due to a
+ // race condition with mapper usage
+ //
+ //char *busname = nullptr;
+ //auto r = mapper_get_service(bus, SOFTOFF_OBJPATH, &busname);
+ //if (r < 0)
+ //{
+ // fprintf(stderr, "Failed to get %s bus name: %s\n",
+ // SOFTOFF_OBJPATH, strerror(-r));
+ // return r;
+ //}
// No error object or reply expected.
- int rc = sd_bus_call_method(bus, busname, SOFTOFF_OBJPATH, iface,
+ int rc = sd_bus_call_method(bus, SOFTOFF_BUSNAME, SOFTOFF_OBJPATH, iface,
"Set", nullptr, nullptr, "ssv",
soft_off_iface, property, "s", value);
if (rc < 0)
@@ -849,7 +855,8 @@ int stop_soft_off_timer()
strerror(-rc));
}
- free(busname);
+ //TODO openbmc/openbmc#1661 - Mapper refactor
+ //free(busname);
return rc;
}
OpenPOWER on IntegriCloud