All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Kalliguddi, Hema" <hemahk@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"Mankad, Maulik Ojas" <x0082077@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	"Cousson, Benoit" <b-cousson@ti.com>,
	Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH 9/9 v3] usb : musb: Offmode fix for idle path
Date: Thu, 23 Sep 2010 10:52:37 -0700	[thread overview]
Message-ID: <87zkv81h5m.fsf@deeprootsystems.com> (raw)
In-Reply-To: <E0D41E29EB0DAC4E9F3FF173962E9E94027863DD49@dbde02.ent.ti.com> (Hema Kalliguddi's message of "Thu, 23 Sep 2010 21:07:22 +0530")

"Kalliguddi, Hema" <hemahk@ti.com> writes:

[...]

>>>>
>>>> static u64 musb_dmamask = DMA_BIT_MASK(32);
>>>>@@ -80,6 +89,7 @@ void __init usb_musb_init(struct omap_mu
>>>> 	const char *oh_name = "usb_otg_hs";
>>>> 	struct musb_hdrc_platform_data *pdata;
>>>>
>>>>+	core_pwrdm = pwrdm_lookup("per_pwrdm");
>>>
>>>per or core ???
>>>
>>Oh! It should be core. Now I understand why save/restore 
>>counts were not matching with
>>Core-off counts.
>>Thanks for pointing this out.
>
> If I call pm_runtime_put_sync and pm_runtime_get_sync based on the core domain state then
> the USB connect/reset interrupt is not triggered once the core hits off.
>
> In omap3_enter_idle_bm() there is no core next state being programmed to PRCM register,
>
> but the drivers functions which are called from omap3_device_idle are suppose to read the
> core next state from the PRCM register.
> I am missing something here?

Ah, this is indeed a big problem.  Good catch.

Both the CORE and MPU states are programmed in omap3_enter_idle(), but
that doesn't happen until after omap3_device_idle().  hmmm....

> If I use the per_pwrdm states to save the context and restore everything works fine.

Yes, because PER is programmed in omap3_enter_idle_bm() so it's
available already in the registers.

I've updated my "idle reorg" series which creates omap3_device_idle &
_resume (and enables interrupts in CPUidle.)   I updated it to
not call omap3_device_idle until the MPU & CORE registers are
programmed (diff below.)  This is in my pm-wip/idle-reorg branch, which
is based on pm-core.

Thanks,

Kevin

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index cf4207f..51fef17 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -125,14 +125,16 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 
 	current_cx_state = *cx;
 
-	/* Used to keep track of the total time in idle */
-	getnstimeofday(&ts_preidle);
+	pwrdm_set_next_pwrst(mpu_pd, mpu_state);
+	pwrdm_set_next_pwrst(core_pd, core_state);
+
+	omap3_device_idle();
 
 	local_irq_disable();
 	local_fiq_disable();
 
-	pwrdm_set_next_pwrst(mpu_pd, mpu_state);
-	pwrdm_set_next_pwrst(core_pd, core_state);
+	/* Used to keep track of the total time in idle */
+	getnstimeofday(&ts_preidle);
 
 	if (omap_irq_pending() || need_resched())
 		goto return_sleep_time;
@@ -157,6 +159,8 @@ return_sleep_time:
 	local_irq_enable();
 	local_fiq_enable();
 
+	omap3_device_resume();
+
 	return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC;
 }
 

  reply	other threads:[~2010-09-23 17:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23  0:30 [PATCH 9/9 v3] usb : musb: Offmode fix for idle path Hema HK
2010-09-23  5:50 ` Maulik
     [not found]   ` <CE25F9D2A56A423C84BED8BC132A07FB-wD+IZp/g4/2mHdYHvhjUOg@public.gmane.org>
2010-09-23  9:47     ` Sergei Shtylyov
     [not found] ` <1285201846-26599-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org>
2010-09-23  6:49   ` Felipe Balbi
2010-09-23  6:53     ` Felipe Balbi
2010-09-23  7:59     ` Kalliguddi, Hema
     [not found]       ` <E0D41E29EB0DAC4E9F3FF173962E9E94027863D9EB-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-09-23  8:10         ` Felipe Balbi
2010-09-23 15:37       ` Kalliguddi, Hema
2010-09-23 17:52         ` Kevin Hilman [this message]
2010-09-24 19:41 ` Kevin Hilman
2010-09-27  5:19   ` Kalliguddi, Hema
     [not found]     ` <E0D41E29EB0DAC4E9F3FF173962E9E9402DB3F8825-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-09-27 18:56       ` Kevin Hilman
2010-09-28  4:37         ` Kalliguddi, Hema
     [not found]           ` <E0D41E29EB0DAC4E9F3FF173962E9E9402DB3F8F1E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-09-28  5:18             ` Kalliguddi, Hema
2010-09-28 15:43           ` Kevin Hilman
     [not found]             ` <87y6alho0d.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2010-09-30 11:29               ` Kalliguddi, Hema

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=87zkv81h5m.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=b-cousson@ti.com \
    --cc=hemahk@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.com \
    --cc=x0082077@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 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.