diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 09:34:12 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 09:34:12 -0400 |
commit | 4605ab653c1f9d7cc2dda8033de215c9cee325f4 (patch) | |
tree | 8f55aa3137973ce2a3ef0ed49c44304e148d50fe /include | |
parent | ef27bed1870dbd5fd363ff5ec51eebd5a695e277 (diff) |
PM / Domains: Use power.sybsys_data to reduce overhead
Currently pm_genpd_runtime_resume() has to walk the list of devices
from the device's PM domain to find the corresponding device list
object containing the need_restore field to check if the driver's
.runtime_resume() callback should be executed for the device.
This is suboptimal and can be simplified by using power.sybsys_data
to store device information used by the generic PM domains code.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pm.h | 9 | ||||
-rw-r--r-- | include/linux/pm_domain.h | 6 | ||||
-rw-r--r-- | include/linux/pm_runtime.h | 10 |
3 files changed, 19 insertions, 6 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index c6b5a0a41ab3..ed10f24d5259 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -421,12 +421,21 @@ enum rpm_request { | |||
421 | 421 | ||
422 | struct wakeup_source; | 422 | struct wakeup_source; |
423 | 423 | ||
424 | struct pm_domain_data { | ||
425 | struct list_head list_node; | ||
426 | struct device *dev; | ||
427 | bool need_restore; | ||
428 | }; | ||
429 | |||
424 | struct pm_subsys_data { | 430 | struct pm_subsys_data { |
425 | spinlock_t lock; | 431 | spinlock_t lock; |
426 | unsigned int refcount; | 432 | unsigned int refcount; |
427 | #ifdef CONFIG_PM_CLK | 433 | #ifdef CONFIG_PM_CLK |
428 | struct list_head clock_list; | 434 | struct list_head clock_list; |
429 | #endif | 435 | #endif |
436 | #ifdef CONFIG_PM_GENERIC_DOMAINS | ||
437 | struct pm_domain_data domain_data; | ||
438 | #endif | ||
430 | }; | 439 | }; |
431 | 440 | ||
432 | struct dev_pm_info { | 441 | struct dev_pm_info { |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index bf679f59f9a8..5cce46c2d926 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -61,12 +61,6 @@ struct gpd_link { | |||
61 | struct list_head slave_node; | 61 | struct list_head slave_node; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | struct dev_list_entry { | ||
65 | struct list_head node; | ||
66 | struct device *dev; | ||
67 | bool need_restore; | ||
68 | }; | ||
69 | |||
70 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 64 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
71 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, | 65 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, |
72 | struct device *dev); | 66 | struct device *dev); |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 6b90630e3c98..a5a41a850efb 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -258,6 +258,12 @@ struct pm_clk_notifier_block { | |||
258 | }; | 258 | }; |
259 | 259 | ||
260 | #ifdef CONFIG_PM_CLK | 260 | #ifdef CONFIG_PM_CLK |
261 | static inline bool pm_clk_no_clocks(struct device *dev) | ||
262 | { | ||
263 | return dev && dev->power.subsys_data | ||
264 | && list_empty(&dev->power.subsys_data->clock_list); | ||
265 | } | ||
266 | |||
261 | extern void pm_clk_init(struct device *dev); | 267 | extern void pm_clk_init(struct device *dev); |
262 | extern int pm_clk_create(struct device *dev); | 268 | extern int pm_clk_create(struct device *dev); |
263 | extern void pm_clk_destroy(struct device *dev); | 269 | extern void pm_clk_destroy(struct device *dev); |
@@ -266,6 +272,10 @@ extern void pm_clk_remove(struct device *dev, const char *con_id); | |||
266 | extern int pm_clk_suspend(struct device *dev); | 272 | extern int pm_clk_suspend(struct device *dev); |
267 | extern int pm_clk_resume(struct device *dev); | 273 | extern int pm_clk_resume(struct device *dev); |
268 | #else | 274 | #else |
275 | static inline bool pm_clk_no_clocks(struct device *dev) | ||
276 | { | ||
277 | return true; | ||
278 | } | ||
269 | static inline void pm_clk_init(struct device *dev) | 279 | static inline void pm_clk_init(struct device *dev) |
270 | { | 280 | { |
271 | } | 281 | } |