diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-04 17:26:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-04 17:26:40 -0400 |
commit | 64ebe987311853ea857a244439de5b947a4b1b07 (patch) | |
tree | b33ab6efd7f118e0f6ab5a6bcbd59ba31a313da5 /include | |
parent | a5149bf3fed59b94207809704b5d06fec337a771 (diff) | |
parent | c4772d192c70b61d52262b0db76f7abd8aeb51c6 (diff) |
Merge tag 'pm-for-3.4-part-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management updates from Rafael Wysocki:
- Patch series that hopefully fixes races between the freezer and
request_firmware() and request_firmware_nowait() for good, with two
cleanups from Stephen Boyd on top.
- Runtime PM fix from Alan Stern preventing tasks from getting stuck
indefinitely in the runtime PM wait queue.
- Device PM QoS update from MyungJoo Ham introducing a new variant of
pm_qos_update_request() allowing the callers to specify a timeout.
* tag 'pm-for-3.4-part-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM / QoS: add pm_qos_update_request_timeout() API
firmware_class: Move request_firmware_nowait() to workqueues
firmware_class: Reorganize fw_create_instance()
PM / Sleep: Mitigate race between the freezer and request_firmware()
PM / Sleep: Move disabling of usermode helpers to the freezer
PM / Hibernate: Disable usermode helpers right before freezing tasks
firmware_class: Do not warn that system is not ready from async loads
firmware_class: Split _request_firmware() into three functions, v2
firmware_class: Rework usermodehelper check
PM / Runtime: don't forget to wake up waitqueue on failure
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kmod.h | 27 | ||||
-rw-r--r-- | include/linux/pm_qos.h | 4 |
2 files changed, 26 insertions, 5 deletions
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 9efeae679106..dd99c329e161 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -110,12 +110,29 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait) | |||
110 | 110 | ||
111 | extern struct ctl_table usermodehelper_table[]; | 111 | extern struct ctl_table usermodehelper_table[]; |
112 | 112 | ||
113 | enum umh_disable_depth { | ||
114 | UMH_ENABLED = 0, | ||
115 | UMH_FREEZING, | ||
116 | UMH_DISABLED, | ||
117 | }; | ||
118 | |||
113 | extern void usermodehelper_init(void); | 119 | extern void usermodehelper_init(void); |
114 | 120 | ||
115 | extern int usermodehelper_disable(void); | 121 | extern int __usermodehelper_disable(enum umh_disable_depth depth); |
116 | extern void usermodehelper_enable(void); | 122 | extern void __usermodehelper_set_disable_depth(enum umh_disable_depth depth); |
117 | extern bool usermodehelper_is_disabled(void); | 123 | |
118 | extern void read_lock_usermodehelper(void); | 124 | static inline int usermodehelper_disable(void) |
119 | extern void read_unlock_usermodehelper(void); | 125 | { |
126 | return __usermodehelper_disable(UMH_DISABLED); | ||
127 | } | ||
128 | |||
129 | static inline void usermodehelper_enable(void) | ||
130 | { | ||
131 | __usermodehelper_set_disable_depth(UMH_ENABLED); | ||
132 | } | ||
133 | |||
134 | extern int usermodehelper_read_trylock(void); | ||
135 | extern long usermodehelper_read_lock_wait(long timeout); | ||
136 | extern void usermodehelper_read_unlock(void); | ||
120 | 137 | ||
121 | #endif /* __LINUX_KMOD_H__ */ | 138 | #endif /* __LINUX_KMOD_H__ */ |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 2e9191a712f3..233149cb19f4 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/notifier.h> | 8 | #include <linux/notifier.h> |
9 | #include <linux/miscdevice.h> | 9 | #include <linux/miscdevice.h> |
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | #include <linux/workqueue.h> | ||
11 | 12 | ||
12 | enum { | 13 | enum { |
13 | PM_QOS_RESERVED = 0, | 14 | PM_QOS_RESERVED = 0, |
@@ -29,6 +30,7 @@ enum { | |||
29 | struct pm_qos_request { | 30 | struct pm_qos_request { |
30 | struct plist_node node; | 31 | struct plist_node node; |
31 | int pm_qos_class; | 32 | int pm_qos_class; |
33 | struct delayed_work work; /* for pm_qos_update_request_timeout */ | ||
32 | }; | 34 | }; |
33 | 35 | ||
34 | struct dev_pm_qos_request { | 36 | struct dev_pm_qos_request { |
@@ -73,6 +75,8 @@ void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, | |||
73 | s32 value); | 75 | s32 value); |
74 | void pm_qos_update_request(struct pm_qos_request *req, | 76 | void pm_qos_update_request(struct pm_qos_request *req, |
75 | s32 new_value); | 77 | s32 new_value); |
78 | void pm_qos_update_request_timeout(struct pm_qos_request *req, | ||
79 | s32 new_value, unsigned long timeout_us); | ||
76 | void pm_qos_remove_request(struct pm_qos_request *req); | 80 | void pm_qos_remove_request(struct pm_qos_request *req); |
77 | 81 | ||
78 | int pm_qos_request(int pm_qos_class); | 82 | int pm_qos_request(int pm_qos_class); |