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

On 11/13/2013 09:20 AM, Felipe Balbi wrote:
> 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));  ?

yes

> 
> sounds good

Thanks. Will post a v3 tomorrow morning to give a chance for
discussions on further comments if any.

-- 
Regards,
Nishanth Menon

WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Menon <nm@ti.com>
To: balbi@ti.com
Cc: Tony Lindgren <tony@atomide.com>,
	paul@pwsan.com, rnayak@ti.com, khilman@linaro.org,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] ARM: OMAP2+: omap_device: maintain sane runtime pm status around suspend/resume
Date: Wed, 13 Nov 2013 09:28:07 -0600	[thread overview]
Message-ID: <52839A87.3020408@ti.com> (raw)
In-Reply-To: <20131113152001.GC29226@saruman.home>

On 11/13/2013 09:20 AM, Felipe Balbi wrote:
> 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));  ?

yes

> 
> sounds good

Thanks. Will post a v3 tomorrow morning to give a chance for
discussions on further comments if any.

-- 
Regards,
Nishanth Menon

WARNING: multiple messages have this Message-ID (diff)
From: nm@ti.com (Nishanth Menon)
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:28:07 -0600	[thread overview]
Message-ID: <52839A87.3020408@ti.com> (raw)
In-Reply-To: <20131113152001.GC29226@saruman.home>

On 11/13/2013 09:20 AM, Felipe Balbi wrote:
> 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));  ?

yes

> 
> sounds good

Thanks. Will post a v3 tomorrow morning to give a chance for
discussions on further comments if any.

-- 
Regards,
Nishanth Menon

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

Thread overview: 44+ 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-12 23:08 ` Nishanth Menon
2013-11-12 23:08 ` Nishanth Menon
2013-11-13 12:51 ` Felipe Balbi
2013-11-13 12:51   ` Felipe Balbi
2013-11-13 12:51   ` Felipe Balbi
2013-11-13 14:56   ` Nishanth Menon
2013-11-13 14:56     ` Nishanth Menon
2013-11-13 14:56     ` Nishanth Menon
2013-11-13 15:20     ` Felipe Balbi
2013-11-13 15:20       ` Felipe Balbi
2013-11-13 15:20       ` Felipe Balbi
2013-11-13 15:28       ` Nishanth Menon [this message]
2013-11-13 15:28         ` Nishanth Menon
2013-11-13 15:28         ` Nishanth Menon
2013-11-13 15:45     ` Kevin Hilman
2013-11-13 15:45       ` Kevin Hilman
2013-11-13 15:45       ` Kevin Hilman
2013-11-13 16:19       ` Nishanth Menon
2013-11-13 16:19         ` Nishanth Menon
2013-11-13 16:19         ` Nishanth Menon
2013-11-14 17:05 ` [PATCH V3] " Nishanth Menon
2013-11-14 17:05   ` Nishanth Menon
2013-11-14 17:05   ` Nishanth Menon
2013-11-14 18:55   ` Felipe Balbi
2013-11-14 18:55     ` Felipe Balbi
2013-11-14 18:55     ` Felipe Balbi
2013-11-14 19:30     ` Nishanth Menon
2013-11-14 19:30       ` Nishanth Menon
2013-11-14 19:30       ` Nishanth Menon
2013-11-15  8:07   ` Paul Walmsley
2013-11-15  8:07     ` Paul Walmsley
2013-11-15 13:30     ` Nishanth Menon
2013-11-15 13:30       ` Nishanth Menon
2013-11-15 13:30       ` Nishanth Menon
2013-11-15 14:37       ` Tony Lindgren
2013-11-15 14:37         ` Tony Lindgren
2013-11-15 20:04         ` Paul Walmsley
2013-11-15 20:04           ` Paul Walmsley
2013-11-15 22:03         ` Kevin Hilman
2013-11-15 22:03           ` Kevin Hilman
2013-11-19 11:34           ` Ulf Hansson
2013-11-19 11:34             ` Ulf Hansson
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=52839A87.3020408@ti.com \
    --to=nm@ti.com \
    --cc=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=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 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.