From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nishanth Menon Subject: Re: [PATCH 2/3] ARM: OMAP3+: PM: VP: check to ensure VP is idle before forceupdate Date: Thu, 31 May 2012 18:37:01 -0500 Message-ID: <20120531233700.GB23870@horus> References: <1337369601-14915-1-git-send-email-nm@ti.com> <1337369601-14915-3-git-send-email-nm@ti.com> <87vcjcvstk.fsf@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from na3sys009aog129.obsmtp.com ([74.125.149.142]:44179 "EHLO na3sys009aog129.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758672Ab2EaXhG (ORCPT ); Thu, 31 May 2012 19:37:06 -0400 Received: by obqv19 with SMTP id v19so2385906obq.8 for ; Thu, 31 May 2012 16:37:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87vcjcvstk.fsf@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Kevin Hilman Cc: Tony Lindgren , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vinay Amancha On 16:23-20120531, Kevin Hilman wrote: > Nishanth Menon writes: > > > 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 > > Cc: Kevin Hilman > > Cc: linux-omap@vger.kernel.org > > Cc: linux-arm-kernel@lists.infradead.org > > > > Signed-off-by: Vinay Amancha > > Signed-off-by: Nishanth Menon > > --- > > 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; > > > > +/* > > missing indent oops. will fix > > > + * 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); > > + > > Again, some clean failure and error recovery should be done here instead > of just a print and bail. thx - we should at least refuse to do forceupdate at this point. -- Regards, Nishanth Menon