diff options
| -rw-r--r-- | drivers/base/power/domain.c | 12 | ||||
| -rw-r--r-- | drivers/base/power/main.c | 21 | ||||
| -rw-r--r-- | drivers/base/power/power.h | 1 | ||||
| -rw-r--r-- | drivers/base/power/qos.c | 2 | ||||
| -rw-r--r-- | drivers/base/power/runtime.c | 16 | ||||
| -rw-r--r-- | drivers/base/power/sysfs.c | 12 | ||||
| -rw-r--r-- | drivers/base/power/trace.c | 2 | ||||
| -rw-r--r-- | drivers/base/power/wakeup.c | 30 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 24 | ||||
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 2 | ||||
| -rw-r--r-- | drivers/cpufreq/pxa2xx-cpufreq.c | 4 | ||||
| -rw-r--r-- | drivers/cpuidle/governor.c | 1 | ||||
| -rw-r--r-- | drivers/cpuidle/governors/menu.c | 2 | ||||
| -rw-r--r-- | include/linux/pm.h | 1 | ||||
| -rw-r--r-- | include/linux/pm_wakeup.h | 9 |
15 files changed, 62 insertions, 77 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index f01257607bf7..76c9969b7124 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | * This file is released under the GPLv2. | 6 | * This file is released under the GPLv2. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #define pr_fmt(fmt) "PM: " fmt | ||
| 10 | |||
| 9 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
| 10 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 11 | #include <linux/io.h> | 13 | #include <linux/io.h> |
| @@ -1657,8 +1659,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | |||
| 1657 | genpd_lock_nested(genpd, SINGLE_DEPTH_NESTING); | 1659 | genpd_lock_nested(genpd, SINGLE_DEPTH_NESTING); |
| 1658 | 1660 | ||
| 1659 | if (!list_empty(&subdomain->master_links) || subdomain->device_count) { | 1661 | if (!list_empty(&subdomain->master_links) || subdomain->device_count) { |
| 1660 | pr_warn("%s: unable to remove subdomain %s\n", genpd->name, | 1662 | pr_warn("%s: unable to remove subdomain %s\n", |
| 1661 | subdomain->name); | 1663 | genpd->name, subdomain->name); |
| 1662 | ret = -EBUSY; | 1664 | ret = -EBUSY; |
| 1663 | goto out; | 1665 | goto out; |
| 1664 | } | 1666 | } |
| @@ -1767,7 +1769,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, | |||
| 1767 | if (ret) | 1769 | if (ret) |
| 1768 | return ret; | 1770 | return ret; |
| 1769 | } else if (!gov && genpd->state_count > 1) { | 1771 | } else if (!gov && genpd->state_count > 1) { |
| 1770 | pr_warn("%s : no governor for states\n", genpd->name); | 1772 | pr_warn("%s: no governor for states\n", genpd->name); |
| 1771 | } | 1773 | } |
| 1772 | 1774 | ||
| 1773 | device_initialize(&genpd->dev); | 1775 | device_initialize(&genpd->dev); |
| @@ -2514,7 +2516,7 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state, | |||
| 2514 | &entry_latency); | 2516 | &entry_latency); |
| 2515 | if (err) { | 2517 | if (err) { |
| 2516 | pr_debug(" * %pOF missing entry-latency-us property\n", | 2518 | pr_debug(" * %pOF missing entry-latency-us property\n", |
| 2517 | state_node); | 2519 | state_node); |
| 2518 | return -EINVAL; | 2520 | return -EINVAL; |
| 2519 | } | 2521 | } |
| 2520 | 2522 | ||
| @@ -2522,7 +2524,7 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state, | |||
| 2522 | &exit_latency); | 2524 | &exit_latency); |
| 2523 | if (err) { | 2525 | if (err) { |
| 2524 | pr_debug(" * %pOF missing exit-latency-us property\n", | 2526 | pr_debug(" * %pOF missing exit-latency-us property\n", |
| 2525 | state_node); | 2527 | state_node); |
| 2526 | return -EINVAL; | 2528 | return -EINVAL; |
| 2527 | } | 2529 | } |
| 2528 | 2530 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 893ae464bfd6..929bc9d50db7 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | * subsystem list maintains. | 17 | * subsystem list maintains. |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #define pr_fmt(fmt) "PM: " fmt | ||
| 21 | |||
| 20 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 21 | #include <linux/export.h> | 23 | #include <linux/export.h> |
| 22 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
| @@ -128,7 +130,7 @@ void device_pm_add(struct device *dev) | |||
| 128 | if (device_pm_not_required(dev)) | 130 | if (device_pm_not_required(dev)) |
| 129 | return; | 131 | return; |
| 130 | 132 | ||
| 131 | pr_debug("PM: Adding info for %s:%s\n", | 133 | pr_debug("Adding info for %s:%s\n", |
| 132 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); | 134 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); |
| 133 | device_pm_check_callbacks(dev); | 135 | device_pm_check_callbacks(dev); |
| 134 | mutex_lock(&dpm_list_mtx); | 136 | mutex_lock(&dpm_list_mtx); |
| @@ -149,7 +151,7 @@ void device_pm_remove(struct device *dev) | |||
| 149 | if (device_pm_not_required(dev)) | 151 | if (device_pm_not_required(dev)) |
| 150 | return; | 152 | return; |
| 151 | 153 | ||
| 152 | pr_debug("PM: Removing info for %s:%s\n", | 154 | pr_debug("Removing info for %s:%s\n", |
| 153 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); | 155 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); |
| 154 | complete_all(&dev->power.completion); | 156 | complete_all(&dev->power.completion); |
| 155 | mutex_lock(&dpm_list_mtx); | 157 | mutex_lock(&dpm_list_mtx); |
| @@ -168,7 +170,7 @@ void device_pm_remove(struct device *dev) | |||
| 168 | */ | 170 | */ |
| 169 | void device_pm_move_before(struct device *deva, struct device *devb) | 171 | void device_pm_move_before(struct device *deva, struct device *devb) |
| 170 | { | 172 | { |
| 171 | pr_debug("PM: Moving %s:%s before %s:%s\n", | 173 | pr_debug("Moving %s:%s before %s:%s\n", |
| 172 | deva->bus ? deva->bus->name : "No Bus", dev_name(deva), | 174 | deva->bus ? deva->bus->name : "No Bus", dev_name(deva), |
| 173 | devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); | 175 | devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); |
| 174 | /* Delete deva from dpm_list and reinsert before devb. */ | 176 | /* Delete deva from dpm_list and reinsert before devb. */ |
| @@ -182,7 +184,7 @@ void device_pm_move_before(struct device *deva, struct device *devb) | |||
| 182 | */ | 184 | */ |
| 183 | void device_pm_move_after(struct device *deva, struct device *devb) | 185 | void device_pm_move_after(struct device *deva, struct device *devb) |
| 184 | { | 186 | { |
| 185 | pr_debug("PM: Moving %s:%s after %s:%s\n", | 187 | pr_debug("Moving %s:%s after %s:%s\n", |
| 186 | deva->bus ? deva->bus->name : "No Bus", dev_name(deva), | 188 | deva->bus ? deva->bus->name : "No Bus", dev_name(deva), |
| 187 | devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); | 189 | devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); |
| 188 | /* Delete deva from dpm_list and reinsert after devb. */ | 190 | /* Delete deva from dpm_list and reinsert after devb. */ |
| @@ -195,7 +197,7 @@ void device_pm_move_after(struct device *deva, struct device *devb) | |||
| 195 | */ | 197 | */ |
| 196 | void device_pm_move_last(struct device *dev) | 198 | void device_pm_move_last(struct device *dev) |
| 197 | { | 199 | { |
| 198 | pr_debug("PM: Moving %s:%s to end of list\n", | 200 | pr_debug("Moving %s:%s to end of list\n", |
| 199 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); | 201 | dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); |
| 200 | list_move_tail(&dev->power.entry, &dpm_list); | 202 | list_move_tail(&dev->power.entry, &dpm_list); |
| 201 | } | 203 | } |
| @@ -418,8 +420,8 @@ static void pm_dev_dbg(struct device *dev, pm_message_t state, const char *info) | |||
| 418 | static void pm_dev_err(struct device *dev, pm_message_t state, const char *info, | 420 | static void pm_dev_err(struct device *dev, pm_message_t state, const char *info, |
| 419 | int error) | 421 | int error) |
| 420 | { | 422 | { |
| 421 | printk(KERN_ERR "PM: Device %s failed to %s%s: error %d\n", | 423 | pr_err("Device %s failed to %s%s: error %d\n", |
| 422 | dev_name(dev), pm_verb(state.event), info, error); | 424 | dev_name(dev), pm_verb(state.event), info, error); |
| 423 | } | 425 | } |
| 424 | 426 | ||
| 425 | static void dpm_show_time(ktime_t starttime, pm_message_t state, int error, | 427 | static void dpm_show_time(ktime_t starttime, pm_message_t state, int error, |
| @@ -2022,8 +2024,7 @@ int dpm_prepare(pm_message_t state) | |||
| 2022 | error = 0; | 2024 | error = 0; |
| 2023 | continue; | 2025 | continue; |
| 2024 | } | 2026 | } |
| 2025 | printk(KERN_INFO "PM: Device %s not prepared " | 2027 | pr_info("Device %s not prepared for power transition: code %d\n", |
| 2026 | "for power transition: code %d\n", | ||
| 2027 | dev_name(dev), error); | 2028 | dev_name(dev), error); |
| 2028 | put_device(dev); | 2029 | put_device(dev); |
| 2029 | break; | 2030 | break; |
| @@ -2062,7 +2063,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start); | |||
| 2062 | void __suspend_report_result(const char *function, void *fn, int ret) | 2063 | void __suspend_report_result(const char *function, void *fn, int ret) |
| 2063 | { | 2064 | { |
| 2064 | if (ret) | 2065 | if (ret) |
| 2065 | printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret); | 2066 | pr_err("%s(): %pF returns %d\n", function, fn, ret); |
| 2066 | } | 2067 | } |
| 2067 | EXPORT_SYMBOL_GPL(__suspend_report_result); | 2068 | EXPORT_SYMBOL_GPL(__suspend_report_result); |
| 2068 | 2069 | ||
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index c511def48b48..ec33fbdb919b 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h | |||
| @@ -21,6 +21,7 @@ static inline void pm_runtime_early_init(struct device *dev) | |||
| 21 | extern void pm_runtime_init(struct device *dev); | 21 | extern void pm_runtime_init(struct device *dev); |
| 22 | extern void pm_runtime_reinit(struct device *dev); | 22 | extern void pm_runtime_reinit(struct device *dev); |
| 23 | extern void pm_runtime_remove(struct device *dev); | 23 | extern void pm_runtime_remove(struct device *dev); |
| 24 | extern u64 pm_runtime_active_time(struct device *dev); | ||
| 24 | 25 | ||
| 25 | #define WAKE_IRQ_DEDICATED_ALLOCATED BIT(0) | 26 | #define WAKE_IRQ_DEDICATED_ALLOCATED BIT(0) |
| 26 | #define WAKE_IRQ_DEDICATED_MANAGED BIT(1) | 27 | #define WAKE_IRQ_DEDICATED_MANAGED BIT(1) |
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 3382542b39b7..f80e402ef778 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | * per-device constraint data struct. | 22 | * per-device constraint data struct. |
| 23 | * | 23 | * |
| 24 | * Note about the per-device constraint data struct allocation: | 24 | * Note about the per-device constraint data struct allocation: |
| 25 | * . The per-device constraints data struct ptr is tored into the device | 25 | * . The per-device constraints data struct ptr is stored into the device |
| 26 | * dev_pm_info. | 26 | * dev_pm_info. |
| 27 | * . To minimize the data usage by the per-device constraints, the data struct | 27 | * . To minimize the data usage by the per-device constraints, the data struct |
| 28 | * is only allocated at the first call to dev_pm_qos_add_request. | 28 | * is only allocated at the first call to dev_pm_qos_add_request. |
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 78937c45278c..a2d22e3ecf3a 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
| @@ -64,7 +64,7 @@ static int rpm_suspend(struct device *dev, int rpmflags); | |||
| 64 | * runtime_status field is updated, to account the time in the old state | 64 | * runtime_status field is updated, to account the time in the old state |
| 65 | * correctly. | 65 | * correctly. |
| 66 | */ | 66 | */ |
| 67 | void update_pm_runtime_accounting(struct device *dev) | 67 | static void update_pm_runtime_accounting(struct device *dev) |
| 68 | { | 68 | { |
| 69 | u64 now, last, delta; | 69 | u64 now, last, delta; |
| 70 | 70 | ||
| @@ -98,7 +98,7 @@ static void __update_runtime_status(struct device *dev, enum rpm_status status) | |||
| 98 | dev->power.runtime_status = status; | 98 | dev->power.runtime_status = status; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | u64 pm_runtime_suspended_time(struct device *dev) | 101 | static u64 rpm_get_accounted_time(struct device *dev, bool suspended) |
| 102 | { | 102 | { |
| 103 | u64 time; | 103 | u64 time; |
| 104 | unsigned long flags; | 104 | unsigned long flags; |
| @@ -106,12 +106,22 @@ u64 pm_runtime_suspended_time(struct device *dev) | |||
| 106 | spin_lock_irqsave(&dev->power.lock, flags); | 106 | spin_lock_irqsave(&dev->power.lock, flags); |
| 107 | 107 | ||
| 108 | update_pm_runtime_accounting(dev); | 108 | update_pm_runtime_accounting(dev); |
| 109 | time = dev->power.suspended_time; | 109 | time = suspended ? dev->power.suspended_time : dev->power.active_time; |
| 110 | 110 | ||
| 111 | spin_unlock_irqrestore(&dev->power.lock, flags); | 111 | spin_unlock_irqrestore(&dev->power.lock, flags); |
| 112 | 112 | ||
| 113 | return time; | 113 | return time; |
| 114 | } | 114 | } |
| 115 | |||
| 116 | u64 pm_runtime_active_time(struct device *dev) | ||
| 117 | { | ||
| 118 | return rpm_get_accounted_time(dev, false); | ||
| 119 | } | ||
| 120 | |||
| 121 | u64 pm_runtime_suspended_time(struct device *dev) | ||
| 122 | { | ||
| 123 | return rpm_get_accounted_time(dev, true); | ||
| 124 | } | ||
| 115 | EXPORT_SYMBOL_GPL(pm_runtime_suspended_time); | 125 | EXPORT_SYMBOL_GPL(pm_runtime_suspended_time); |
| 116 | 126 | ||
| 117 | /** | 127 | /** |
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index c6bf76124184..1226e441ddfe 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
| @@ -125,13 +125,9 @@ static ssize_t runtime_active_time_show(struct device *dev, | |||
| 125 | struct device_attribute *attr, char *buf) | 125 | struct device_attribute *attr, char *buf) |
| 126 | { | 126 | { |
| 127 | int ret; | 127 | int ret; |
| 128 | u64 tmp; | 128 | u64 tmp = pm_runtime_active_time(dev); |
| 129 | spin_lock_irq(&dev->power.lock); | ||
| 130 | update_pm_runtime_accounting(dev); | ||
| 131 | tmp = dev->power.active_time; | ||
| 132 | do_div(tmp, NSEC_PER_MSEC); | 129 | do_div(tmp, NSEC_PER_MSEC); |
| 133 | ret = sprintf(buf, "%llu\n", tmp); | 130 | ret = sprintf(buf, "%llu\n", tmp); |
| 134 | spin_unlock_irq(&dev->power.lock); | ||
| 135 | return ret; | 131 | return ret; |
| 136 | } | 132 | } |
| 137 | 133 | ||
| @@ -141,13 +137,9 @@ static ssize_t runtime_suspended_time_show(struct device *dev, | |||
| 141 | struct device_attribute *attr, char *buf) | 137 | struct device_attribute *attr, char *buf) |
| 142 | { | 138 | { |
| 143 | int ret; | 139 | int ret; |
| 144 | u64 tmp; | 140 | u64 tmp = pm_runtime_suspended_time(dev); |
| 145 | spin_lock_irq(&dev->power.lock); | ||
| 146 | update_pm_runtime_accounting(dev); | ||
| 147 | tmp = dev->power.suspended_time; | ||
| 148 | do_div(tmp, NSEC_PER_MSEC); | 141 | do_div(tmp, NSEC_PER_MSEC); |
| 149 | ret = sprintf(buf, "%llu\n", tmp); | 142 | ret = sprintf(buf, "%llu\n", tmp); |
| 150 | spin_unlock_irq(&dev->power.lock); | ||
| 151 | return ret; | 143 | return ret; |
| 152 | } | 144 | } |
| 153 | 145 | ||
diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c index b11f47a1e819..2bd9d2c744ca 100644 --- a/drivers/base/power/trace.c +++ b/drivers/base/power/trace.c | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | * devices may be working. | 7 | * devices may be working. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #define pr_fmt(fmt) "PM: " fmt | ||
| 11 | |||
| 10 | #include <linux/pm-trace.h> | 12 | #include <linux/pm-trace.h> |
| 11 | #include <linux/export.h> | 13 | #include <linux/export.h> |
| 12 | #include <linux/rtc.h> | 14 | #include <linux/rtc.h> |
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index f1fee72ed970..bb1ae175fae1 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | * This file is released under the GPLv2. | 6 | * This file is released under the GPLv2. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #define pr_fmt(fmt) "PM: " fmt | ||
| 10 | |||
| 9 | #include <linux/device.h> | 11 | #include <linux/device.h> |
| 10 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
| 11 | #include <linux/sched/signal.h> | 13 | #include <linux/sched/signal.h> |
| @@ -106,23 +108,6 @@ struct wakeup_source *wakeup_source_create(const char *name) | |||
| 106 | } | 108 | } |
| 107 | EXPORT_SYMBOL_GPL(wakeup_source_create); | 109 | EXPORT_SYMBOL_GPL(wakeup_source_create); |
| 108 | 110 | ||
| 109 | /** | ||
| 110 | * wakeup_source_drop - Prepare a struct wakeup_source object for destruction. | ||
| 111 | * @ws: Wakeup source to prepare for destruction. | ||
| 112 | * | ||
| 113 | * Callers must ensure that __pm_stay_awake() or __pm_wakeup_event() will never | ||
| 114 | * be run in parallel with this function for the same wakeup source object. | ||
| 115 | */ | ||
| 116 | void wakeup_source_drop(struct wakeup_source *ws) | ||
| 117 | { | ||
| 118 | if (!ws) | ||
| 119 | return; | ||
| 120 | |||
| 121 | del_timer_sync(&ws->timer); | ||
| 122 | __pm_relax(ws); | ||
| 123 | } | ||
| 124 | EXPORT_SYMBOL_GPL(wakeup_source_drop); | ||
| 125 | |||
| 126 | /* | 111 | /* |
| 127 | * Record wakeup_source statistics being deleted into a dummy wakeup_source. | 112 | * Record wakeup_source statistics being deleted into a dummy wakeup_source. |
| 128 | */ | 113 | */ |
| @@ -162,7 +147,7 @@ void wakeup_source_destroy(struct wakeup_source *ws) | |||
| 162 | if (!ws) | 147 | if (!ws) |
| 163 | return; | 148 | return; |
| 164 | 149 | ||
| 165 | wakeup_source_drop(ws); | 150 | __pm_relax(ws); |
| 166 | wakeup_source_record(ws); | 151 | wakeup_source_record(ws); |
| 167 | kfree_const(ws->name); | 152 | kfree_const(ws->name); |
| 168 | kfree(ws); | 153 | kfree(ws); |
| @@ -205,6 +190,13 @@ void wakeup_source_remove(struct wakeup_source *ws) | |||
| 205 | list_del_rcu(&ws->entry); | 190 | list_del_rcu(&ws->entry); |
| 206 | raw_spin_unlock_irqrestore(&events_lock, flags); | 191 | raw_spin_unlock_irqrestore(&events_lock, flags); |
| 207 | synchronize_srcu(&wakeup_srcu); | 192 | synchronize_srcu(&wakeup_srcu); |
| 193 | |||
| 194 | del_timer_sync(&ws->timer); | ||
| 195 | /* | ||
| 196 | * Clear timer.function to make wakeup_source_not_registered() treat | ||
| 197 | * this wakeup source as not registered. | ||
| 198 | */ | ||
| 199 | ws->timer.function = NULL; | ||
| 208 | } | 200 | } |
| 209 | EXPORT_SYMBOL_GPL(wakeup_source_remove); | 201 | EXPORT_SYMBOL_GPL(wakeup_source_remove); |
| 210 | 202 | ||
| @@ -853,7 +845,7 @@ bool pm_wakeup_pending(void) | |||
| 853 | raw_spin_unlock_irqrestore(&events_lock, flags); | 845 | raw_spin_unlock_irqrestore(&events_lock, flags); |
| 854 | 846 | ||
| 855 | if (ret) { | 847 | if (ret) { |
| 856 | pr_debug("PM: Wakeup pending, aborting suspend\n"); | 848 | pr_debug("Wakeup pending, aborting suspend\n"); |
| 857 | pm_print_active_wakeup_sources(); | 849 | pm_print_active_wakeup_sources(); |
| 858 | } | 850 | } |
| 859 | 851 | ||
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0e626b00053b..e10922709d13 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
| @@ -206,17 +206,15 @@ unsigned int cpufreq_generic_get(unsigned int cpu) | |||
| 206 | EXPORT_SYMBOL_GPL(cpufreq_generic_get); | 206 | EXPORT_SYMBOL_GPL(cpufreq_generic_get); |
| 207 | 207 | ||
| 208 | /** | 208 | /** |
| 209 | * cpufreq_cpu_get: returns policy for a cpu and marks it busy. | 209 | * cpufreq_cpu_get - Return policy for a CPU and mark it as busy. |
| 210 | * @cpu: CPU to find the policy for. | ||
| 210 | * | 211 | * |
| 211 | * @cpu: cpu to find policy for. | 212 | * Call cpufreq_cpu_get_raw() to obtain a cpufreq policy for @cpu and increment |
| 213 | * the kobject reference counter of that policy. Return a valid policy on | ||
| 214 | * success or NULL on failure. | ||
| 212 | * | 215 | * |
| 213 | * This returns policy for 'cpu', returns NULL if it doesn't exist. | 216 | * The policy returned by this function has to be released with the help of |
| 214 | * It also increments the kobject reference count to mark it busy and so would | 217 | * cpufreq_cpu_put() to balance its kobject reference counter properly. |
| 215 | * require a corresponding call to cpufreq_cpu_put() to decrement it back. | ||
| 216 | * If corresponding call cpufreq_cpu_put() isn't made, the policy wouldn't be | ||
| 217 | * freed as that depends on the kobj count. | ||
| 218 | * | ||
| 219 | * Return: A valid policy on success, otherwise NULL on failure. | ||
| 220 | */ | 218 | */ |
| 221 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) | 219 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) |
| 222 | { | 220 | { |
| @@ -243,12 +241,8 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) | |||
| 243 | EXPORT_SYMBOL_GPL(cpufreq_cpu_get); | 241 | EXPORT_SYMBOL_GPL(cpufreq_cpu_get); |
| 244 | 242 | ||
| 245 | /** | 243 | /** |
| 246 | * cpufreq_cpu_put: Decrements the usage count of a policy | 244 | * cpufreq_cpu_put - Decrement kobject usage counter for cpufreq policy. |
| 247 | * | 245 | * @policy: cpufreq policy returned by cpufreq_cpu_get(). |
| 248 | * @policy: policy earlier returned by cpufreq_cpu_get(). | ||
| 249 | * | ||
| 250 | * This decrements the kobject reference count incremented earlier by calling | ||
| 251 | * cpufreq_cpu_get(). | ||
| 252 | */ | 246 | */ |
| 253 | void cpufreq_cpu_put(struct cpufreq_policy *policy) | 247 | void cpufreq_cpu_put(struct cpufreq_policy *policy) |
| 254 | { | 248 | { |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 002f5169d4eb..e22f0dbaebb1 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
| @@ -1762,7 +1762,7 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time, | |||
| 1762 | /* Start over if the CPU may have been idle. */ | 1762 | /* Start over if the CPU may have been idle. */ |
| 1763 | if (delta_ns > TICK_NSEC) { | 1763 | if (delta_ns > TICK_NSEC) { |
| 1764 | cpu->iowait_boost = ONE_EIGHTH_FP; | 1764 | cpu->iowait_boost = ONE_EIGHTH_FP; |
| 1765 | } else if (cpu->iowait_boost) { | 1765 | } else if (cpu->iowait_boost >= ONE_EIGHTH_FP) { |
| 1766 | cpu->iowait_boost <<= 1; | 1766 | cpu->iowait_boost <<= 1; |
| 1767 | if (cpu->iowait_boost > int_tofp(1)) | 1767 | if (cpu->iowait_boost > int_tofp(1)) |
| 1768 | cpu->iowait_boost = int_tofp(1); | 1768 | cpu->iowait_boost = int_tofp(1); |
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 46254e583982..74e0e0c20c46 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c | |||
| @@ -143,7 +143,7 @@ static int pxa_cpufreq_change_voltage(const struct pxa_freqs *pxa_freq) | |||
| 143 | return ret; | 143 | return ret; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static void __init pxa_cpufreq_init_voltages(void) | 146 | static void pxa_cpufreq_init_voltages(void) |
| 147 | { | 147 | { |
| 148 | vcc_core = regulator_get(NULL, "vcc_core"); | 148 | vcc_core = regulator_get(NULL, "vcc_core"); |
| 149 | if (IS_ERR(vcc_core)) { | 149 | if (IS_ERR(vcc_core)) { |
| @@ -159,7 +159,7 @@ static int pxa_cpufreq_change_voltage(const struct pxa_freqs *pxa_freq) | |||
| 159 | return 0; | 159 | return 0; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static void __init pxa_cpufreq_init_voltages(void) { } | 162 | static void pxa_cpufreq_init_voltages(void) { } |
| 163 | #endif | 163 | #endif |
| 164 | 164 | ||
| 165 | static void find_freq_tables(struct cpufreq_frequency_table **freq_table, | 165 | static void find_freq_tables(struct cpufreq_frequency_table **freq_table, |
diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c index bb93e5cf6a4a..9fddf828a76f 100644 --- a/drivers/cpuidle/governor.c +++ b/drivers/cpuidle/governor.c | |||
| @@ -89,6 +89,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov) | |||
| 89 | mutex_lock(&cpuidle_lock); | 89 | mutex_lock(&cpuidle_lock); |
| 90 | if (__cpuidle_find_governor(gov->name) == NULL) { | 90 | if (__cpuidle_find_governor(gov->name) == NULL) { |
| 91 | ret = 0; | 91 | ret = 0; |
| 92 | list_add_tail(&gov->governor_list, &cpuidle_governors); | ||
| 92 | if (!cpuidle_curr_governor || | 93 | if (!cpuidle_curr_governor || |
| 93 | !strncasecmp(param_governor, gov->name, CPUIDLE_NAME_LEN) || | 94 | !strncasecmp(param_governor, gov->name, CPUIDLE_NAME_LEN) || |
| 94 | (cpuidle_curr_governor->rating < gov->rating && | 95 | (cpuidle_curr_governor->rating < gov->rating && |
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 61316fc51548..5951604e7d5c 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c | |||
| @@ -186,7 +186,7 @@ static unsigned int get_typical_interval(struct menu_device *data, | |||
| 186 | unsigned int min, max, thresh, avg; | 186 | unsigned int min, max, thresh, avg; |
| 187 | uint64_t sum, variance; | 187 | uint64_t sum, variance; |
| 188 | 188 | ||
| 189 | thresh = UINT_MAX; /* Discard outliers above this value */ | 189 | thresh = INT_MAX; /* Discard outliers above this value */ |
| 190 | 190 | ||
| 191 | again: | 191 | again: |
| 192 | 192 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 06f7ed893928..66c19a65a514 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -643,7 +643,6 @@ struct dev_pm_info { | |||
| 643 | struct dev_pm_qos *qos; | 643 | struct dev_pm_qos *qos; |
| 644 | }; | 644 | }; |
| 645 | 645 | ||
| 646 | extern void update_pm_runtime_accounting(struct device *dev); | ||
| 647 | extern int dev_pm_get_subsys_data(struct device *dev); | 646 | extern int dev_pm_get_subsys_data(struct device *dev); |
| 648 | extern void dev_pm_put_subsys_data(struct device *dev); | 647 | extern void dev_pm_put_subsys_data(struct device *dev); |
| 649 | 648 | ||
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 4238dde0aaf0..0ff134d6575a 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
| @@ -96,7 +96,6 @@ static inline void device_set_wakeup_path(struct device *dev) | |||
| 96 | /* drivers/base/power/wakeup.c */ | 96 | /* drivers/base/power/wakeup.c */ |
| 97 | extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name); | 97 | extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name); |
| 98 | extern struct wakeup_source *wakeup_source_create(const char *name); | 98 | extern struct wakeup_source *wakeup_source_create(const char *name); |
| 99 | extern void wakeup_source_drop(struct wakeup_source *ws); | ||
| 100 | extern void wakeup_source_destroy(struct wakeup_source *ws); | 99 | extern void wakeup_source_destroy(struct wakeup_source *ws); |
| 101 | extern void wakeup_source_add(struct wakeup_source *ws); | 100 | extern void wakeup_source_add(struct wakeup_source *ws); |
| 102 | extern void wakeup_source_remove(struct wakeup_source *ws); | 101 | extern void wakeup_source_remove(struct wakeup_source *ws); |
| @@ -134,8 +133,6 @@ static inline struct wakeup_source *wakeup_source_create(const char *name) | |||
| 134 | return NULL; | 133 | return NULL; |
| 135 | } | 134 | } |
| 136 | 135 | ||
| 137 | static inline void wakeup_source_drop(struct wakeup_source *ws) {} | ||
| 138 | |||
| 139 | static inline void wakeup_source_destroy(struct wakeup_source *ws) {} | 136 | static inline void wakeup_source_destroy(struct wakeup_source *ws) {} |
| 140 | 137 | ||
| 141 | static inline void wakeup_source_add(struct wakeup_source *ws) {} | 138 | static inline void wakeup_source_add(struct wakeup_source *ws) {} |
| @@ -204,12 +201,6 @@ static inline void wakeup_source_init(struct wakeup_source *ws, | |||
| 204 | wakeup_source_add(ws); | 201 | wakeup_source_add(ws); |
| 205 | } | 202 | } |
| 206 | 203 | ||
| 207 | static inline void wakeup_source_trash(struct wakeup_source *ws) | ||
| 208 | { | ||
| 209 | wakeup_source_remove(ws); | ||
| 210 | wakeup_source_drop(ws); | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec) | 204 | static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec) |
| 214 | { | 205 | { |
| 215 | return pm_wakeup_ws_event(ws, msec, false); | 206 | return pm_wakeup_ws_event(ws, msec, false); |
