]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PM / QoS: Create device constraints objects on notifier registration
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Apr 2012 20:54:47 +0000 (22:54 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Apr 2012 20:54:47 +0000 (22:54 +0200)
commit3564e61b3b3997f50b2f486b62f310d039f6dfd2
treebd86529e4f02cb183fdd1296d65ebdf99412a598
parent50d26207c7d3d2e31806d525aa12366fdf3c9364
PM / QoS: Create device constraints objects on notifier registration

The current behavior of dev_pm_qos_add_notifier() makes device PM QoS
notifiers less than useful.  Namely, it silently returns success when
called before any PM QoS constraints are added for the device, so the
caller will assume that the notifier has been registered, but when
someone actually adds some nontrivial constraints for the device
eventually, the previous callers of dev_pm_qos_add_notifier()
will not know about that and their notifier routines will not be
executed (contrary to their expectations).

To address this problem make dev_pm_qos_add_notifier() create the
constraints object for the device if it is not present when the
routine is called.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by : markgross <markgross@thegnar.org>
drivers/base/power/qos.c