mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
PM / Domains: Move syscore flag from subsys data to struct device
The syscore device PM flag is used to mark the devices (belonging to a PM domain) that should never be turned off, except for the system core (syscore) suspend/hibernation and resume stages. That flag is stored in the device's struct pm_subsys_data object whose address is available from struct device. However, in some situations it may be convenient to set that flag before the device is added to a PM domain, so it is better to move it directly to the "power" member of struct device. Then, it can be checked by the routines in drivers/base/power/runtime.c and drivers/base/power/main.c, which is more straightforward. This also reduces the number of dev_gpd_data() invocations in the generic PM domains framework, so the overhead related to the syscore flag is slightly smaller. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
This commit is contained in:
parent
6fb28badf2
commit
dbf374142d
9 changed files with 58 additions and 38 deletions
|
|
@ -43,8 +43,12 @@ struct device;
|
|||
|
||||
#ifdef CONFIG_PM
|
||||
extern const char power_group_name[]; /* = "power" */
|
||||
|
||||
extern void dev_pm_syscore_device(struct device *dev, bool val);
|
||||
#else
|
||||
#define power_group_name NULL
|
||||
|
||||
static inline void dev_pm_syscore_device(struct device *dev, bool val) {}
|
||||
#endif
|
||||
|
||||
typedef struct pm_message {
|
||||
|
|
@ -511,6 +515,7 @@ struct dev_pm_info {
|
|||
bool is_suspended:1; /* Ditto */
|
||||
bool ignore_children:1;
|
||||
bool early_init:1; /* Owned by the PM core */
|
||||
bool syscore:1;
|
||||
spinlock_t lock;
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
struct list_head entry;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ struct generic_pm_domain_data {
|
|||
struct mutex lock;
|
||||
unsigned int refcount;
|
||||
bool need_restore;
|
||||
bool syscore;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PM_GENERIC_DOMAINS
|
||||
|
|
@ -153,7 +152,6 @@ static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
|
|||
|
||||
extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
|
||||
struct device *dev);
|
||||
extern void pm_genpd_dev_syscore(struct device *dev, bool val);
|
||||
extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
|
||||
extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
|
||||
struct generic_pm_domain *new_subdomain);
|
||||
|
|
@ -199,7 +197,6 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
|
|||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
static inline void pm_genpd_dev_syscore(struct device *dev, bool val) {}
|
||||
static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
|
||||
static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
|
||||
struct generic_pm_domain *new_sd)
|
||||
|
|
|
|||
Loading…
Reference in a new issue