Re: 9908859acaa9 cpuidle/menu: add per CPU PM QoS resume latency consideration
From: Alex Shi
Date: Thu Feb 23 2017 - 20:50:54 EST
> Well, first, please submit this properly (with a proper subject and CC to linux-pm)
> if I'm expected to apply it.
>
Hi Rafael,
Thanks for reminder!
A raw read function looks better. And maybe useful for others.
Acked-by: Alex Shi <alex.shi@xxxxxxxxxx>
>
>
>
> ---
> drivers/base/power/qos.c | 3 +--
> drivers/cpuidle/governors/menu.c | 2 +-
> include/linux/pm_qos.h | 7 +++++++
> 3 files changed, 9 insertions(+), 3 deletions(-)
>
> Index: linux-pm/drivers/base/power/qos.c
> ===================================================================
> --- linux-pm.orig/drivers/base/power/qos.c
> +++ linux-pm/drivers/base/power/qos.c
> @@ -108,8 +108,7 @@ s32 __dev_pm_qos_read_value(struct devic
> {
> 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);
> }
>
> /**
> Index: linux-pm/drivers/cpuidle/governors/menu.c
> ===================================================================
> --- linux-pm.orig/drivers/cpuidle/governors/menu.c
> +++ linux-pm/drivers/cpuidle/governors/menu.c
> @@ -287,7 +287,7 @@ static int menu_select(struct cpuidle_dr
> unsigned int interactivity_req;
> unsigned int expected_interval;
> unsigned long nr_iowaiters, cpu_load;
> - int resume_latency = dev_pm_qos_read_value(device);
> + int resume_latency = dev_pm_qos_raw_read_value(device);
>
> if (data->needs_update) {
> menu_update(drv, dev);
> Index: linux-pm/include/linux/pm_qos.h
> ===================================================================
> --- linux-pm.orig/include/linux/pm_qos.h
> +++ linux-pm/include/linux/pm_qos.h
> @@ -172,6 +172,12 @@ static inline s32 dev_pm_qos_requested_f
> {
> 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)
> @@ -236,6 +242,7 @@ static inline void dev_pm_qos_hide_laten
>
> 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
>