]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'pm-sleep'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Mar 2017 23:43:11 +0000 (00:43 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Mar 2017 23:43:11 +0000 (00:43 +0100)
* pm-cpuidle:
  intel_idle: stop exposing platform acronyms in sysfs
  cpuidle: menu: Avoid taking spinlock for accessing QoS values

* pm-cpufreq:
  cpufreq: intel_pstate: Fix limits issue with operation mode switching
  cpufreq: qoriq: clean up unused code

* pm-sleep:
  PM / hibernate: Define pr_fmt() and use pr_*() instead of printk()
  PM / hibernate: Untangle power_down()

1  2  3  4 
drivers/base/power/qos.c
include/linux/pm_qos.h

diff --combined drivers/base/power/qos.c
index 271bec73185ee58976df939cc6fcb561dceb7f82,73142d0862403702aaee1bd5a16e5669e40907d9,58fcc758334e5bd230a5929a70844d35f4615628,58fcc758334e5bd230a5929a70844d35f4615628..f850daeffba4417ae6b2cc69a0f4aa5bf065987e
     *
     * 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 can register different types of notification callbacks:
 --- *  . a per-device notification callback using the dev_pm_qos_*_notifier API.
 --- *    The notification chain data is stored in the per-device constraint
 --- *    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.
 +++ * Watchers can register a per-device notification callback using the
 +++ * dev_pm_qos_*_notifier API. The notification chain data is stored in the
 +++ * per-device constraint data struct.
     *
     * Note about the per-device constraint data struct allocation:
     * . The per-device constraints data struct ptr is tored into the device
    static DEFINE_MUTEX(dev_pm_qos_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: Device to check the PM QoS flags for.
@@@@@ -103,8 -108,7 -108,8 -108,8 +103,7 @@@@@ s32 __dev_pm_qos_read_value(struct devi
    {
        lockdep_assert_held(&dev->power.lock);
    
- --    return IS_ERR_OR_NULL(dev->power.qos) ?
- --            0 : pm_qos_read_value(&dev->power.qos->resume_latency);
+ ++    return dev_pm_qos_raw_read_value(dev);
    }
    
    /**
@@@@@ -130,7 -134,8 -135,8 -135,8 +129,7 @@@@@ s32 dev_pm_qos_read_value(struct devic
     * @value: Value to assign to the QoS request.
     *
     * Internal function to update the constraints list using the PM QoS core
 --- * code and if needed call the per-device and the global notification
 --- * callbacks
 +++ * code and if needed call the per-device callbacks.
     */
    static int apply_constraint(struct dev_pm_qos_request *req,
                            enum pm_qos_req_action action, s32 value)
        case DEV_PM_QOS_RESUME_LATENCY:
                ret = pm_qos_update_target(&qos->resume_latency,
                                           &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;
        case DEV_PM_QOS_LATENCY_TOLERANCE:
                ret = pm_qos_update_target(&qos->latency_tolerance,
@@@@@ -269,7 -280,7 -281,7 -281,7 +268,7 @@@@@ void dev_pm_qos_constraints_destroy(str
        dev->power.qos = ERR_PTR(-ENODEV);
        spin_unlock_irq(&dev->power.lock);
    
 ---    kfree(c->notifiers);
 +++    kfree(qos->resume_latency.notifiers);
        kfree(qos);
    
     out:
@@@@@ -523,6 -534,36 -535,36 -535,36 +522,6 @@@@@ int dev_pm_qos_remove_notifier(struct d
    }
    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: Device whose ancestor to add the request for.
diff --combined include/linux/pm_qos.h
index 3e2547d6e207c3c5655e6da3b78cd61cb13b7bd5,5aba9f47899d2bd820dcf75a8ede1e73b307b429,0f65d36c2a75153c4f0c1b47f2ff351ca5365239,0f65d36c2a75153c4f0c1b47f2ff351ca5365239..032b559091450ad17dd752cff3bdf58f297aeb18
@@@@@ -6,6 -6,7 -6,7 -6,7 +6,6 @@@@@
     */
    #include <linux/plist.h>
    #include <linux/notifier.h>
 ---#include <linux/miscdevice.h>
    #include <linux/device.h>
    #include <linux/workqueue.h>
    
@@@@@ -146,6 -147,8 -147,8 -147,8 +146,6 @@@@@ int dev_pm_qos_add_notifier(struct devi
                            struct notifier_block *notifier);
    int dev_pm_qos_remove_notifier(struct device *dev,
                               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_destroy(struct device *dev);
    int dev_pm_qos_add_ancestor_request(struct device *dev,
@@@@@ -170,6 -173,12 -173,6 -173,6 +170,12 @@@@@ static inline s32 dev_pm_qos_requested_
    {
        return dev->power.qos->flags_req->data.flr.flags;
    }
+ ++
+ ++static inline s32 dev_pm_qos_raw_read_value(struct device *dev)
+ ++{
+ ++    return IS_ERR_OR_NULL(dev->power.qos) ?
+ ++            0 : pm_qos_read_value(&dev->power.qos->resume_latency);
+ ++}
    #else
    static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev,
                                                          s32 mask)
@@@@@ -197,6 -206,12 -200,12 -200,12 +203,6 @@@@@ static inline int dev_pm_qos_add_notifi
    static inline int dev_pm_qos_remove_notifier(struct device *dev,
                                             struct notifier_block *notifier)
                        { 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)
    {
        dev->power.power_state = PMSG_ON;
@@@@@ -228,6 -243,7 -237,6 -237,6 +234,7 @@@@@ static inline void dev_pm_qos_hide_late
    
    static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) { return 0; }
    static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; }
+ ++static inline s32 dev_pm_qos_raw_read_value(struct device *dev) { return 0; }
    #endif
    
    #endif