From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [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>
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131113/01bd71b0/attachment.sig>
next prev parent 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=linux-arm-kernel@lists.infradead.org \
/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).