From: khilman@linaro.org (Kevin Hilman)
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 07:45:12 -0800 [thread overview]
Message-ID: <87vbzwl307.fsf@linaro.org> (raw)
In-Reply-To: <52839306.7050701@ti.com> (Nishanth Menon's message of "Wed, 13 Nov 2013 08:56:06 -0600")
Nishanth Menon <nm@ti.com> writes:
> 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?
And also a note in the changelog (or comment at the WARN) about the
assumption that runtime PM is disabled at this point.
Kevin
next prev parent reply other threads:[~2013-11-13 15:45 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
2013-11-13 15:28 ` Nishanth Menon
2013-11-13 15:45 ` Kevin Hilman [this message]
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=87vbzwl307.fsf@linaro.org \
--to=khilman@linaro.org \
--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).