Commit 8262331e authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

PM / QOS: Rename __dev_pm_qos_read_value() and dev_pm_qos_raw_read_value()

dev_pm_qos_read_value() will soon need to support more constraint types
(min/max frequency) and will have another argument to it, i.e. type of
the constraint. While that is fine for the existing users of
dev_pm_qos_read_value(), but not that optimal for the callers of
__dev_pm_qos_read_value() and dev_pm_qos_raw_read_value() as all the
callers of these two routines are only looking for resume latency
constraint.

Lets make these two routines care only about the resume latency
constraint and rename them to __dev_pm_qos_resume_latency() and
dev_pm_qos_raw_resume_latency().
Suggested-by: default avatarRafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0b07ee94
...@@ -66,7 +66,7 @@ static bool default_suspend_ok(struct device *dev) ...@@ -66,7 +66,7 @@ static bool default_suspend_ok(struct device *dev)
td->constraint_changed = false; td->constraint_changed = false;
td->cached_suspend_ok = false; td->cached_suspend_ok = false;
td->effective_constraint_ns = 0; td->effective_constraint_ns = 0;
constraint_ns = __dev_pm_qos_read_value(dev); constraint_ns = __dev_pm_qos_resume_latency(dev);
spin_unlock_irqrestore(&dev->power.lock, flags); spin_unlock_irqrestore(&dev->power.lock, flags);
......
...@@ -90,16 +90,16 @@ enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask) ...@@ -90,16 +90,16 @@ enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask)
EXPORT_SYMBOL_GPL(dev_pm_qos_flags); EXPORT_SYMBOL_GPL(dev_pm_qos_flags);
/** /**
* __dev_pm_qos_read_value - Get PM QoS constraint for a given device. * __dev_pm_qos_resume_latency - Get resume latency constraint for a given device.
* @dev: Device to get the PM QoS constraint value for. * @dev: Device to get the PM QoS constraint value for.
* *
* This routine must be called with dev->power.lock held. * This routine must be called with dev->power.lock held.
*/ */
s32 __dev_pm_qos_read_value(struct device *dev) s32 __dev_pm_qos_resume_latency(struct device *dev)
{ {
lockdep_assert_held(&dev->power.lock); lockdep_assert_held(&dev->power.lock);
return dev_pm_qos_raw_read_value(dev); return dev_pm_qos_raw_resume_latency(dev);
} }
/** /**
...@@ -112,7 +112,12 @@ s32 dev_pm_qos_read_value(struct device *dev) ...@@ -112,7 +112,12 @@ s32 dev_pm_qos_read_value(struct device *dev)
s32 ret; s32 ret;
spin_lock_irqsave(&dev->power.lock, flags); spin_lock_irqsave(&dev->power.lock, flags);
ret = __dev_pm_qos_read_value(dev);
if (IS_ERR_OR_NULL(dev->power.qos))
ret = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
else
ret = pm_qos_read_value(&dev->power.qos->resume_latency);
spin_unlock_irqrestore(&dev->power.lock, flags); spin_unlock_irqrestore(&dev->power.lock, flags);
return ret; return ret;
......
...@@ -275,7 +275,7 @@ static int rpm_check_suspend_allowed(struct device *dev) ...@@ -275,7 +275,7 @@ static int rpm_check_suspend_allowed(struct device *dev)
|| (dev->power.request_pending || (dev->power.request_pending
&& dev->power.request == RPM_REQ_RESUME)) && dev->power.request == RPM_REQ_RESUME))
retval = -EAGAIN; retval = -EAGAIN;
else if (__dev_pm_qos_read_value(dev) == 0) else if (__dev_pm_qos_resume_latency(dev) == 0)
retval = -EPERM; retval = -EPERM;
else if (dev->power.runtime_status == RPM_SUSPENDED) else if (dev->power.runtime_status == RPM_SUSPENDED)
retval = 1; retval = 1;
......
...@@ -110,7 +110,7 @@ int cpuidle_governor_latency_req(unsigned int cpu) ...@@ -110,7 +110,7 @@ int cpuidle_governor_latency_req(unsigned int cpu)
{ {
int global_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); int global_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
struct device *device = get_cpu_device(cpu); struct device *device = get_cpu_device(cpu);
int device_req = dev_pm_qos_raw_read_value(device); int device_req = dev_pm_qos_raw_resume_latency(device);
return device_req < global_req ? device_req : global_req; return device_req < global_req ? device_req : global_req;
} }
...@@ -139,7 +139,7 @@ s32 pm_qos_read_value(struct pm_qos_constraints *c); ...@@ -139,7 +139,7 @@ s32 pm_qos_read_value(struct pm_qos_constraints *c);
#ifdef CONFIG_PM #ifdef CONFIG_PM
enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask); enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);
enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask); enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask);
s32 __dev_pm_qos_read_value(struct device *dev); s32 __dev_pm_qos_resume_latency(struct device *dev);
s32 dev_pm_qos_read_value(struct device *dev); s32 dev_pm_qos_read_value(struct device *dev);
int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
enum dev_pm_qos_req_type type, s32 value); enum dev_pm_qos_req_type type, s32 value);
...@@ -176,7 +176,7 @@ static inline s32 dev_pm_qos_requested_flags(struct device *dev) ...@@ -176,7 +176,7 @@ static inline s32 dev_pm_qos_requested_flags(struct device *dev)
return dev->power.qos->flags_req->data.flr.flags; return dev->power.qos->flags_req->data.flr.flags;
} }
static inline s32 dev_pm_qos_raw_read_value(struct device *dev) static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev)
{ {
return IS_ERR_OR_NULL(dev->power.qos) ? return IS_ERR_OR_NULL(dev->power.qos) ?
PM_QOS_RESUME_LATENCY_NO_CONSTRAINT : PM_QOS_RESUME_LATENCY_NO_CONSTRAINT :
...@@ -189,7 +189,7 @@ static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, ...@@ -189,7 +189,7 @@ static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev,
static inline enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, static inline enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev,
s32 mask) s32 mask)
{ return PM_QOS_FLAGS_UNDEFINED; } { return PM_QOS_FLAGS_UNDEFINED; }
static inline s32 __dev_pm_qos_read_value(struct device *dev) static inline s32 __dev_pm_qos_resume_latency(struct device *dev)
{ return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; } { return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; }
static inline s32 dev_pm_qos_read_value(struct device *dev) static inline s32 dev_pm_qos_read_value(struct device *dev)
{ return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; } { return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; }
...@@ -245,7 +245,7 @@ static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) ...@@ -245,7 +245,7 @@ static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev)
return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
} }
static inline s32 dev_pm_qos_requested_flags(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) static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev)
{ {
return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT; return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment