diff options
| -rw-r--r-- | drivers/base/cpu.c | 1 | ||||
| -rw-r--r-- | drivers/base/power/main.c | 7 | ||||
| -rw-r--r-- | drivers/base/power/sysfs.c | 6 | ||||
| -rw-r--r-- | include/linux/device.h | 10 | ||||
| -rw-r--r-- | include/linux/pm.h | 1 |
5 files changed, 25 insertions, 0 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index eb9443d5bae1..6ce93a52bf3f 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
| @@ -427,6 +427,7 @@ __cpu_device_create(struct device *parent, void *drvdata, | |||
| 427 | dev->parent = parent; | 427 | dev->parent = parent; |
| 428 | dev->groups = groups; | 428 | dev->groups = groups; |
| 429 | dev->release = device_create_release; | 429 | dev->release = device_create_release; |
| 430 | device_set_pm_not_required(dev); | ||
| 430 | dev_set_drvdata(dev, drvdata); | 431 | dev_set_drvdata(dev, drvdata); |
| 431 | 432 | ||
| 432 | retval = kobject_set_name_vargs(&dev->kobj, fmt, args); | 433 | retval = kobject_set_name_vargs(&dev->kobj, fmt, args); |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 337a56ff11b7..893ae464bfd6 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -124,6 +124,10 @@ void device_pm_unlock(void) | |||
| 124 | */ | 124 | */ |
| 125 | void device_pm_add(struct device *dev) | 125 | void device_pm_add(struct device *dev) |
| 126 | { | 126 | { |
| 127 | /* Skip PM setup/initialization. */ | ||
| 128 | if (device_pm_not_required(dev)) | ||
| 129 | return; | ||
| 130 | |||
| 127 | pr_debug("PM: Adding info for %s:%s\n", | 131 | pr_debug("PM: Adding info for %s:%s\n", |
| 128 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); | 132 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); |
| 129 | device_pm_check_callbacks(dev); | 133 | device_pm_check_callbacks(dev); |
| @@ -142,6 +146,9 @@ void device_pm_add(struct device *dev) | |||
| 142 | */ | 146 | */ |
| 143 | void device_pm_remove(struct device *dev) | 147 | void device_pm_remove(struct device *dev) |
| 144 | { | 148 | { |
| 149 | if (device_pm_not_required(dev)) | ||
| 150 | return; | ||
| 151 | |||
| 145 | pr_debug("PM: Removing info for %s:%s\n", | 152 | pr_debug("PM: Removing info for %s:%s\n", |
| 146 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); | 153 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); |
| 147 | complete_all(&dev->power.completion); | 154 | complete_all(&dev->power.completion); |
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index 96c8a227610a..c6bf76124184 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
| @@ -653,6 +653,10 @@ int dpm_sysfs_add(struct device *dev) | |||
| 653 | { | 653 | { |
| 654 | int rc; | 654 | int rc; |
| 655 | 655 | ||
| 656 | /* No need to create PM sysfs if explicitly disabled. */ | ||
| 657 | if (device_pm_not_required(dev)) | ||
| 658 | return 0; | ||
| 659 | |||
| 656 | rc = sysfs_create_group(&dev->kobj, &pm_attr_group); | 660 | rc = sysfs_create_group(&dev->kobj, &pm_attr_group); |
| 657 | if (rc) | 661 | if (rc) |
| 658 | return rc; | 662 | return rc; |
| @@ -732,6 +736,8 @@ void rpm_sysfs_remove(struct device *dev) | |||
| 732 | 736 | ||
| 733 | void dpm_sysfs_remove(struct device *dev) | 737 | void dpm_sysfs_remove(struct device *dev) |
| 734 | { | 738 | { |
| 739 | if (device_pm_not_required(dev)) | ||
| 740 | return; | ||
| 735 | sysfs_unmerge_group(&dev->kobj, &pm_qos_latency_tolerance_attr_group); | 741 | sysfs_unmerge_group(&dev->kobj, &pm_qos_latency_tolerance_attr_group); |
| 736 | dev_pm_qos_constraints_destroy(dev); | 742 | dev_pm_qos_constraints_destroy(dev); |
| 737 | rpm_sysfs_remove(dev); | 743 | rpm_sysfs_remove(dev); |
diff --git a/include/linux/device.h b/include/linux/device.h index 6cb4640b6160..53028636fe39 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -1165,6 +1165,16 @@ static inline bool device_async_suspend_enabled(struct device *dev) | |||
| 1165 | return !!dev->power.async_suspend; | 1165 | return !!dev->power.async_suspend; |
| 1166 | } | 1166 | } |
| 1167 | 1167 | ||
| 1168 | static inline bool device_pm_not_required(struct device *dev) | ||
| 1169 | { | ||
| 1170 | return dev->power.no_pm; | ||
| 1171 | } | ||
| 1172 | |||
| 1173 | static inline void device_set_pm_not_required(struct device *dev) | ||
| 1174 | { | ||
| 1175 | dev->power.no_pm = true; | ||
| 1176 | } | ||
| 1177 | |||
| 1168 | static inline void dev_pm_syscore_device(struct device *dev, bool val) | 1178 | static inline void dev_pm_syscore_device(struct device *dev, bool val) |
| 1169 | { | 1179 | { |
| 1170 | #ifdef CONFIG_PM_SLEEP | 1180 | #ifdef CONFIG_PM_SLEEP |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 3d2cbf947768..06f7ed893928 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -592,6 +592,7 @@ struct dev_pm_info { | |||
| 592 | bool is_suspended:1; /* Ditto */ | 592 | bool is_suspended:1; /* Ditto */ |
| 593 | bool is_noirq_suspended:1; | 593 | bool is_noirq_suspended:1; |
| 594 | bool is_late_suspended:1; | 594 | bool is_late_suspended:1; |
| 595 | bool no_pm:1; | ||
| 595 | bool early_init:1; /* Owned by the PM core */ | 596 | bool early_init:1; /* Owned by the PM core */ |
| 596 | bool direct_complete:1; /* Owned by the PM core */ | 597 | bool direct_complete:1; /* Owned by the PM core */ |
| 597 | u32 driver_flags; | 598 | u32 driver_flags; |
