public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Kevin Hilman <khilman@ti.com>
Cc: Nishanth Menon <nm@ti.com>, Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Vinay Amancha <vinaykumar@ti.com>
Subject: [PATCH 2/3] ARM: OMAP3+: PM: VP: check to ensure VP is idle before forceupdate
Date: Fri, 18 May 2012 14:33:20 -0500	[thread overview]
Message-ID: <1337369601-14915-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1337369601-14915-1-git-send-email-nm@ti.com>

Ideally in the flow of DVFS programming, VP should be in idle state
(since we disabled it) before entering forceupdate. Ensure that
this is the case. Not doing this could cause VP statemachine
to enter invalid states.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org

Signed-off-by: Vinay Amancha <vinaykumar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/vp.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index 925d869..985091b 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -123,6 +123,18 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
 	u8 target_vsel, current_vsel;
 	int ret, timeout = 0;
 
+/*
+	 * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us
+	 * This is an additional allowance to ensure we are in proper state
+	 * to enter into forceupdate state transition.
+	 */
+	omap_test_timeout((voltdm->read(vp->vstatus)),
+			  VP_IDLE_TIMEOUT, timeout);
+
+	if (timeout >= VP_IDLE_TIMEOUT)
+		pr_warning("%s: vdd_%s idle timedout forceupdate(v=%ld)\n",
+			   __func__, voltdm->name, target_volt);
+
 	ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, &current_vsel);
 	if (ret)
 		return ret;
-- 
1.7.9.5


  parent reply	other threads:[~2012-05-18 19:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[PATCH] ARM: OMAP3+: PM: VP: ensure VP is idle before disable>
2012-05-18 18:18 ` [PATCH V2] ARM: OMAP3+: PM: VP: ensure VP is idle before disable Nishanth Menon
2012-05-19  9:52   ` Eduardo Valentin
2012-05-21 13:36     ` Menon, Nishanth
2012-05-21 14:51       ` Eduardo Valentin
2012-05-21 15:14         ` Menon, Nishanth
2012-05-22  7:02           ` Valentin, Eduardo
2012-05-18 19:33 ` [PATCH 0/3] ARM: OMAP3+: VP: collate fixes Nishanth Menon
2012-05-18 19:33   ` [PATCH 1/3] ARM: OMAP3+: PM: VP: ensure VP is idle before disable Nishanth Menon
2012-05-31 23:21     ` Kevin Hilman
2012-05-31 23:28       ` Kevin Hilman
2012-05-31 23:35       ` Nishanth Menon
2012-05-18 19:33   ` Nishanth Menon [this message]
2012-05-31 23:23     ` [PATCH 2/3] ARM: OMAP3+: PM: VP: check to ensure VP is idle before forceupdate Kevin Hilman
2012-05-31 23:37       ` Nishanth Menon
2012-05-18 19:33   ` [PATCH 3/3] ARM: OMAP3+: PM: VP: check only the VPINIDLE status bit Nishanth Menon
2012-05-31 23:27     ` Kevin Hilman
2012-05-31 23:39       ` Nishanth Menon

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=1337369601-14915-3-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=vinaykumar@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