summaryrefslogtreecommitdiffstats
path: root/op-pwrctl
diff options
context:
space:
mode:
authorYong Li <yong.b.li@linux.intel.com>2018-04-04 13:01:23 +0800
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-04-09 17:48:14 +0000
commit1acfd753dc9eba1fdb46f8c3ddf4121b578da8c8 (patch)
tree890dd1647272bfecdadc8904ae55c5ab55cdca6d /op-pwrctl
parent5a38763fcd44cdcf7390174423790a50bf76d091 (diff)
downloadtalos-skeleton-1acfd753dc9eba1fdb46f8c3ddf4121b578da8c8.tar.gz
talos-skeleton-1acfd753dc9eba1fdb46f8c3ddf4121b578da8c8.zip
Add error handing to recovery from gpio config failure
Sometimes these chassis related services will fail with below error: Power GPIO: call to getGpioConfiguration failed: GDBus.Error:org.freedesktop.DBus.Error.Service Unknown: The name org.openbmc.managers.System was not provided by any .service files These gpio pins cannot be configured properly, and cannot power on/off host. Add error handing to terminate the service in such error, systemd will restart them to try again Change-Id: I3ce7383825f2b9715fdd82e1dec0725cef83073c Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Diffstat (limited to 'op-pwrctl')
-rw-r--r--op-pwrctl/power_control_obj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/op-pwrctl/power_control_obj.c b/op-pwrctl/power_control_obj.c
index 19ce118..e9c9673 100644
--- a/op-pwrctl/power_control_obj.c
+++ b/op-pwrctl/power_control_obj.c
@@ -462,11 +462,13 @@ on_bus_acquired(GDBusConnection *connection,
if(read_gpios(connection, &g_gpio_configs) != TRUE) {
g_print("ERROR PowerControl: could not read power GPIO configuration\n");
+ exit(-1);
}
int rc = set_up_gpio(connection, &g_gpio_configs.power_gpio, control_power);
if(rc != GPIO_OK) {
g_print("ERROR PowerControl: GPIO setup (rc=%d)\n",rc);
+ exit(-1);
}
//start poll
pgood_timeout_start = 0;
@@ -474,6 +476,7 @@ on_bus_acquired(GDBusConnection *connection,
int pgood_timeout = atoi(cmd->argv[2]);
if(poll_interval < 500 || pgood_timeout <5) {
g_print("ERROR PowerControl: poll_interval < 500 or pgood_timeout < 5\n");
+ exit(-1);
} else {
control_set_poll_interval(control,poll_interval);
control_power_set_pgood_timeout(control_power,pgood_timeout);
OpenPOWER on IntegriCloud