All of lore.kernel.org
 help / color / mirror / Atom feed
From: Partha Basak <p-basak2@ti.com>
To: balbi@ti.com
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Keshava Munegowda <keshava_mgowda@ti.com>,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, Anand Gadiyar <gadiyar@ti.com>,
	sameo@linux.intel.com, parthab@india.ti.com, tony@atomide.com,
	Kevin Hilman <khilman@ti.com>, Benoit Cousson <b-cousson@ti.com>,
	paul@pwsan.com, johnstul@us.ibm.com,
	Vishwanath Sripathy <vishwanath.bs@ti.com>
Subject: RE: [PATCH 6/6 v2] arm: omap: usb: global Suspend and resume support of ehci and ohci
Date: Mon, 4 Jul 2011 16:31:45 +0530	[thread overview]
Message-ID: <c026265b1b15473e41ea3c8cd72abf07@mail.gmail.com> (raw)
In-Reply-To: <20110704093056.GD25295@legolas.emea.dhcp.ti.com>

>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>owner@vger.kernel.org] On Behalf Of Felipe Balbi
>Sent: Monday, July 04, 2011 3:01 PM
>To: Partha Basak
>Cc: balbi@ti.com; Alan Stern; Keshava Munegowda; linux-
>usb@vger.kernel.org; linux-omap@vger.kernel.org; linux-
>kernel@vger.kernel.org; Anand Gadiyar; sameo@linux.intel.com;
>parthab@india.ti.com; tony@atomide.com; Kevin Hilman; Benoit Cousson;
>paul@pwsan.com; johnstul@us.ibm.com; Vishwanath Sripathy
>Subject: Re: [PATCH 6/6 v2] arm: omap: usb: global Suspend and resume
>support of ehci and ohci
>
>Hi,
>
>On Mon, Jul 04, 2011 at 02:56:30PM +0530, Partha Basak wrote:
>> >> Both for EHCI & OHCI, the clocks are owned by the parent (uhh-tll).
>> >>
>> >> Calling pm_runtime_put_sync(dev->parent) within omap_ehci_suspend
>> >> will turn-off the parent clocks in the Suspend path.
>> >>
>> >> Similarly, calling pm_runtime_get_sync(dev->parent) within
>> >> omap_ehci_resume will turn-on the parent clocks in the resume path.
>> >>
>> >> This way, all reference counting are implicit within the Runtime PM
>> >> layer and takes care of all combinations of only EHCI insmoded,
>> >> OHCI insmoded, both insmoded etc.
>> >>
>> >> When both EHCI & OHCI are suspended, parent clocks will actually be
>> >> turned OFF and vice-versa.
>> >
>> >not sure this is necessary. I would expect:
>> >
>> >pm_runtime_get_sync(dev) to propagate up the parent tree and enable
>> >all necessary resources to get the child in a working state. IOW, you
>> >shouldn't need to manuall access the parent device.
>> >
>> Refer to the description in Patch(5/6) <snip> In fact, the runtime
>> framework takes care the get sync and put sync of the child in turn
>> call the get sync and put sync of parent too; but calling get sync and
>> put sync of parent is by ASYNC mode; This mode queues the work item in
>> runtime pm work queue, which not getting scheduled in case of global
>> suspend path.
>> <snip>
>> This approach was tried, but did not work in the Suspend path
>
>sounds to me like a bug on pm runtime ? If you're calling
>pm_runtime_*_sync() family, shouldn't all calls be _sync() too ?
>
>> static int rpm_suspend(struct device *dev, int rpmflags)
>> 	__releases(&dev->power.lock) __acquires(&dev->power.lock) { .
>> .
>> .
>> no_callback:
>> .
>> .
>> .
>> 	/* Maybe the parent is now able to suspend. */
>> 	if (parent && !parent->power.ignore_children &&
>> !dev->power.irq_safe) {
>> 		spin_unlock(&dev->power.lock);
>>
>> 		spin_lock(&parent->power.lock);
>> 		rpm_idle(parent, RPM_ASYNC);
>
>to me this is bogus, if you called pm_runtime_put_sync() should should
>be sync too. Shouldn't it ?
>
>> 		spin_unlock(&parent->power.lock);
>>
>> 		spin_lock(&dev->power.lock);
>> 	}
>> This is the reason of directly calling the parent Runtime PM calls
>> from the children.
>> If directly calling Runtime PM APIs with parent dev-pointer isn't
>> acceptable, this can be achieved by exporting wrapper APIs from the
>> parent and calling them from the chidren .suspend/.resume routines.
>
>Still no good, IMHO.

Kevin, any comments?

Shouldn't the framework ensure that if put_sync(dev) is called
it should ensure that the parent is rmp_idled synchronously?
>
>--
>balbi

  reply	other threads:[~2011-07-04 11:01 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 18:54 [PATCH 0/6 V2] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers Keshava Munegowda
2011-07-01 18:54 ` Keshava Munegowda
2011-07-01 18:54 ` [PATCH 1/6 v2] arm: omap: usb: ehci and ohci hwmod structures for omap4 Keshava Munegowda
2011-07-01 18:54   ` Keshava Munegowda
2011-07-01 18:54   ` [PATCH 2/6 v2] arm: omap: usb: ehci and ohci hwmod structures for omap3 Keshava Munegowda
2011-07-01 18:54     ` Keshava Munegowda
2011-07-01 18:54     ` [PATCH 3/6 v2] arm: omap: usb: register hwmods of usbhs Keshava Munegowda
2011-07-01 18:54       ` Keshava Munegowda
2011-07-01 18:54       ` [PATCH 4/6 v2] arm: omap: usb: device name change for the clk names " Keshava Munegowda
2011-07-01 18:54         ` Keshava Munegowda
2011-07-01 18:54         ` [PATCH 5/6 v2] arm: omap: usb: Runtime PM support Keshava Munegowda
2011-07-01 18:54           ` Keshava Munegowda
2011-07-01 18:54           ` [PATCH 6/6 v2] arm: omap: usb: global Suspend and resume support of ehci and ohci Keshava Munegowda
2011-07-01 18:54             ` Keshava Munegowda
2011-07-01 19:06             ` Alan Stern
2011-07-01 19:06               ` Alan Stern
2011-07-04  5:06               ` Partha Basak
2011-07-04  5:06                 ` Partha Basak
2011-07-04  8:25                 ` Felipe Balbi
2011-07-04  8:25                   ` Felipe Balbi
2011-07-04  9:26                   ` Partha Basak
2011-07-04  9:26                     ` Partha Basak
2011-07-04  9:30                     ` Felipe Balbi
2011-07-04 11:01                       ` Partha Basak [this message]
2011-07-04 16:01                       ` Alan Stern
2011-07-04 16:01                         ` Alan Stern
2011-07-05 12:52                         ` Felipe Balbi
2011-07-05 14:17                           ` Alan Stern
2011-07-05 14:17                             ` Alan Stern
2011-07-05 15:53                             ` Felipe Balbi
2011-07-05 16:28                               ` Alan Stern
2011-07-05 16:28                                 ` Alan Stern
2011-07-04 15:50                 ` Alan Stern
2011-07-04 15:50                   ` Alan Stern
2011-07-05 14:00                   ` Partha Basak
2011-07-05 14:22                     ` Alan Stern
2011-07-05 14:22                       ` Alan Stern
2011-07-05 17:37                       ` Kevin Hilman
2011-07-05 17:37                         ` Kevin Hilman
2011-07-06 17:54                         ` Felipe Balbi
2011-07-06 19:20                           ` Kevin Hilman
2011-07-06 19:20                             ` Kevin Hilman
2011-07-06 22:17                             ` Felipe Balbi
2011-07-07  4:53                               ` Partha Basak
2011-07-07  4:53                                 ` Partha Basak
2011-07-07  7:28                                 ` Felipe Balbi
2011-07-07 10:29   ` [PATCH 1/6 v2] arm: omap: usb: ehci and ohci hwmod structures for omap4 Felipe Balbi
2011-07-07 15:57     ` Kevin Hilman
2011-07-04 17:25 ` [PATCH 0/6 V2] arm: omap: usb: Runtime PM support for EHCI and OHCI drivers Samuel Ortiz

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=c026265b1b15473e41ea3c8cd72abf07@mail.gmail.com \
    --to=p-basak2@ti.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=gadiyar@ti.com \
    --cc=johnstul@us.ibm.com \
    --cc=keshava_mgowda@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=parthab@india.ti.com \
    --cc=paul@pwsan.com \
    --cc=sameo@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tony@atomide.com \
    --cc=vishwanath.bs@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.