PM / Runtime: Check device PM QoS setting before "no callbacks" check
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 15 Aug 2012 19:32:04 +0000 (21:32 +0200)
committerSimone Willett <swillett@nvidia.com>
Tue, 23 Oct 2012 01:39:12 +0000 (18:39 -0700)
commit9c7d665a1c2403bbb4520637233b1408f2473202
tree85e519d8690078eac64480ee365e94bd05e6d4fe
parent2fa2b6eba07668804874ed8f0535061f97eae501
PM / Runtime: Check device PM QoS setting before "no callbacks" check

If __dev_pm_qos_read_value(dev) returns a negative value,
rpm_suspend() should return -EPERM for dev even if its
power.no_callbacks flag is set.  For this to happen, the device's
power.no_callbacks flag has to be checked after the PM QoS check,
so move the PM QoS check to rpm_check_suspend_allowed() (this will
make it cover idle notifications as well as runtime suspend too).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@vger.kernel.org
(cherry picked from commit 55d7ec4520e86d735d178c15d7df33d507bd43c6)
Change-Id: I02bbf2b76fc2881fdc13b0d885143a88addfc619
Reviewed-on: http://git-master/r/145854
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/base/power/runtime.c