PM: runtime: add might_sleep to PM runtime functions
authorColin Cross <ccross@android.com>
Wed, 10 Aug 2011 16:41:59 +0000 (11:41 -0500)
committerColin Cross <ccross@android.com>
Sat, 24 Sep 2011 03:08:51 +0000 (20:08 -0700)
commitb1d0d5fe07a4c96d791f3126bbfc8d0131d1aa32
treeca627d7b2417dceb578d742ed11d7ed7edc7edc7
parent3e59ce0fde3735d6e35be08b3d766031913bfb68
PM: runtime: add might_sleep to PM runtime functions

The list of functions that can be called in atomic context is
non-intuitive (pm_runtime_put_sync can not, but
pm_runtime_put_sync_suspend can, if pm_runtime_irq_safe has
been called?).  The code is actively misleading - the entry
points all start with spin_lock_irqsave, suggesting they
are safe to call in atomic context, but may later
enable interrupts.

Add might_sleep_if to all the __pm_runtime_* entry points
to enforce correct usage.

Also add pm_runtime_put_sync_autosuspend to the list of
functions that can be called in atomic context.

Change-Id: Icac17a10d77c64d44bd2761a91a588dfd1d0c6f0
Signed-off-by: Colin Cross <ccross@android.com>
Documentation/power/runtime_pm.txt
drivers/base/power/runtime.c