aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-02-22 03:28:52 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-02-23 17:05:58 -0500
commitd08d1b27fe2a7f6923952613f5fab56ae47a6f5b (patch)
treecf82606bab0956cd4cf48ada2aa2cff2addbca4a
parente84b4a84e52d4cd8770b4242cd09df0133333f63 (diff)
PM / QoS: Remove global notifiers
They were never used in the kernel, so get rid of them. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--Documentation/power/pm_qos_interface.txt13
-rw-r--r--drivers/base/power/qos.c50
-rw-r--r--include/linux/pm_qos.h8
3 files changed, 5 insertions, 66 deletions
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt
index 129f7c0e1483..21d2d48f87a2 100644
--- a/Documentation/power/pm_qos_interface.txt
+++ b/Documentation/power/pm_qos_interface.txt
@@ -163,8 +163,7 @@ of flags and remove sysfs attributes pm_qos_no_power_off and pm_qos_remote_wakeu
163under the device's power directory. 163under the device's power directory.
164 164
165Notification mechanisms: 165Notification mechanisms:
166The per-device PM QoS framework has 2 different and distinct notification trees: 166The per-device PM QoS framework has a per-device notification tree.
167a per-device notification tree and a global notification tree.
168 167
169int dev_pm_qos_add_notifier(device, notifier): 168int dev_pm_qos_add_notifier(device, notifier):
170Adds a notification callback function for the device. 169Adds a notification callback function for the device.
@@ -174,16 +173,6 @@ is changed (for resume latency device PM QoS only).
174int dev_pm_qos_remove_notifier(device, notifier): 173int dev_pm_qos_remove_notifier(device, notifier):
175Removes the notification callback function for the device. 174Removes the notification callback function for the device.
176 175
177int dev_pm_qos_add_global_notifier(notifier):
178Adds a notification callback function in the global notification tree of the
179framework.
180The callback is called when the aggregated value for any device is changed
181(for resume latency device PM QoS only).
182
183int dev_pm_qos_remove_global_notifier(notifier):
184Removes the notification callback function from the global notification tree
185of the framework.
186
187 176
188Active state latency tolerance 177Active state latency tolerance
189 178
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index d888d9869b6a..271bec73185e 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -17,12 +17,9 @@
17 * 17 *
18 * This QoS design is best effort based. Dependents register their QoS needs. 18 * This QoS design is best effort based. Dependents register their QoS needs.
19 * Watchers register to keep track of the current QoS needs of the system. 19 * Watchers register to keep track of the current QoS needs of the system.
20 * Watchers can register different types of notification callbacks: 20 * Watchers can register a per-device notification callback using the
21 * . a per-device notification callback using the dev_pm_qos_*_notifier API. 21 * dev_pm_qos_*_notifier API. The notification chain data is stored in the
22 * The notification chain data is stored in the per-device constraint 22 * per-device constraint data struct.
23 * data struct.
24 * . a system-wide notification callback using the dev_pm_qos_*_global_notifier
25 * API. The notification chain data is stored in a static variable.
26 * 23 *
27 * Note about the per-device constraint data struct allocation: 24 * Note about the per-device constraint data struct allocation:
28 * . The per-device constraints data struct ptr is tored into the device 25 * . The per-device constraints data struct ptr is tored into the device
@@ -49,8 +46,6 @@
49static DEFINE_MUTEX(dev_pm_qos_mtx); 46static DEFINE_MUTEX(dev_pm_qos_mtx);
50static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx); 47static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx);
51 48
52static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
53
54/** 49/**
55 * __dev_pm_qos_flags - Check PM QoS flags for a given device. 50 * __dev_pm_qos_flags - Check PM QoS flags for a given device.
56 * @dev: Device to check the PM QoS flags for. 51 * @dev: Device to check the PM QoS flags for.
@@ -135,8 +130,7 @@ s32 dev_pm_qos_read_value(struct device *dev)
135 * @value: Value to assign to the QoS request. 130 * @value: Value to assign to the QoS request.
136 * 131 *
137 * Internal function to update the constraints list using the PM QoS core 132 * Internal function to update the constraints list using the PM QoS core
138 * code and if needed call the per-device and the global notification 133 * code and if needed call the per-device callbacks.
139 * callbacks
140 */ 134 */
141static int apply_constraint(struct dev_pm_qos_request *req, 135static int apply_constraint(struct dev_pm_qos_request *req,
142 enum pm_qos_req_action action, s32 value) 136 enum pm_qos_req_action action, s32 value)
@@ -148,12 +142,6 @@ static int apply_constraint(struct dev_pm_qos_request *req,
148 case DEV_PM_QOS_RESUME_LATENCY: 142 case DEV_PM_QOS_RESUME_LATENCY:
149 ret = pm_qos_update_target(&qos->resume_latency, 143 ret = pm_qos_update_target(&qos->resume_latency,
150 &req->data.pnode, action, value); 144 &req->data.pnode, action, value);
151 if (ret) {
152 value = pm_qos_read_value(&qos->resume_latency);
153 blocking_notifier_call_chain(&dev_pm_notifiers,
154 (unsigned long)value,
155 req);
156 }
157 break; 145 break;
158 case DEV_PM_QOS_LATENCY_TOLERANCE: 146 case DEV_PM_QOS_LATENCY_TOLERANCE:
159 ret = pm_qos_update_target(&qos->latency_tolerance, 147 ret = pm_qos_update_target(&qos->latency_tolerance,
@@ -536,36 +524,6 @@ int dev_pm_qos_remove_notifier(struct device *dev,
536EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier); 524EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier);
537 525
538/** 526/**
539 * dev_pm_qos_add_global_notifier - sets notification entry for changes to
540 * target value of the PM QoS constraints for any device
541 *
542 * @notifier: notifier block managed by caller.
543 *
544 * Will register the notifier into a notification chain that gets called
545 * upon changes to the target value for any device.
546 */
547int dev_pm_qos_add_global_notifier(struct notifier_block *notifier)
548{
549 return blocking_notifier_chain_register(&dev_pm_notifiers, notifier);
550}
551EXPORT_SYMBOL_GPL(dev_pm_qos_add_global_notifier);
552
553/**
554 * dev_pm_qos_remove_global_notifier - deletes notification for changes to
555 * target value of PM QoS constraints for any device
556 *
557 * @notifier: notifier block to be removed.
558 *
559 * Will remove the notifier from the notification chain that gets called
560 * upon changes to the target value for any device.
561 */
562int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier)
563{
564 return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
565}
566EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);
567
568/**
569 * dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor. 527 * dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
570 * @dev: Device whose ancestor to add the request for. 528 * @dev: Device whose ancestor to add the request for.
571 * @req: Pointer to the preallocated handle. 529 * @req: Pointer to the preallocated handle.
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index d4d34791e463..3e2547d6e207 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -146,8 +146,6 @@ int dev_pm_qos_add_notifier(struct device *dev,
146 struct notifier_block *notifier); 146 struct notifier_block *notifier);
147int dev_pm_qos_remove_notifier(struct device *dev, 147int dev_pm_qos_remove_notifier(struct device *dev,
148 struct notifier_block *notifier); 148 struct notifier_block *notifier);
149int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
150int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
151void dev_pm_qos_constraints_init(struct device *dev); 149void dev_pm_qos_constraints_init(struct device *dev);
152void dev_pm_qos_constraints_destroy(struct device *dev); 150void dev_pm_qos_constraints_destroy(struct device *dev);
153int dev_pm_qos_add_ancestor_request(struct device *dev, 151int dev_pm_qos_add_ancestor_request(struct device *dev,
@@ -199,12 +197,6 @@ static inline int dev_pm_qos_add_notifier(struct device *dev,
199static inline int dev_pm_qos_remove_notifier(struct device *dev, 197static inline int dev_pm_qos_remove_notifier(struct device *dev,
200 struct notifier_block *notifier) 198 struct notifier_block *notifier)
201 { return 0; } 199 { return 0; }
202static inline int dev_pm_qos_add_global_notifier(
203 struct notifier_block *notifier)
204 { return 0; }
205static inline int dev_pm_qos_remove_global_notifier(
206 struct notifier_block *notifier)
207 { return 0; }
208static inline void dev_pm_qos_constraints_init(struct device *dev) 200static inline void dev_pm_qos_constraints_init(struct device *dev)
209{ 201{
210 dev->power.power_state = PMSG_ON; 202 dev->power.power_state = PMSG_ON;