summaryrefslogtreecommitdiffstats
path: root/pychassisctl
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2016-06-30 10:45:01 -0500
committerAndrew Geissler <andrewg@us.ibm.com>2016-07-01 13:20:06 -0500
commit6b63e9a709859805b912f63bf42a50ca5b49f054 (patch)
tree9f556798fa08dd65ce31ef1b666b70e7c406c7d7 /pychassisctl
parentb7f40b52730f9af7dbe31aecab4f21f985936297 (diff)
downloadtalos-skeleton-6b63e9a709859805b912f63bf42a50ca5b49f054.tar.gz
talos-skeleton-6b63e9a709859805b912f63bf42a50ca5b49f054.zip
Disable watchdog timer if debug_mode is set
resolves openbmc/openbmc#246 debug_mode is used when the host is not going to be started. In this case, we do not want the watchdog timer to be started because there is no one to keep it from resetting. This code change prevents the watchdog from being started during poweron. Potential side affects could be if we do start the host in this code path. The watchdog is un-tested when it's not started but software comes in and tries to reset it. The code in control_host_obj.c currently enforces the no-host-power-on when debug_mode is set.
Diffstat (limited to 'pychassisctl')
-rwxr-xr-x[-rw-r--r--]pychassisctl/chassis_control.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/pychassisctl/chassis_control.py b/pychassisctl/chassis_control.py
index 8d34e2e..56a2116 100644..100755
--- a/pychassisctl/chassis_control.py
+++ b/pychassisctl/chassis_control.py
@@ -67,6 +67,11 @@ class ChassisControlObject(DbusProperties, DbusObjectManager):
'object_name': '/org/openbmc/settings/host0',
'interface_name': 'org.freedesktop.DBus.Properties'
},
+ 'host_control': {
+ 'bus_name': 'org.openbmc.control.Host',
+ 'object_name': '/org/openbmc/control/host0',
+ 'interface_name': 'org.openbmc.control.Host'
+ },
}
# uuid
@@ -129,11 +134,22 @@ class ChassisControlObject(DbusProperties, DbusObjectManager):
if (self.getPowerState() == 0):
intf = self.getInterface('power_control')
intf.setPowerState(POWER_ON)
- intfwatchdog = self.getInterface('watchdog')
- # Start watchdog with 30s timeout per the OpenPower Host IPMI Spec
- #Once the host starts booting, it'll reset and refresh the timer
- intfwatchdog.set(30000)
- intfwatchdog.start()
+
+ # Determine if debug_mode is set. If it is then we don't
+ # want to start the watchdog since debug mode
+ intfcontrol = self.getInterface('host_control')
+ intfproperties = dbus.Interface(intfcontrol,
+ "org.freedesktop.DBus.Properties")
+ debug_mode = intfproperties.Get('org.openbmc.control.Host',
+ 'debug_mode')
+ if(not debug_mode):
+ intfwatchdog = self.getInterface('watchdog')
+ # Start watchdog with 30s timeout per the OpenPower Host IPMI Spec
+ #Once the host starts booting, it'll reset and refresh the timer
+ intfwatchdog.set(30000)
+ intfwatchdog.start()
+ else:
+ print "Debug mode is on, no watchdog"
return None
@dbus.service.method(DBUS_NAME,
OpenPOWER on IntegriCloud