public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM: runtime: add missed pm_request_autosuspend
@ 2010-09-27 10:54 tom.leiming
  2010-09-27 13:54 ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: tom.leiming @ 2010-09-27 10:54 UTC (permalink / raw)
  To: rjw, stern; +Cc: linux-pm

From: Ming Lei <tom.leiming@gmail.com>

Commit 5789bdd542c6bfbb662915c67bffc14198aa5dda
[PM / Runtime: Implement autosuspend support] introduces
"autosuspend" facility for runtime PM, but misses
helper function of pm_request_autosuspend, so add it.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 include/linux/pm_runtime.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 99ed1aa..3ec2358 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
 	return __pm_runtime_resume(dev, RPM_ASYNC);
 }
 
+static inline int pm_request_autosuspend(struct device *dev)
+{
+	return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
+}
+
 static inline int pm_runtime_get(struct device *dev)
 {
 	return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM: runtime: add missed pm_request_autosuspend
  2010-09-27 10:54 [PATCH] PM: runtime: add missed pm_request_autosuspend tom.leiming
@ 2010-09-27 13:54 ` Alan Stern
  2010-09-27 14:28   ` Ming Lei
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Stern @ 2010-09-27 13:54 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-pm

On Mon, 27 Sep 2010 tom.leiming@gmail.com wrote:

> From: Ming Lei <tom.leiming@gmail.com>
> 
> Commit 5789bdd542c6bfbb662915c67bffc14198aa5dda
> [PM / Runtime: Implement autosuspend support] introduces
> "autosuspend" facility for runtime PM, but misses
> helper function of pm_request_autosuspend, so add it.

I didn't add the helper function because I couldn't think of any 
places where it would be needed.  Do you have an example?


> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
>  	return __pm_runtime_resume(dev, RPM_ASYNC);
>  }
>  
> +static inline int pm_request_autosuspend(struct device *dev)
> +{
> +	return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
> +}
> +
>  static inline int pm_runtime_get(struct device *dev)
>  {
>  	return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
> 

This isn't good enough.  If you provide the function then you have to 
update the documentation file too.

Alan Stern

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM: runtime: add missed pm_request_autosuspend
  2010-09-27 13:54 ` Alan Stern
@ 2010-09-27 14:28   ` Ming Lei
  2010-09-27 14:41     ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Lei @ 2010-09-27 14:28 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-pm

2010/9/27 Alan Stern <stern@rowland.harvard.edu>:
> On Mon, 27 Sep 2010 tom.leiming@gmail.com wrote:
>
>> From: Ming Lei <tom.leiming@gmail.com>
>>
>> Commit 5789bdd542c6bfbb662915c67bffc14198aa5dda
>> [PM / Runtime: Implement autosuspend support] introduces
>> "autosuspend" facility for runtime PM, but misses
>> helper function of pm_request_autosuspend, so add it.
>
> I didn't add the helper function because I couldn't think of any
> places where it would be needed.  Do you have an example?

I add the helper function since there are the function descriptions
more than more in the documentation file of runtime_pm.txt, so I
think it is missed.

>
>> --- a/include/linux/pm_runtime.h
>> +++ b/include/linux/pm_runtime.h
>> @@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
>>       return __pm_runtime_resume(dev, RPM_ASYNC);
>>  }
>>
>> +static inline int pm_request_autosuspend(struct device *dev)
>> +{
>> +     return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
>> +}
>> +
>>  static inline int pm_runtime_get(struct device *dev)
>>  {
>>       return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
>>
>
> This isn't good enough.  If you provide the function then you have to
> update the documentation file too.

You have updated the documentation file already in your patch, :-)


-- 
Lei Ming

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM: runtime: add missed pm_request_autosuspend
  2010-09-27 14:28   ` Ming Lei
@ 2010-09-27 14:41     ` Alan Stern
  2010-09-28 22:14       ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Stern @ 2010-09-27 14:41 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-pm

