devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: lee.jones@linaro.org
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org,
	Peter Ujfalusi <peter.ujfalusi@ti.com>
Subject: [PATCH 1/7] mfd: twl4030-power: Fix hang on reboot if sleep configuration was loaded earlier
Date: Tue, 13 May 2014 18:34:04 -0700	[thread overview]
Message-ID: <1400031250-29542-2-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1400031250-29542-1-git-send-email-tony@atomide.com>

Looks like we can still hit the issue of wrong load order of
twl4030 configuration. If we have a sleep configuration loaded,
and do a warm reset, the device can hang while initializing the
wakeup12 sequence. We do have a warning message about wrong order
of twl4030 configuration, but in this case it does not help as
the sleep configuration was loaded during the previous boot and
the state of twl4030 is maintained throughout the warm reset.

Fix the issue by clearing any existing sleep configuration
before we load the warm reset configuration.

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mfd/twl4030-power.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 96162b6..1b30d8a 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -421,6 +421,12 @@ static int load_twl4030_script(struct twl4030_script *tscript,
 			goto out;
 	}
 	if (tscript->flags & TWL4030_WAKEUP12_SCRIPT) {
+		/* Reset any existing sleep script to avoid hangs on reboot */
+		err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
+				       R_SEQ_ADD_A2S);
+		if (err)
+			goto out;
+
 		err = twl4030_config_wakeup12_sequence(address);
 		if (err)
 			goto out;
-- 
1.8.1.1


  reply	other threads:[~2014-05-14  1:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14  1:34 [PATCH v2 0/7] mfd: twl4030-power: Enable off-idle configuration when booted with device tree Tony Lindgren
2014-05-14  1:34 ` Tony Lindgren [this message]
2014-05-20 15:01   ` [PATCH 1/7] mfd: twl4030-power: Fix hang on reboot if sleep configuration was loaded earlier Lee Jones
2014-05-20 15:07     ` Tony Lindgren
2014-05-20 17:37       ` Lee Jones
2014-05-20 17:48         ` Tony Lindgren
2014-05-20 17:55           ` Lee Jones
2014-05-14  1:34 ` [PATCH 2/7] mfd: twl4030-power: Fix some defines for SW_EVENTS Tony Lindgren
2014-05-20 15:03   ` Lee Jones
2014-05-21  2:33     ` Tony Lindgren
2014-05-14  1:34 ` [PATCH 3/7] mfd: twl4030-power: Add generic reset configuration Tony Lindgren
2014-05-20 15:12   ` Lee Jones
2014-05-21  2:39     ` Tony Lindgren
2014-05-14  1:34 ` [PATCH 4/7] mfd: twl4030-power: Add recommended idle configuration Tony Lindgren
     [not found]   ` <1400031250-29542-5-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-05-20 15:14     ` Lee Jones
2014-05-21  2:44       ` Tony Lindgren
2014-05-14  1:34 ` [PATCH 5/7] mfd: twl4030-power: Add support for board specific configuration Tony Lindgren
2014-05-20 15:17   ` Lee Jones
2014-05-21  2:45     ` Tony Lindgren
2014-05-21  9:18       ` Lee Jones
2014-05-21 14:41         ` Tony Lindgren
2014-05-21 15:06           ` Lee Jones
2014-05-14  1:34 ` [PATCH 6/7] mfd: twl4030power: Add a configuration to turn off oscillator during off-idle Tony Lindgren
2014-05-14  1:34 ` [PATCH 7/7] ARM: dts: Enable twl4030 off-idle configuration for selected omaps Tony Lindgren
2014-05-21  9:23 ` [PATCH v2 0/7] mfd: twl4030-power: Enable off-idle configuration when booted with device tree Lee Jones
2014-05-21 14:49   ` Tony Lindgren
     [not found] ` <1400031250-29542-1-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-05-27 16:52   ` Lee Jones
2014-05-27 17:13     ` Tony Lindgren
2014-05-28  7:03       ` Lee Jones

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=1400031250-29542-2-git-send-email-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).