]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PM / QoS: Add function dev_pm_qos_read_value() (v2)
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 26 Sep 2011 18:22:38 +0000 (20:22 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Mon, 26 Sep 2011 18:22:38 +0000 (20:22 +0200)
commitd41a041b58684710638cbc0d5342a661b50db124
treef5eccd895fa460ed82fa1859dc7ff5bf028adbd3
parentb66213cdb002b08b29603d488c451dfe25e2ca20
PM / QoS: Add function dev_pm_qos_read_value() (v2)

To read the current PM QoS value for a given device we need to
make sure that the device's power.constraints object won't be
removed while we're doing that.  For this reason, put the
operation under dev->power.lock and acquire the lock
around the initialization and removal of power.constraints.

Moreover, since we're using the value of power.constraints to
determine whether or not the object is present, the
power.constraints_state field isn't necessary any more and may be
removed.  However, dev_pm_qos_add_request() needs to check if the
device is being removed from the system before allocating a new
PM QoS constraints object for it, so it has to use device_pm_lock()
and the device PM QoS initialization and destruction should be done
under device_pm_lock() as well.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/base/power/main.c
drivers/base/power/qos.c
include/linux/pm.h
include/linux/pm_qos.h