Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM: Add flag for devices capable of generating run-time wake-up events
  PM / Runtime: Remove unnecessary braces in __pm_runtime_set_status()
  PM / Runtime: Make documentation of runtime_idle() agree with the code
  PM / Runtime: Ensure timer_expires is nonzero in pm_schedule_suspend()
  PM / Runtime: Use deferred_resume flag in pm_request_resume
  PM / Runtime: Export the PM runtime workqueue
  PM / Runtime: Fix lockdep warning in __pm_runtime_set_status()
  PM / Hibernate: Swap, use KERN_CONT
  PM / Hibernate: Shift remaining code from swsusp.c to hibernate.c
  PM / Hibernate: Move swap functions to kernel/power/swap.c.
  PM / freezer: Don't get over-anxious while waiting
This commit is contained in:
Linus Torvalds
2009-12-08 08:07:16 -08:00
10 changed files with 184 additions and 155 deletions

View File

@ -178,9 +178,10 @@ typedef struct pm_message {
* This need not mean that the device should be put into a low power state.
* For example, if the device is behind a link which is about to be turned
* off, the device may remain at full power. If the device does go to low
* power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a
* hardware mechanism allowing the device to request a change of its power
* state, such as PCI PME) should be enabled for it.
* power and is capable of generating run-time wake-up events, remote
* wake-up (i.e., a hardware mechanism allowing the device to request a
* change of its power state via a wake-up event, such as PCI PME) should
* be enabled for it.
*
* @runtime_resume: Put the device into the fully active state in response to a
* wake-up event generated by hardware or at the request of software. If
@ -428,6 +429,7 @@ struct dev_pm_info {
unsigned int idle_notification:1;
unsigned int request_pending:1;
unsigned int deferred_resume:1;
unsigned int run_wake:1;
enum rpm_request request;
enum rpm_status runtime_status;
int runtime_error;

View File

@ -50,6 +50,16 @@ static inline void pm_runtime_put_noidle(struct device *dev)
atomic_add_unless(&dev->power.usage_count, -1, 0);
}
static inline bool device_run_wake(struct device *dev)
{
return dev->power.run_wake;
}
static inline void device_set_run_wake(struct device *dev, bool enable)
{
dev->power.run_wake = enable;
}
#else /* !CONFIG_PM_RUNTIME */
static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
@ -73,6 +83,8 @@ static inline bool pm_children_suspended(struct device *dev) { return false; }
static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
static inline void pm_runtime_get_noresume(struct device *dev) {}
static inline void pm_runtime_put_noidle(struct device *dev) {}
static inline bool device_run_wake(struct device *dev) { return false; }
static inline void device_set_run_wake(struct device *dev, bool enable) {}
#endif /* !CONFIG_PM_RUNTIME */