All of lore.kernel.org
 help / color / mirror / Atom feed
From: OpenBMC Patches <openbmc-patches@stwcx.xyz>
To: openbmc@lists.ozlabs.org
Cc: Andrew Geissler <andrewg@us.ibm.com>
Subject: [PATCH skeleton v2 2/2] Disable watchdog timer if debug_mode is set
Date: Thu, 30 Jun 2016 10:50:53 -0500	[thread overview]
Message-ID: <20160630155053.1349-3-openbmc-patches@stwcx.xyz> (raw)
In-Reply-To: <20160630155053.1349-1-openbmc-patches@stwcx.xyz>

From: Andrew Geissler <andrewg@us.ibm.com>

https://github.com/openbmc/openbmc/issues/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.
---
 pychassisctl/chassis_control.py | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)
 mode change 100644 => 100755 pychassisctl/chassis_control.py

diff --git a/pychassisctl/chassis_control.py b/pychassisctl/chassis_control.py
old mode 100644
new mode 100755
index 8d34e2e..9ca2fc9
--- 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'
             },
+            '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('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,
-- 
2.9.0

      parent reply	other threads:[~2016-06-30 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 15:50 [PATCH skeleton v2 0/2] Disable watchdog timer if debug_mode is set OpenBMC Patches
2016-06-30 15:50 ` [PATCH skeleton v2 1/2] Reformat pychassisctl/chassis_control.py with pep8 standards OpenBMC Patches
2016-06-30 15:50 ` OpenBMC Patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160630155053.1349-3-openbmc-patches@stwcx.xyz \
    --to=openbmc-patches@stwcx.xyz \
    --cc=andrewg@us.ibm.com \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.