Skip to content

Commit

Permalink
PM / QoS: Use lockdep asserts to find missing hold of power.lock
Browse files Browse the repository at this point in the history
Add lockdep asserts for holding the dev->power.lock to non-static
functions which require this. They could be used outside of the file so
asserts may help in detecting locking misuse.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Krzysztof Kozlowski authored and Rafael J. Wysocki committed Jan 23, 2015
1 parent f5f4eda commit f90b8ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/base/power/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask)
struct pm_qos_flags *pqf;
s32 val;

lockdep_assert_held(&dev->power.lock);

if (IS_ERR_OR_NULL(qos))
return PM_QOS_FLAGS_UNDEFINED;

Expand Down Expand Up @@ -104,6 +106,8 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_flags);
*/
s32 __dev_pm_qos_read_value(struct device *dev)
{
lockdep_assert_held(&dev->power.lock);

return IS_ERR_OR_NULL(dev->power.qos) ?
0 : pm_qos_read_value(&dev->power.qos->resume_latency);
}
Expand Down

0 comments on commit f90b8ad

Please sign in to comment.