linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Nishanth Menon <nm@ti.com>
Cc: paul@pwsan.com, khilman@linaro.org,
	Tony Lindgren <tony@atomide.com>,
	rnayak@ti.com, linux-kernel@vger.kernel.org, balbi@ti.com,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2] ARM: OMAP2+: omap_device: maintain sane runtime pm status around suspend/resume
Date: Wed, 13 Nov 2013 09:20:01 -0600	[thread overview]
Message-ID: <20131113152001.GC29226@saruman.home> (raw)
In-Reply-To: <52839306.7050701@ti.com>


[-- Attachment #1.1: Type: text/plain, Size: 1811 bytes --]

On Wed, Nov 13, 2013 at 08:56:06AM -0600, Nishanth Menon wrote:
> On 11/13/2013 06:51 AM, Felipe Balbi wrote:
> > Hi,
> > 
> > On Tue, Nov 12, 2013 at 05:08:30PM -0600, Nishanth Menon wrote:
> >> diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
> >> index b69dd9a..f97b34b 100644
> >> --- a/arch/arm/mach-omap2/omap_device.c
> >> +++ b/arch/arm/mach-omap2/omap_device.c
> >> @@ -621,6 +621,7 @@ static int _od_suspend_noirq(struct device *dev)
> >>  
> >>  	if (!ret && !pm_runtime_status_suspended(dev)) {
> >>  		if (pm_generic_runtime_suspend(dev) == 0) {
> >> +			pm_runtime_set_suspended(dev);
> > 
> > don't you have to disable pm_runtime around status changes ? Or is
> > pm_runtime already disabled by the time we get here ?
> 
> pm_runtime is already disabled by the time no_irq suspend is invoked.
> 
> > 
> >> @@ -634,10 +635,10 @@ static int _od_resume_noirq(struct device *dev)
> >>  	struct platform_device *pdev = to_platform_device(dev);
> >>  	struct omap_device *od = to_omap_device(pdev);
> >>  
> >> -	if ((od->flags & OMAP_DEVICE_SUSPENDED) &&
> >> -	    !pm_runtime_status_suspended(dev)) {
> >> +	if (od->flags & OMAP_DEVICE_SUSPENDED) {
> >>  		od->flags &= ~OMAP_DEVICE_SUSPENDED;
> >>  		omap_device_enable(pdev);
> >> +		pm_runtime_set_active(dev);
> > 
> > ditto, also pm_runtime_set_active() may fail.
> > 
> again, pm_runtime is not yet active here yet - we just restore the pm
> runtime state with which we went down with -> and that is not expected
> to fail either - So, how about just adding a WARN if our expectation
> of balanced operation was somehow broken in the future with changes to
> runtime framework?

you mean:

WARN(pm_runtime_set_active(dev));  ?

sounds good

thanks

-- 
balbi

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2013-11-13 15:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 23:08 [PATCH V2] ARM: OMAP2+: omap_device: maintain sane runtime pm status around suspend/resume Nishanth Menon
2013-11-13 12:51 ` Felipe Balbi
2013-11-13 14:56   ` Nishanth Menon
2013-11-13 15:20     ` Felipe Balbi [this message]
2013-11-13 15:28       ` Nishanth Menon
2013-11-13 15:45     ` Kevin Hilman
2013-11-13 16:19       ` Nishanth Menon
2013-11-14 17:05 ` [PATCH V3] " Nishanth Menon
2013-11-14 18:55   ` Felipe Balbi
2013-11-14 19:30     ` Nishanth Menon
2013-11-15  8:07   ` Paul Walmsley
2013-11-15 13:30     ` Nishanth Menon
2013-11-15 14:37       ` Tony Lindgren
2013-11-15 20:04         ` Paul Walmsley
2013-11-15 22:03         ` Kevin Hilman
2013-11-19 11:34           ` Ulf Hansson

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=20131113152001.GC29226@saruman.home \
    --to=balbi@ti.com \
    --cc=khilman@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=tony@atomide.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).