mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
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>
This commit is contained in:
parent
e84b4a84e5
commit
d08d1b27fe
@ -163,8 +163,7 @@ of flags and remove sysfs attributes pm_qos_no_power_off and pm_qos_remote_wakeu
|
|||||||
under the device's power directory.
|
under the device's power directory.
|
||||||
|
|
||||||
Notification mechanisms:
|
Notification mechanisms:
|
||||||
The per-device PM QoS framework has 2 different and distinct notification trees:
|
The per-device PM QoS framework has a per-device notification tree.
|
||||||
a per-device notification tree and a global notification tree.
|
|
||||||
|
|
||||||
int dev_pm_qos_add_notifier(device, notifier):
|
int dev_pm_qos_add_notifier(device, notifier):
|
||||||
Adds a notification callback function for the device.
|
Adds a notification callback function for the device.
|
||||||
@ -174,16 +173,6 @@ is changed (for resume latency device PM QoS only).
|
|||||||
int dev_pm_qos_remove_notifier(device, notifier):
|
int dev_pm_qos_remove_notifier(device, notifier):
|
||||||
Removes the notification callback function for the device.
|
Removes the notification callback function for the device.
|
||||||
|
|
||||||
int dev_pm_qos_add_global_notifier(notifier):
|
|
||||||
Adds a notification callback function in the global notification tree of the
|
|
||||||
framework.
|
|
||||||
The callback is called when the aggregated value for any device is changed
|
|
||||||
(for resume latency device PM QoS only).
|
|
||||||
|
|
||||||
int dev_pm_qos_remove_global_notifier(notifier):
|
|
||||||
Removes the notification callback function from the global notification tree
|
|
||||||
of the framework.
|
|
||||||
|
|
||||||
|
|
||||||
Active state latency tolerance
|
Active state latency tolerance
|
||||||
|
|
||||||
|
@ -17,12 +17,9 @@
|
|||||||
*
|
*
|
||||||
* This QoS design is best effort based. Dependents register their QoS needs.
|
* This QoS design is best effort based. Dependents register their QoS needs.
|
||||||
* Watchers register to keep track of the current QoS needs of the system.
|
* Watchers register to keep track of the current QoS needs of the system.
|
||||||
* Watchers can register different types of notification callbacks:
|
* Watchers can register a per-device notification callback using the
|
||||||
* . a per-device notification callback using the dev_pm_qos_*_notifier API.
|
* dev_pm_qos_*_notifier API. The notification chain data is stored in the
|
||||||
* The notification chain data is stored in the per-device constraint
|
* per-device constraint data struct.
|
||||||
* data struct.
|
|
||||||
* . a system-wide notification callback using the dev_pm_qos_*_global_notifier
|
|
||||||
* API. The notification chain data is stored in a static variable.
|
|
||||||
*
|
*
|
||||||
* Note about the per-device constraint data struct allocation:
|
* Note about the per-device constraint data struct allocation:
|
||||||
* . The per-device constraints data struct ptr is tored into the device
|
* . The per-device constraints data struct ptr is tored into the device
|
||||||
@ -49,8 +46,6 @@
|
|||||||
static DEFINE_MUTEX(dev_pm_qos_mtx);
|
static DEFINE_MUTEX(dev_pm_qos_mtx);
|
||||||
static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx);
|
static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx);
|
||||||
|
|
||||||
static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __dev_pm_qos_flags - Check PM QoS flags for a given device.
|
* __dev_pm_qos_flags - Check PM QoS flags for a given device.
|
||||||
* @dev: Device to check the PM QoS flags for.
|
* @dev: Device to check the PM QoS flags for.
|
||||||
@ -135,8 +130,7 @@ s32 dev_pm_qos_read_value(struct device *dev)
|
|||||||
* @value: Value to assign to the QoS request.
|
* @value: Value to assign to the QoS request.
|
||||||
*
|
*
|
||||||
* Internal function to update the constraints list using the PM QoS core
|
* Internal function to update the constraints list using the PM QoS core
|
||||||
* code and if needed call the per-device and the global notification
|
* code and if needed call the per-device callbacks.
|
||||||
* callbacks
|
|
||||||
*/
|
*/
|
||||||
static int apply_constraint(struct dev_pm_qos_request *req,
|
static int apply_constraint(struct dev_pm_qos_request *req,
|
||||||
enum pm_qos_req_action action, s32 value)
|
enum pm_qos_req_action action, s32 value)
|
||||||
@ -148,12 +142,6 @@ static int apply_constraint(struct dev_pm_qos_request *req,
|
|||||||
case DEV_PM_QOS_RESUME_LATENCY:
|
case DEV_PM_QOS_RESUME_LATENCY:
|
||||||
ret = pm_qos_update_target(&qos->resume_latency,
|
ret = pm_qos_update_target(&qos->resume_latency,
|
||||||
&req->data.pnode, action, value);
|
&req->data.pnode, action, value);
|
||||||
if (ret) {
|
|
||||||
value = pm_qos_read_value(&qos->resume_latency);
|
|
||||||
blocking_notifier_call_chain(&dev_pm_notifiers,
|
|
||||||
(unsigned long)value,
|
|
||||||
req);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case DEV_PM_QOS_LATENCY_TOLERANCE:
|
case DEV_PM_QOS_LATENCY_TOLERANCE:
|
||||||
ret = pm_qos_update_target(&qos->latency_tolerance,
|
ret = pm_qos_update_target(&qos->latency_tolerance,
|
||||||
@ -535,36 +523,6 @@ int dev_pm_qos_remove_notifier(struct device *dev,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier);
|
EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier);
|
||||||
|
|
||||||
/**
|
|
||||||
* dev_pm_qos_add_global_notifier - sets notification entry for changes to
|
|
||||||
* target value of the PM QoS constraints for any device
|
|
||||||
*
|
|
||||||
* @notifier: notifier block managed by caller.
|
|
||||||
*
|
|
||||||
* Will register the notifier into a notification chain that gets called
|
|
||||||
* upon changes to the target value for any device.
|
|
||||||
*/
|
|
||||||
int dev_pm_qos_add_global_notifier(struct notifier_block *notifier)
|
|
||||||
{
|
|
||||||
return blocking_notifier_chain_register(&dev_pm_notifiers, notifier);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(dev_pm_qos_add_global_notifier);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dev_pm_qos_remove_global_notifier - deletes notification for changes to
|
|
||||||
* target value of PM QoS constraints for any device
|
|
||||||
*
|
|
||||||
* @notifier: notifier block to be removed.
|
|
||||||
*
|
|
||||||
* Will remove the notifier from the notification chain that gets called
|
|
||||||
* upon changes to the target value for any device.
|
|
||||||
*/
|
|
||||||
int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier)
|
|
||||||
{
|
|
||||||
return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
|
* dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
|
||||||
* @dev: Device whose ancestor to add the request for.
|
* @dev: Device whose ancestor to add the request for.
|
||||||
|
@ -146,8 +146,6 @@ int dev_pm_qos_add_notifier(struct device *dev,
|
|||||||
struct notifier_block *notifier);
|
struct notifier_block *notifier);
|
||||||
int dev_pm_qos_remove_notifier(struct device *dev,
|
int dev_pm_qos_remove_notifier(struct device *dev,
|
||||||
struct notifier_block *notifier);
|
struct notifier_block *notifier);
|
||||||
int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
|
|
||||||
int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
|
|
||||||
void dev_pm_qos_constraints_init(struct device *dev);
|
void dev_pm_qos_constraints_init(struct device *dev);
|
||||||
void dev_pm_qos_constraints_destroy(struct device *dev);
|
void dev_pm_qos_constraints_destroy(struct device *dev);
|
||||||
int dev_pm_qos_add_ancestor_request(struct device *dev,
|
int dev_pm_qos_add_ancestor_request(struct device *dev,
|
||||||
@ -199,12 +197,6 @@ static inline int dev_pm_qos_add_notifier(struct device *dev,
|
|||||||
static inline int dev_pm_qos_remove_notifier(struct device *dev,
|
static inline int dev_pm_qos_remove_notifier(struct device *dev,
|
||||||
struct notifier_block *notifier)
|
struct notifier_block *notifier)
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
static inline int dev_pm_qos_add_global_notifier(
|
|
||||||
struct notifier_block *notifier)
|
|
||||||
{ return 0; }
|
|
||||||
static inline int dev_pm_qos_remove_global_notifier(
|
|
||||||
struct notifier_block *notifier)
|
|
||||||
{ return 0; }
|
|
||||||
static inline void dev_pm_qos_constraints_init(struct device *dev)
|
static inline void dev_pm_qos_constraints_init(struct device *dev)
|
||||||
{
|
{
|
||||||
dev->power.power_state = PMSG_ON;
|
dev->power.power_state = PMSG_ON;
|
||||||
|
Loading…
Reference in New Issue
Block a user