On Mon, 27 Sep 2010, Ming Lei wrote:

> 2010/9/27 Alan Stern <stern@rowland.harvard.edu>:
> > On Mon, 27 Sep 2010 tom.leiming@gmail.com wrote:
> >
> >> From: Ming Lei <tom.leiming@gmail.com>
> >>
> >> Commit 5789bdd542c6bfbb662915c67bffc14198aa5dda
> >> [PM / Runtime: Implement autosuspend support] introduces
> >> "autosuspend" facility for runtime PM, but misses
> >> helper function of pm_request_autosuspend, so add it.
> >
> > I didn't add the helper function because I couldn't think of any
> > places where it would be needed.  Do you have an example?
> 
> I add the helper function since there are the function descriptions
> more than more in the documentation file of runtime_pm.txt, so I
> think it is missed.
> 
> >
> >> --- a/include/linux/pm_runtime.h
> >> +++ b/include/linux/pm_runtime.h
> >> @@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
> >>       return __pm_runtime_resume(dev, RPM_ASYNC);
> >>  }
> >>
> >> +static inline int pm_request_autosuspend(struct device *dev)
> >> +{
> >> +     return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
> >> +}
> >> +
> >>  static inline int pm_runtime_get(struct device *dev)
> >>  {
> >>       return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
> >>
> >
> > This isn't good enough.  If you provide the function then you have to
> > update the documentation file too.
> 
> You have updated the documentation file already in your patch, :-)

Oops!  You're right.  My mistake, I apologize.  Guess I changed my mind 
about it and then forgot partway through.  :-)

Yes, the function should be added.

Alan Stern

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM: runtime: add missed pm_request_autosuspend
  2010-09-27 14:41     ` Alan Stern
@ 2010-09-28 22:14       ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2010-09-28 22:14 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-pm

On Monday, September 27, 2010, Alan Stern wrote:
> On Mon, 27 Sep 2010, Ming Lei wrote:
> 
> > 2010/9/27 Alan Stern <stern@rowland.harvard.edu>:
> > > On Mon, 27 Sep 2010 tom.leiming@gmail.com wrote:
> > >
> > >> From: Ming Lei <tom.leiming@gmail.com>
> > >>
> > >> Commit 5789bdd542c6bfbb662915c67bffc14198aa5dda
> > >> [PM / Runtime: Implement autosuspend support] introduces
> > >> "autosuspend" facility for runtime PM, but misses
> > >> helper function of pm_request_autosuspend, so add it.
> > >
> > > I didn't add the helper function because I couldn't think of any
> > > places where it would be needed.  Do you have an example?
> > 
> > I add the helper function since there are the function descriptions
> > more than more in the documentation file of runtime_pm.txt, so I
> > think it is missed.
> > 
> > >
> > >> --- a/include/linux/pm_runtime.h
> > >> +++ b/include/linux/pm_runtime.h
> > >> @@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
> > >>       return __pm_runtime_resume(dev, RPM_ASYNC);
> > >>  }
> > >>
> > >> +static inline int pm_request_autosuspend(struct device *dev)
> > >> +{
> > >> +     return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
> > >> +}
> > >> +
> > >>  static inline int pm_runtime_get(struct device *dev)
> > >>  {
> > >>       return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
> > >>
> > >
> > > This isn't good enough.  If you provide the function then you have to
> > > update the documentation file too.
> > 
> > You have updated the documentation file already in your patch, :-)
> 
> Oops!  You're right.  My mistake, I apologize.  Guess I changed my mind 
> about it and then forgot partway through.  :-)
> 
> Yes, the function should be added.

I applied the patch to suspend-2.6/linux-next.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-28 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 10:54 [PATCH] PM: runtime: add missed pm_request_autosuspend tom.leiming
2010-09-27 13:54 ` Alan Stern
2010-09-27 14:28   ` Ming Lei
2010-09-27 14:41     ` Alan Stern
2010-09-28 22:14       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox