Skip to contentSkip to conversation

PM: runtime: add missed pm_request_autosuspend

PATCH Applied [email protected] 3 participants 5 messages Sep 27, 2010 – Sep 28, 2010 Power management core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: runtime: add missed pm_request_autosuspend

From: Ming Lei <[email protected]>

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

---
 include/linux/pm_runtime.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
include/linux/pm_runtime.h +5 -0
index 99ed1aa..3ec2358 100644
@@ -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);
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 6 lines · On Mon, 27 Sep 2010 [email protected] wrote:

From: Ming Lei <[email protected]>

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?

Quoted 5 lines
include/linux/pm_runtime.h +0 -0
@@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
 	return __pm_runtime_resume(dev, RPM_ASYNC);

include/linux/pm_runtime.h static inline int pm_request_resume(struct device *dev) · line 174

Quoted 10 lines
include/linux/pm_runtime.h +5 -0
 }
 
+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

author
#2 lore raw

2010/9/27 Alan Stern <[email protected]>:

Quoted 11 lines · On Mon, 27 Sep 2010 [email protected] wrote:
Quoted 7 lines

From: Ming Lei <[email protected]>

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.

Quoted 7 lines
Quoted 7 lines
include/linux/pm_runtime.h +0 -0
@@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
       return __pm_runtime_resume(dev, RPM_ASYNC);
  }
 
Quoted 12 lines

include/linux/pm_runtime.h static inline int pm_request_resume(struct device *dev) · line 174

Quoted 9 lines
include/linux/pm_runtime.h +5 -0
+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, :-)

Signature · 1 line
Lei Ming
#3 lore raw
Quoted 37 lines · Ming Lei

2010/9/27 Alan Stern <[email protected]>:

Quoted 11 lines · On Mon, 27 Sep 2010 [email protected] wrote:
Quoted 7 lines

From: Ming Lei <[email protected]>

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.

Quoted 7 lines
Quoted 7 lines
include/linux/pm_runtime.h +0 -0
@@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
       return __pm_runtime_resume(dev, RPM_ASYNC);
  }
 
Quoted 12 lines

include/linux/pm_runtime.h static inline int pm_request_resume(struct device *dev) · line 174

Quoted 9 lines
include/linux/pm_runtime.h +5 -0
+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.

Quoted 1 line

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

#4 lore raw
Quoted 39 lines · Alan Stern
Quoted 37 lines · Ming Lei

2010/9/27 Alan Stern <[email protected]>:

Quoted 11 lines · On Mon, 27 Sep 2010 [email protected] wrote:
Quoted 7 lines

From: Ming Lei <[email protected]>

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.

Quoted 19 lines
Quoted 6 lines
include/linux/pm_runtime.h +0 -0
@@ -164,6 +164,11 @@ static inline int pm_request_resume(struct device *dev)
      return __pm_runtime_resume(dev, RPM_ASYNC);

include/linux/pm_runtime.h static inline int pm_request_resume(struct device *dev) · line 174

Quoted 10 lines
include/linux/pm_runtime.h +5 -0
 }
 
+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.

Quoted 6 lines
Quoted 1 line

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