PM / Runtime: Fix pm_runtime_suspended()
authorRafael J. Wysocki <rjw@sisk.pl>
Thu, 16 Dec 2010 16:11:58 +0000 (17:11 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Jan 2011 21:58:32 +0000 (13:58 -0800)
commite87167421ba16d8b2ddd06154f6ce21070051348
treeb8856f7b30a5d5bf6340368515d98758965eb90e
parent8eebfc1e70521832bf5df619c632845bec0ebf2a
PM / Runtime: Fix pm_runtime_suspended()

commit f08f5a0add20834d3f3d876dfe08005a5df656db upstream.

There are some situations (e.g. in __pm_generic_call()), where
pm_runtime_suspended() is used to decide whether or not to execute
a device's (system) ->suspend() callback.  The callback is not
executed if pm_runtime_suspended() returns true, but it does so
for devices that don't even support runtime PM, because the
power.disable_depth device field is ignored by it.  This leads to
problems (i.e. devices are not suspened when they should), so rework
pm_runtime_suspended() so that it returns false if the device's
power.disable_depth field is different from zero.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/power/runtime_pm.txt
include/linux/pm_runtime.h